Coupons
Create Coupon
Create a coupon
POST
/
v1
/
coupons
Copy
curl --request POST \
--url https://api.withflex.com/v1/coupons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"coupon": {
"applies_to": {
"products": [
"<string>"
]
},
"name": "Coupon",
"amount_off": 100,
"duration": "<any>",
"duration_in_months": null,
"percent_off": 10,
"max_redemptions": 100,
"metadata": {
"key": "value"
}
}
}'
Copy
{
"coupon": {
"coupon_id": "fcoup_1234567890",
"amount_off": 123,
"applies_to": {
"products": [
"<string>"
]
},
"duration": "<any>",
"duration_in_months": 123,
"metadata": {},
"name": "<string>",
"percent_off": 123,
"max_redemptions": 123,
"times_redeemed": 123,
"valid": true,
"created_at": "<string>",
"test_mode": true
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Response
200
application/json
The response is of type object
.
Copy
curl --request POST \
--url https://api.withflex.com/v1/coupons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"coupon": {
"applies_to": {
"products": [
"<string>"
]
},
"name": "Coupon",
"amount_off": 100,
"duration": "<any>",
"duration_in_months": null,
"percent_off": 10,
"max_redemptions": 100,
"metadata": {
"key": "value"
}
}
}'
Copy
{
"coupon": {
"coupon_id": "fcoup_1234567890",
"amount_off": 123,
"applies_to": {
"products": [
"<string>"
]
},
"duration": "<any>",
"duration_in_months": 123,
"metadata": {},
"name": "<string>",
"percent_off": 123,
"max_redemptions": 123,
"times_redeemed": 123,
"valid": true,
"created_at": "<string>",
"test_mode": true
}
}
Assistant
Responses are generated using AI and may contain mistakes.