Measure MapAPI

Create a product

POST/products
products:write EnterpriseOpen Guest
Adds a product to the catalogue. It needs a name and at least one way to charge: by area (pricing), by length (distancePricing) or per spot (itemPricing). Inside an organisation, only the owner, Admins and Managers may change the catalogue.

Request body application/json

Fields of ProductInput:

  • namestring
  • descriptionstring
  • categorystring
  • colorstring
  • iconstring
  • thumbnailUrlstring(uri)
  • textureUrlstring(uri)
  • textureTileMetersnumber
    0.01 to 20
  • enabledboolean
    Defaulttrue
  • archivedboolean
  • taxRatenumber
    0 to 100
  • costPricenumber
    What the product costs you, for your own margin in the app. Stored, never returned.
    ≥ 0
  • pricingobject
    How a product is charged, by area, by length or per spot. A new price needs its unit and currency; on an update, a price sent without them keeps the product's own.
  • distancePricingobject
    How a product is charged, by area, by length or per spot. A new price needs its unit and currency; on an update, a price sent without them keeps the product's own.
  • itemPricingobject
    How a product is charged, by area, by length or per spot. A new price needs its unit and currency; on an update, a price sent without them keeps the product's own.
  • at most 24 items

Responses

  • Product:

    • typestringrequired
      Always"product"
    • idstringrequired
    • namestringrequired
    • descriptionstring
    • ownerUidstringrequired
      Whose catalogue it belongs to, the organisation owner's or yours.
    • createdOninteger(int64)
    • enabledbooleanrequired
      Offered in the pickers.
    • archivedbooleanrequired
    • categorystring
    • colorstring
    • iconstring
    • thumbnailUrlstring(uri)
    • textureUrlstring(uri)
      A picture that fills shapes priced with it on the map.
    • textureTileMetersnumber
      Ground covered by one tile of the texture, in metres.
    • taxRatenumber
      A percentage. Absent means the project's rate applies; 0 means untaxed.
    • pricingobject
      How a product is charged, by area, by length or per spot. A new price needs its unit and currency; on an update, a price sent without them keeps the product's own.
    • distancePricingobject
      How a product is charged, by area, by length or per spot. A new price needs its unit and currency; on an update, a price sent without them keeps the product's own.
    • itemPricingobject
      How a product is charged, by area, by length or per spot. A new price needs its unit and currency; on an update, a price sent without them keeps the product's own.

Errors

A failed request answers with one of these, in an Error body.

400invalid_bodyA value in the request body is missing, has the wrong type, is too long or is not one of the accepted values.
400invalid_product_pricingA product's prices are not complete or not valid. Check the unit, the currency, the type and every tier.
401unauthorized_actionThe item is not on your account or your members', the request came from a web page on a website the key does not allow, or the action is not allowed for this person.
403insufficient_scopeThe key does not have the access this endpoint needs. Create a key with that access.
403invalid_api_keyNo key was sent in the Authorization header, or the key is unknown, revoked, or past the time it kept working after being replaced.

Try it

This key is

The key stays in this tab and goes only to the API. Use a sandbox key while you try things: requests are real, and what they change is changed.

POST https://api.measuremaponline.com/api/v1/products

Fill in your API key to send.

As a cURL command
Shell
curl -X POST 'https://api.measuremaponline.com/api/v1/products' \
  -H "Authorization: $MMO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Artificial turf",
  "description": "40 mm pile, laid on a compacted base",
  "category": "Surfaces",
  "color": "#22c55e",
  "taxRate": 20,
  "pricing": {
    "unit": "m²",
    "currency": "gbp",
    "type": "range",
    "prices": [
      {
        "min": 0,
        "max": 100,
        "price": 32
      },
      {
        "min": 100,
        "price": 28
      }
    ]
  }
}'