v1
latestOpenAPI 3.1.02026-07-2684271522.2 KBPromo Codes
Create Promo Code
Creates a promotion code referencing an existing coupon. If code is omitted, a unique code is generated automatically. The supplied code must be unique across your promotion codes.
post/v1/promo_codes
Request body
Example request
{
"promo_code": {
"coupon_id": "fcoup_1234567890",
"code": "SUMMER2016",
"max_redemptions": 100,
"customer": "fcus_01HACM7FZ1084XB1GB6053VM0D",
"metadata": {
"key": "value"
}
}
}Response
An envelope wrapping a single promotion code object.
Example response
{
"promo_code": {
"promo_code_id": "fpromo_01HACM7FZ1084XB1GB6053VM0E",
"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": "2024-05-17T14:59:21Z",
"test_mode": true
},
"max_redemptions": 100,
"times_redeemed": 0,
"created_at": "2024-05-17T14:59:21Z",
"customer": "fcus_01HACM7FZ1084XB1GB6053VM0D",
"active": true,
"metadata": {
"key": "value"
},
"test_mode": false
}
}