Update a promotion code 

Products
Promotion Code
Update a promotion code

Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable.

Parameters

  • metadataobject

    Set of key-value pairs 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.

More parameters

  • activeboolean

    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.

  • restrictionsobject

    Settings that restrict the redemption of the promotion code.

    • restrictions.currency_optionsobject

      Promotion codes defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency.

      • restrictions.currency_options.<currency>.minimum_amountinteger

        Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work).

Returns

The updated promotion code object is returned upon success. Otherwise, this call raises an error.

POST /v1/promotion_codes/:id
curl https://api.stripe.com/v1/promotion_codes/promo_1MiM6KLkdIwHu7ixrIaX4wgn \
-u "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \
-d "metadata[order_id]"=6735
Response
{
"id": "promo_1MiM6KLkdIwHu7ixrIaX4wgn",
"object": "promotion_code",
"active": true,
"code": "A1H1Q1MG",
"coupon": {
"id": "nVJYDOag",
"object": "coupon",
"amount_off": null,
"created": 1678040164,
"currency": null,
"duration": "repeating",
"duration_in_months": 3,
"livemode": false,
"max_redemptions": null,
"metadata": {},
"name": null,
"percent_off": 25.5,
"redeem_by": null,
"times_redeemed": 0,
"valid": true
},
"created": 1678040164,
"customer": null,
"expires_at": null,
"livemode": false,
"max_redemptions": null,
"metadata": {
"order_id": "6735"
},
"restrictions": {
"first_time_transaction": false,
"minimum_amount": null,
"minimum_amount_currency": null
},
"times_redeemed": 0
}