Skip to main content
POST
/
coupon
/
generate
Generate coupon
curl --request POST \
  --url https://app.xmenu.it/api/coupon/generate \
  --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>"
}
}

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

gencode
string
required

Generator code created in the restaurant backend area (to generate the coupon according to the generator rules)

valid_email
string

Email address of the customer. Coupon will be usable only by this customer.

Response

Coupon generation response

success
boolean
required

Operation result: true if successful, false if failed

error
string

Error code if the operation failed. Possible values:

  • NOT_FOUND = Generator not found

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