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 Name | Data Type | Required | Description |
|---|---|---|---|
discountId | Number | Yes | Adisyo ID of the discount to update |
name | String | No | Name of the discount. Cannot be empty, at most 150 characters |
discountType | Number | No | Discount type. 1 Percentage, 2 Amount |
amount | Decimal | No | Discount value. Must be greater than 0; cannot exceed 100 for percentage discounts |
hideOnSalesScreen | Boolean | No | When 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
discountType1is 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
715for 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 Name | Data Type | Description |
|---|---|---|
discountId | Number | Adisyo ID of the updated discount |
status | Number | Response Codes. Returns 715 for invalid parameters |
message | String | Result message |