Skip to main content
POST
/
coupons
Create Coupon
curl --request POST \
  --url https://api.atlas.co/functions/v1/coupons \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "duration": "once",
  "id": "<string>",
  "name": "<string>",
  "percent_off": 50,
  "amount_off": 123,
  "currency": "<string>",
  "duration_in_months": 123,
  "max_redemptions": 123,
  "redeem_by": 123,
  "applies_to": {
    "products": [
      "<string>"
    ]
  },
  "metadata": {}
}
'
{
  "id": "<string>",
  "object": "coupon",
  "name": "<string>",
  "percent_off": 123,
  "amount_off": 123,
  "currency": "<string>",
  "duration": "<string>",
  "duration_in_months": 123,
  "max_redemptions": 123,
  "times_redeemed": 123,
  "redeem_by": 123,
  "applies_to": {
    "products": [
      "<string>"
    ]
  },
  "valid": true,
  "metadata": {},
  "created": 123
}

Authorizations

Authorization
string
header
required

API key (sk_test_* or sk_live_*)

Body

application/json
duration
enum<string>
required
Available options:
once,
repeating,
forever
id
string

Custom coupon code

name
string
percent_off
number
Required range: 0 <= x <= 100
amount_off
integer
currency
string
duration_in_months
integer
max_redemptions
integer
redeem_by
integer
applies_to
object
metadata
object

Response

Coupon created

id
string
object
enum<string>
Available options:
coupon
name
string
percent_off
number
amount_off
integer
currency
string
duration
string
duration_in_months
integer
max_redemptions
integer
times_redeemed
integer
redeem_by
integer
applies_to
object
valid
boolean
metadata
object
created
integer