Skip to main content
POST
/
coupon
/
apply
Apply coupon
curl --request POST \
  --url https://app.xmenu.it/api/coupon/apply \
  --header 'X-Api-Key: <api-key>'
{
"success": true,
"error": "<string>",
"message": "<string>",
"coupon": {
"code": "<string>",
"discount_perc": 123,
"quantity": 123,
"order_min": 123,
"valid_from": "2023-12-25",
"valid_to": "2023-12-25",
"valid_weekdays": [
3
],
"valid_email": "<string>"
},
"order": {
"discount": 123,
"total": 123
}
}

Authorizations

X-Api-Key
string
header
required

Restaurant API Key. Can be obtained from Tools > API Access in the xMenu dashboard.

Query Parameters

restuid
string
required

Unique restaurant identifier

code
string
required

Coupon code to redeem

total
number
required

Order total amount on which to apply the coupon

Response

Coupon application response

success
boolean
required

Operation result: true if successful, false if failed

error
string

Error code if the operation failed. Possible values:

  • NOT_FOUND = Coupon not found
  • CANNOT_APPLY = Cannot redeem coupon (invalid or not valid - see message field for details)

See Error codes for general error codes that may also occur.

message
string

Human-readable error description if the operation failed

coupon
object

Coupon object with details about discount code

order
object

Result of applying a coupon to an order