Create discount

Create discount

POST /CreateDiscount

⚠️

The former address of this endpoint, /create-discount, will keep working for a while for backward compatibility but will be removed in the future. Please switch your integration to /CreateDiscount.

Creates a new defined discount in the restaurant the request is made for.

The returned discountId is used in the discountId field of the Save order and Order discount endpoints.

Sample request

Create discount
curl -X POST "https://ext.adisyo.com/api/External/v2/CreateDiscount" \
  --header "x-api-key: ..." \
  --header "x-api-secret: ..." \
  --header "x-api-consumer: ..." \
  --header "Content-Type: application/json" \
  --data '{
    "name": "Cookie Campaign - CODE123",
    "discountType": 1,
    "amount": 15,
    "hideOnSalesScreen": true
  }'

Request parameters

Parameter NameData TypeRequiredDescription
nameStringYesName of the discount. At most 150 characters
discountTypeNumberYesDiscount type. 1 Percentage, 2 Amount
amountDecimalYesDiscount value. Must be greater than 0; cannot exceed 100 for percentage discounts
hideOnSalesScreenBooleanNoWhen true, the discount is not listed on the restaurant's sales screen and can only be applied via the API. If omitted, it is visible on the sales screen

Rules

  • There is no discount code field; the discount is created with its name.
  • Sending the same name again creates a new discount. No duplicate check is performed.
  • A discount hidden from the sales screen cannot be picked manually in the restaurant but can still be applied via the API.

Sample response

Create discount
{
  "discountId": 1234,
  "status": 100,
  "message": "Discount created successfully."
}

Response parameters

Parameter NameData TypeDescription
discountIdNumberAdisyo ID of the created discount
statusNumberResponse Codes. Returns 715 for invalid parameters
messageStringResult message