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: stringAcceptrequired
Type of content accepted by the API (application/json in most cases)
- Type: stringApplicationrequired
Application key for specific client app
- Type: stringContent
- Type requiredContent-Type header
- Type: stringA
P I - V E R S I O N requiredVersion of the API to be used
- Type: stringDevice
- U U I D requiredUser's Device UUID
- Type: stringAuthorizationrequired
Bearer token of the signed-in customer
- Type: stringX
- Request - I D requiredUnique request identifier
Body
- Type: stringpromo
_codes requiredOne or more promo codes, separated by a comma and a space.
Responses
- application/json
- 400
A code is unknown, expired, already claimed, or not a promo code the customer may claim.
- 401
Missing or invalid customer token.
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
}
]
}
}