Promotion Codes
Promotion codes are customer-facing discount codes generated from coupon templates. While coupons define the discount structure and rules, promotion codes are the actual codes that customers enter at checkout to receive discounts. This separation allows merchants to create multiple promotional codes from a single coupon template, each with unique targeting, expiration dates, and usage limits.
The Promotion Code object
Attributes
Unique identifier for the object.
The promotion code that customers enter at checkout. Automatically normalized to uppercase (e.g., "SUMMER50", "WELCOME2025").
The ID of the coupon template this promotion code is based on. The promotion code inherits discount configuration from this coupon.
If provided, restricts this promotion code to a specific customer only.
Whether this promotion code is currently active and can be used.
If true, this code can only be used by customers making their first purchase.
Maximum number of times this promotion code can be redeemed across all customers. Null for unlimited redemptions.
Current count of how many times this promotion code has been redeemed.
Minimum order amount in cents required to use this promotion code (e.g., 5000 for $50.00).
Currency code for the minimum order amount.
Date and time when this promotion code expires.
Whether the promotion code has passed its expiration date.
Whether the promotion code has reached its maximum redemption limit.
Whether the promotion code can currently be used (active, not expired, not maxed out).
Number of redemptions remaining before hitting the limit. Null if no limit set.
Whether this promotion code is restricted to a specific customer.
A metadata object consists of key-value pairs that can be attached to Frame object. Use metadata to store structured, additional information about the object for your reference. Learn more about storing information in metadata.
Has the value true if the object exists in live mode or the value false if the object exists in test mode.
Time at which the object was created.
String representing the object’s type. Objects of the same type share the same value. Always has the value promotion_code.
{
"id": "9b2adad0-d2b7-41aa-aa8c-c1c45060b0a4",
"code": "SUMMER50",
"minimum_amount_currency": "USD",
"expires_at": 1769903999,
"created_at": 1768251304,
"object": "promotion_code",
"is_expired": false,
"is_maxed_out": false,
"is_redeemable": true,
"remaining_redemptions": 50,
"is_customer_specific": false,
"active": true,
"livemode": false,
"first_time_transaction": true,
"max_redemptions": 50,
"times_redeemed": 0,
"coupon": "a2b43435-cdd9-44bb-8b7a-c3ad0ec8b3e2",
"customer": null,
"minimum_amount_cents": 5000
}
Create a promotion code
Creates a new promotion code object.
Parameters
The promotion code that customers will enter at checkout. Will be automatically converted to uppercase.
The ID of the coupon template this promotion code is based on.
Whether this promotion code is currently active and can be used. Default is true.
If provided, restricts this promotion code to a specific customer only.
If true, this code can only be used by customers making their first purchase. Default is false.
Maximum number of times this promotion code can be redeemed. Leave null for unlimited redemptions.
Minimum order amount in cents required to use this promotion code (e.g., 5000 for $50.00).
Currency code for the minimum order amount (e.g., "USD", "EUR", "GBP"). Default is "USD".
Date and time when this promotion code expires (ISO 8601 format). Leave null for no expiration.
A metadata object consists of key-value pairs that can be attached to Frame object. Use metadata to store structured, additional information about the object for your reference. Learn more about storing information in metadata.
Returns
Returns a promotion code object if the call succeeded.
curl --request POST \
--url https://api.framepayments.com/v1/promotion_codes \
--header 'Authorization: Bearer API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"code": "SUMMER50",
"coupon_id": "a2b43435-cdd9-44bb-8b7a-c3ad0ec8b3e2",
"active": true,
"first_time_transaction": true,
"max_redemptions": 100,
"minimum_amount_cents": 5000,
"minimum_amount_currency": "USD",
"expires_at": "2026-08-31T23:59:59Z"
}'
{
"id": "9b2adad0-d2b7-41aa-aa8c-c1c45060b0a4",
"code": "SUMMER50",
"minimum_amount_currency": "USD",
"expires_at": 1769903999,
"created_at": 1768251304,
"object": "promotion_code",
"is_expired": false,
"is_maxed_out": false,
"is_redeemable": true,
"remaining_redemptions": 50,
"is_customer_specific": false,
"active": true,
"livemode": false,
"first_time_transaction": true,
"max_redemptions": 50,
"times_redeemed": 0,
"coupon": "a2b43435-cdd9-44bb-8b7a-c3ad0ec8b3e2",
"customer": null,
"minimum_amount_cents": 5000
}
Update a promotion code
Updates the specific promotion code by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Parameters
Update the promotion code. Will be automatically converted to uppercase.
Update whether this promotion code is active and can be used.
Update or set customer restriction. Set to a customer ID to restrict usage, or null to remove restriction.
Update whether this code is restricted to first-time customers only.
Update the maximum number of redemptions allowed.
Update the minimum order amount in cents.
Update the currency for minimum order amount.
Update the expiration date and time (ISO 8601 format). Set to null to remove expiration.
A metadata object consists of key-value pairs that can be attached to Frame object. Use metadata to store structured, additional information about the object for your reference. Learn more about storing information in metadata.
Returns
Returns the promotion code object if the update succeeded.
curl --request PATCH \
--url https://api.framepayments.com/v1/promotion_codes/9b2adad0-d2b7-41aa-aa8c-c1c45060b0a4 \
--header 'Authorization: Bearer API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"code": "SUMMER50",
"active": true,
"first_time_transaction": true,
"max_redemptions": 50,
"minimum_amount_cents": 5000,
"minimum_amount_currency": "USD",
"expires_at": "2026-01-31T23:59:59Z"
}'
{
"id": "9b2adad0-d2b7-41aa-aa8c-c1c45060b0a4",
"code": "SUMMER50",
"minimum_amount_currency": "USD",
"expires_at": 1769903999,
"created_at": 1768251304,
"object": "promotion_code",
"is_expired": false,
"is_maxed_out": false,
"is_redeemable": true,
"remaining_redemptions": 50,
"is_customer_specific": false,
"active": true,
"livemode": false,
"first_time_transaction": true,
"max_redemptions": 50,
"times_redeemed": 0,
"coupon": "a2b43435-cdd9-44bb-8b7a-c3ad0ec8b3e2",
"customer": null,
"minimum_amount_cents": 5000
}
List all promotion codes
Returns a list of promotion codes. The promotion codes are returned sorted by creation date, with the most recent codes appearing first.
Parameters
A limit on the number of objects to be returned. Range: 1 to 100, default is 10.
The page offset for fetching data.
Filter promotion codes by parent coupon ID.
Filter promotion codes by customer ID.
Filter by active status (true or false).
Filter codes restricted to first-time transactions only.
Returns
A dictionary with a data property that contains an array of promotion code objects. Each entry in the array is a separate promotion code object. If no promotion codes are available, the resulting array will be empty.
curl --request GET \
--url 'https://api.framepayments.com/v1/promotion_codes?per_page=10&page=1&active=true' \
--header 'Authorization: Bearer API_KEY'
{
"data": [
{
"id": "9b2adad0-d2b7-41aa-aa8c-c1c45060b0a4",
"code": "SUMMER50",
"minimum_amount_currency": "USD",
"expires_at": 1769903999,
"created_at": 1768251304,
"object": "promotion_code",
"is_expired": false,
"is_maxed_out": false,
"is_redeemable": true,
"remaining_redemptions": 50,
"is_customer_specific": false,
"active": true,
"livemode": false,
"first_time_transaction": true,
"max_redemptions": 50,
"times_redeemed": 0,
"coupon": "a2b43435-cdd9-44bb-8b7a-c3ad0ec8b3e2",
"customer": null,
"minimum_amount_cents": 5000
}
],
"meta": {
"page": 1,
"per_page": 10,
"total": 1,
"url": "/v1/promotion_codes",
"has_more": false,
"prev": null,
"next": null
}
}
Retrieve a promotion code
Retrieves the details of an existing promotion code. You need only supply the unique promotion code identifier that was returned upon promotion code creation.
Parameters
Returns
Returns a promotion code object if a valid identifier was provided.
curl --request GET \
--url https://api.framepayments.com/v1/promotion_codes/9b2adad0-d2b7-41aa-aa8c-c1c45060b0a4 \
--header 'Authorization: Bearer API_KEY'
{
"id": "9b2adad0-d2b7-41aa-aa8c-c1c45060b0a4",
"code": "SUMMER50",
"minimum_amount_currency": "USD",
"expires_at": 1769903999,
"created_at": 1768251304,
"object": "promotion_code",
"is_expired": false,
"is_maxed_out": false,
"is_redeemable": true,
"remaining_redemptions": 50,
"is_customer_specific": false,
"active": true,
"livemode": false,
"first_time_transaction": true,
"max_redemptions": 50,
"times_redeemed": 0,
"coupon": "a2b43435-cdd9-44bb-8b7a-c3ad0ec8b3e2",
"customer": null,
"minimum_amount_cents": 5000
}