POST
/v1/promotion_codes/{promotion_code}Update a promotion code
Updates a promotion code by changing the editable fields you provide. Use active to change its availability, metadata to manage attached key-value data, and restrictions to update currency-specific redemption settings.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
promotion_codestringrequired
The unique identifier of the promotion code to update. Must be no longer than 5000 characters.
Optional promotion code fields to update; omitted fields retain their current values.
activebooleanoptional
Whether the promotion code is currently active. A promotion code can only be reactivated when the coupon is still valid and the promotion code is otherwise redeemable.
expandarray<string>optional
Specifies which fields in the response should be expanded.
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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
restrictionsobjectoptional
Settings that restrict the redemption of the promotion code.
200Returns the updated 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.
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. You can reactivate a promotion code with active only while its coupon remains valid and the code is otherwise redeemable; each field name supplied in expand must be no longer than 5000 characters.