Discounts
Create a discount
Creates a sale or a code discount, a percentage or a fixed amount, over all offers or the ones named, valid in a window.
Authorization
bearer discounts:writeAuthorizationBearer <token>
A v1 API key; the scope named is the one the route needs.
In: header
Scope: discounts:write
Header Parameters
Idempotency-Key*string
Names the act so a retry under it lands on the stored answer (idempotency-key).
Length
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://example.com/v1/discounts" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "type": "code", "value": 1, "valueType": "fixed", "currency": "string", "validFrom": "2019-08-24T14:15:22Z", "timezone": "string" }'{ "id": "string", "liveMode": true, "type": "string", "name": "string", "value": 0, "valueType": "string", "code": "string", "currency": "string", "validFrom": "2019-08-24T14:15:22Z", "validUntil": "2019-08-24T14:15:22Z", "timezone": "string", "purchaseLimit": 1, "timesUsed": 0, "includedOfferIds": [ "string" ], "excludedOfferIds": [ "string" ], "appliesToAllOffers": true, "active": true, "archivedAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}