curl --request POST \
--url https://api.withflex.com/v1/promo_codes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"promo_code": {
"coupon_id": "fcoup_1234567890",
"code": "SUMMER2016",
"max_redemptions": 100,
"customer": "fcus_01HACM7FZ1084XB1GB6053VM0D",
"metadata": {
"key": "value"
}
}
}'
{
"promo_code": {
"promo_code_id": "fpromo_01k3p7zzdh18fa378epap93907",
"code": "SUMMER2016",
"coupon": {
"coupon_id": "fcoup_1234567890",
"amount_off": 100,
"applies_to": null,
"duration": "once",
"duration_in_months": null,
"metadata": {
"key": "value"
},
"name": "Coupon",
"percent_off": 10,
"max_redemptions": 100,
"times_redeemed": 0,
"valid": true,
"created_at": "2025-08-27T17:07:47.761493Z",
"test_mode": true
},
"max_redemptions": 100,
"times_redeemed": 0,
"created_at": "2025-08-27T17:07:47.761653Z",
"customer": "fcus_01HACM7FZ1084XB1GB6053VM0D",
"active": true,
"metadata": {
"key": "value"
},
"test_mode": false
}
}
Create a promo code
curl --request POST \
--url https://api.withflex.com/v1/promo_codes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"promo_code": {
"coupon_id": "fcoup_1234567890",
"code": "SUMMER2016",
"max_redemptions": 100,
"customer": "fcus_01HACM7FZ1084XB1GB6053VM0D",
"metadata": {
"key": "value"
}
}
}'
{
"promo_code": {
"promo_code_id": "fpromo_01k3p7zzdh18fa378epap93907",
"code": "SUMMER2016",
"coupon": {
"coupon_id": "fcoup_1234567890",
"amount_off": 100,
"applies_to": null,
"duration": "once",
"duration_in_months": null,
"metadata": {
"key": "value"
},
"name": "Coupon",
"percent_off": 10,
"max_redemptions": 100,
"times_redeemed": 0,
"valid": true,
"created_at": "2025-08-27T17:07:47.761493Z",
"test_mode": true
},
"max_redemptions": 100,
"times_redeemed": 0,
"created_at": "2025-08-27T17:07:47.761653Z",
"customer": "fcus_01HACM7FZ1084XB1GB6053VM0D",
"active": true,
"metadata": {
"key": "value"
},
"test_mode": false
}
}
Use a Bearer token to access this API.
The response is of type object
.