Get discount details
Retrieve detailed information about a specific discount by its ID. Returns the full discount object including usage statistics and associated products/offers.
Authorization
Public key In: header
Path Parameters
GET /v0/discounts/:discountId Parameter
uuidResponse Body
application/json
application/json
curl -X GET "https://example.com/v0/discounts/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" } }}Create a new discount POST
Create a new discount with the specified details. Discounts can be either: - Coupon codes: Customers enter a code at checkout to receive the discount - Sale discounts: Automatically applied based on conditions Both fixed amount and percentage-based discounts are supported.
Update a discount PATCH
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.