Sample - Stripe API
GET/v1/promotion_codes/{promotion_code}

Retrieve a promotion code

Retrieves a promotion code by its identifier. Use the promotion code ID in promotion_code; to find a code by its customer-facing value, list promotion codes with the code filter instead.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters
promotion_codestringrequired
The unique identifier of the promotion code to retrieve. Must be no longer than 5000 characters.
expandarray<string>optional
Fields to expand in the response. Each field name must be no longer than 5000 characters.

2 status codes
200Returns the promotion code, including its active state, customer-facing code, redemption restrictions, promotion details, and redemption count.
activebooleanrequired
Whether the promotion code is currently active. A promotion code is only active if the coupon is also valid.
codestringrequired
The 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 (-).
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
customerstringoptional
The customer who can use this promotion code.
customer_accountstringoptional
The account representing the customer who can use this promotion code.
expires_atintegeroptional
Date at which the promotion code can no longer be redeemed.
idstringrequired
Unique identifier for the object.
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
max_redemptionsintegeroptional
Maximum number of times this promotion code can be redeemed.
metadataobjectoptional
Set 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.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:promotion_code
promotionobjectrequired
restrictionsobjectrequired
times_redeemedintegerrequired
Number of times this promotion code has been used.
defaultError response.
errorobjectrequired

Error handling

promotion_code must be a promotion code identifier no longer than 5000 characters. Each field name supplied in expand must be no longer than 5000 characters.