Update a discount
Update an existing discount's details. You can modify the name, amount, expiration, and other properties. Note: Changing the discount code may affect customers who have saved the old code.
Authorization
Public key Secret key In: header
In: header
Path Parameters
PATCH /v0/discounts/:discountId/update Parameter
uuidRequest Body
application/json
PATCH /v0/discounts/:discountId/update Request body
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X PATCH "https://example.com/v0/discounts/497f6eca-6276-4993-bfeb-53cbbbba6f08/update" \ -H "Content-Type: application/json" \ -d '{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08" }'{ "status": "success", "data": { "discount": { "object": "discount", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "type": "code", "name": null, "amount": "string", "amountType": "fixed", "discountCode": null, "validFrom": null, "validUntil": null, "purchaseLimit": null, "timesUsed": 0, "status": "active", "includesAllOffers": false, "excludedOffers": [ "string" ], "currency": "AFN" } }}Get discount details GET
Retrieve detailed information about a specific discount by its ID. Returns the full discount object including usage statistics and associated products/offers.
Archive a discount PATCH
Archive (soft delete) a discount by its ID. Archived discounts can no longer be used at checkout but remain in the system for reporting purposes. This action is reversible.