POST Claim Promo Code

​

Claims one or more promo codes for the signed-in customer. This is the "add a promo code" box: the codes become discounts on the account, which then apply at checkout like any other.

It is a POST because it creates something — a claim tied to this customer and this device. Claiming the same code twice does not stack it.

Codes are separated by a comma and a space. SUMMER20, WELCOME5 is two codes; SUMMER20,WELCOME5 is read as one and will not be found. Only public and unique promo codes can be claimed this way.

The response is the discounts that were claimed, so you can show the customer what they just got.

Headers

  • Type of content accepted by the API (application/json in most cases)

  • Application key for specific client app

  • Content-Type header

  • Version of the API to be used

  • User's Device UUID

  • Bearer token of the signed-in customer

  • Unique request identifier

Body

required
application/json
  • One or more promo codes, separated by a comma and a space.

Responses

  • application/json
  • A code is unknown, expired, already claimed, or not a promo code the customer may claim.

  • Missing or invalid customer token.

Request Example for post/discounts/promotions
curl https://api-public-demo.menu.app/api/discounts/promotions \
  --request POST \
  --header 'Accept: application/json' \
  --header 'Application: application-key' \
  --header 'Content-Type: application/json' \
  --header 'API-VERSION: ' \
  --header 'Device-UUID: 1234' \
  --header 'Authorization: ' \
  --header 'X-Request-ID: c10b4a70-6274-490d-80a0-03e7bb826937' \
  --data '{
  "promo_codes": "SUMMER20"
}'
{
  "status": "OK",
  "code": 200,
  "data": {
    "discounts": [
      {
        "id": 10005906790,
        "name": "20% off in summer",
        "type_id": 3
      }
    ]
  }
}