Create a new discount
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.
Authorization
Public key Secret key In: header
In: header
Request Body
application/json
POST /v0/discounts/create Request body
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/v0/discounts/create" \ -H "Content-Type: application/json" \ -d '{ "type": "code", "amount": 1, "amountType": "fixed", "validFrom": 0, "excludedOffers": [ "string" ], "includedOffers": [ "string" ], "currency": "AFN", "status": "active", "timezone": "string" }'{ "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" } }}List discounts GET
Retrieve a paginated list of discounts with powerful filtering options. Discounts can be coupon codes that customers enter at checkout, or automatic sale discounts applied based on conditions. Results are sorted by creation date (newest first) by default.
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.