Update discount

Update discount

POST /UpdateDiscount

Updates the name, type, value or sales screen visibility of a defined discount.

Only the fields that are sent are updated; fields that are omitted keep their current values.

Sample request

Update discount
curl -X POST "https://ext.adisyo.com/api/External/v2/UpdateDiscount" \
  --header "x-api-key: ..." \
  --header "x-api-secret: ..." \
  --header "x-api-consumer: ..." \
  --header "Content-Type: application/json" \
  --data '{
    "discountId": 1234,
    "name": "Cookie Campaign - CODE123",
    "amount": 20
  }'

Request parameters

Parameter NameData TypeRequiredDescription
discountIdNumberYesAdisyo ID of the discount to update
nameStringNoName of the discount. Cannot be empty, at most 150 characters
discountTypeNumberNoDiscount type. 1 Percentage, 2 Amount
amountDecimalNoDiscount 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; when false, it is visible

At least one field other than discountId must be sent.

Rules

  • Validation runs after the sent fields are merged with the current values. For example, if only discountType 1 is sent, the discount's current value must not exceed 100.
  • A change only affects discounts applied from now on; amounts on orders the discount was previously applied to do not change.
  • Returns 715 for a discount ID that is deleted, not found or belongs to another restaurant.

Sample response

Update discount
{
  "discountId": 1234,
  "status": 100,
  "message": "Discount updated successfully."
}

Response parameters

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