Skip to content

Stripe: Promotion codes schemas

4 Stripe schemas with complete fields and constraints.

← Promotion codes operations · All schemas

Create a promotion code — response body

FieldTypePresenceDescription and constraints
$objectRootA Promotion Code represents a customer-redeemable code for an underlying promotion.
You can create multiple codes for a single promotion.

If you enable promotion codes in your [customer portal configuration](https://docs.stripe.com/customer-management/configure-portal), then customers can redeem a code themselves when updating a subscription in the portal.
Customers can also view the currently active promotion codes and coupons on each of their subscriptions in the portal.
activebooleanRequired within parentWhether the promotion code is currently active. A promotion code is only active if the coupon is also valid.
codestringRequired within parentThe customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer. Valid characters are lower case letters (a-z), upper case letters (A-Z), digits (0-9), and dashes (-).
Maximum length: 5000
createdJSONRequired within parent
created (anyOf 1)integerAlternativeTime at which the object was created. Measured in seconds since the Unix epoch.
Format: unix-time
created (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
customerJSONOptional
customer (anyOf 1)JSONAlternativeThe customer who can use this promotion code.
customer (anyOf 1) (anyOf 1)stringAlternativeMaximum length: 5000
customer (anyOf 1) (anyOf 2)ModelAlternativeExpand Create a customer — response body
customer (anyOf 1) (anyOf 3)ModelAlternativeExpand Delete a customer — response body
customer (anyOf 2)nullAlternative
customer_accountJSONOptional
customer_account (anyOf 1)stringAlternativeThe account representing the customer who can use this promotion code.
Maximum length: 5000
customer_account (anyOf 2)nullAlternative
expires_atJSONOptional
expires_at (anyOf 1)JSONAlternative
expires_at (anyOf 1) (anyOf 1)integerAlternativeDate at which the promotion code can no longer be redeemed.
Format: unix-time
expires_at (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
expires_at (anyOf 2)nullAlternative
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
livemodebooleanRequired within parentIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
max_redemptionsJSONOptional
max_redemptions (anyOf 1)JSONAlternative
max_redemptions (anyOf 1) (anyOf 1)integerAlternativeMaximum number of times this promotion code can be redeemed.
max_redemptions (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
max_redemptions (anyOf 2)nullAlternative
metadataJSONOptional
metadata (anyOf 1)objectAlternativeSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Additional keys: see wildcard field
metadata (anyOf 1).*stringAdditional keysMaximum length: 500
metadata (anyOf 2)nullAlternative
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: promotion_code
promotionModelRequired within parentExpand Create a promotion code — response body — promotion
restrictionsModelRequired within parentExpand Create a promotion code — response body — restrictions
times_redeemedJSONRequired within parent
times_redeemed (anyOf 1)integerAlternativeNumber of times this promotion code has been used.
times_redeemed (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Referenced models: Create a customer — response body, Delete a customer — response body, Create a promotion code — response body — promotion, Create a promotion code — response body — restrictions

Create a promotion code — response body — promotion

FieldTypePresenceDescription and constraints
$objectRoot
couponJSONOptional
coupon (anyOf 1)JSONAlternativeIf promotion `type` is `coupon`, the coupon for this promotion.
coupon (anyOf 1) (anyOf 1)stringAlternativeMaximum length: 5000
coupon (anyOf 1) (anyOf 2)ModelAlternativeExpand Create a coupon — response body
coupon (anyOf 2)nullAlternative
typestringRequired within parentThe type of promotion.
Known values: coupon

Referenced models: Create a coupon — response body

Create a promotion code — response body — restrictions

FieldTypePresenceDescription and constraints
$objectRoot
currency_optionsobjectOptionalPromotion code restrictions defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
Additional keys: see wildcard field
currency_options.*ModelAdditional keysExpand Create a promotion code — response body — restrictions currency options value
first_time_transactionbooleanRequired within parentA Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices
minimum_amountJSONOptional
minimum_amount (anyOf 1)JSONAlternative
minimum_amount (anyOf 1) (anyOf 1)integerAlternativeMinimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work).
minimum_amount (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
minimum_amount (anyOf 2)nullAlternative
minimum_amount_currencyJSONOptional
minimum_amount_currency (anyOf 1)stringAlternativeThree-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount
Maximum length: 5000
minimum_amount_currency (anyOf 2)nullAlternative

Referenced models: Create a promotion code — response body — restrictions currency options value

Create a promotion code — response body — restrictions currency options value

FieldTypePresenceDescription and constraints
$objectRoot
minimum_amountJSONRequired within parent
minimum_amount (anyOf 1)integerAlternativeMinimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work).
minimum_amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.