POST
/
v1
/
discounts
curl --request POST \
  --url https://api.creem.io/v1/discounts \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '{
  "name": "Holiday Sale",
  "code": "HOLIDAY2024",
  "type": "percentage",
  "amount": 20,
  "currency": "USD",
  "percentage": 15,
  "expiry_date": "2024-12-31T23:59:59Z",
  "max_redemptions": 100,
  "duration": "repeating",
  "duration_in_months": 6,
  "applies_to_products": [
    "prod_123",
    "prod_456"
  ]
}'
{
  "id": "<string>",
  "mode": "test",
  "object": "discount",
  "status": "active",
  "name": "Holiday Sale",
  "code": "HOLIDAY2024",
  "type": "percentage",
  "amount": 20,
  "currency": "USD",
  "percentage": 15,
  "expiry_date": "2024-12-31T23:59:59Z",
  "max_redemptions": 100,
  "duration": "repeating",
  "duration_in_months": 6,
  "applies_to_products": [
    "prod_123",
    "prod_456"
  ]
}

Headers

x-api-key
string
required

Body

application/json

Response

200 - application/json
Successfully created a discount

The response is of type object.