curl --request GET \
--url https://api.withflex.com/v1/promo_codes \
--header 'Authorization: Bearer <token>'{
"promo_codes": [
{
"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
},
"times_redeemed": 0,
"created_at": "2025-08-27T17:07:47.761653Z",
"active": true,
"test_mode": false,
"max_redemptions": 100,
"customer": "fcus_01HACM7FZ1084XB1GB6053VM0D",
"metadata": {
"key": "value"
}
}
]
}List promo codes
curl --request GET \
--url https://api.withflex.com/v1/promo_codes \
--header 'Authorization: Bearer <token>'{
"promo_codes": [
{
"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
},
"times_redeemed": 0,
"created_at": "2025-08-27T17:07:47.761653Z",
"active": true,
"test_mode": false,
"max_redemptions": 100,
"customer": "fcus_01HACM7FZ1084XB1GB6053VM0D",
"metadata": {
"key": "value"
}
}
]
}Use a Bearer token to access this API.
Specifies whether the promo code is currently active.
Show child attributes
The ID of the promo code.
"fpromo_01k3p7zzdh18fa378epap93907"
The customer-facing code. Regardless of case, this code must be unique across all active
"SUMMER2016"
The coupon that the promo code represents.
Show child attributes
Unique identifier for the object.
"fcoup_1234567890"
Name of the coupon displayed to customers.
Taking account of the above properties, whether this coupon can still be applied to a customer.
Date were this coupon was created.
Whether the coupon is in test mode
Amount that will be taken off the subtotal of any invoices for this customer.
If duration is repeating, the number of months the coupon applies. Null if coupon duration is forever or once.
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon.
Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid.
Number of times this coupon has been applied to a customer.
{
"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
}
The number of times the promo code has been redeemed.
0
The date and time the promo code was created.
"2025-08-27T17:07:47.761653Z"
Whether the promo code is currently active.
true
Whether the promo code is in test mode.
false
The number of times the promo code can be redeemed.
100
The customer that can be associated with the promo code. If null, the promo code can be redeemed by any customer.
"fcus_01HACM7FZ1084XB1GB6053VM0D"
Metadata associated with the promo code.
{ "key": "value" }