Update Coupon

Updates a *Coupon*. **Read Only Fields** * `id` * `num_uses` * `date_created` **Notes** If the `applies_to` value is cleared, you can restore it to the coupon by reapplying the `applies_to` value in a new `PUT` request.

Authentication

X-Auth-Tokenstring
### OAuth scopes | UI Name | Permission | Parameter | |:--------|:-----------|:----------| | Checkout Content | modify | `store_content_checkout` | | Checkout Content | read-only | `store_content_checkout_read_only` | | Content | modify | `store_v2_content` | | Content | read-only | `store_v2_content_read_only` | To read or modify scripts on checkout pages, add `Checkout Content` scopes. ### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).

Path parameters

idstringRequired

Request

This endpoint expects an object.
namestringRequired<=100 characters
The name of the coupon. The value must be unique.
typeenumRequired
amountstringRequired

The discount to apply to an order, as either an amount or a percentage. This field’s usage is determined by the coupon type. For example, a type of + percentage_discount would determine a percentage here.

codestringRequiredformat: "[a-zA-Z0-9_\ -]"<=50 characters
The coupon code that customers will use to receive their discounts. Value must be unique. Only letters, numbers, white space, underscores, and hyphens are allowed.
applies_toobjectRequired
If it is not included in the PUT request, its existing value on the coupon will be cleared. Also required to be set on the POST request
min_purchasestringOptional
Specifies a minimum value that an order must have before the coupon can be applied to it.
expiresstringOptional
Specifies when a coupon expires. Coupons need not have an expiry date – you can also control expiry via + `max_uses` or `max_uses_per_customer`. If you do use this date field, the value must be in <a href="http://tools.ietf.org/html/rfc2822#section-3.3" target="_blank">RFC 2822</a> format.
enabledbooleanOptional

If the coupon is enabled, this field’s value is true; otherwise, false.

max_usesintegerOptional
Maximum number of times this coupon can be used.
max_uses_per_customerintegerOptional
Maximum number of times each customer can use this coupon.
restricted_toobjectOptional
shipping_methodslist of stringsOptional

This is a list of shipping-method names. A shipping method must be enabled on the store to use it with a coupon. To check which shipping methods are enabled, please use the List Shipping Methods endpoint.

Response

amountstring

The discount to apply to an order, as either an amount or a percentage. This field’s usage is determined by the coupon type. For example, a type of + percentage_discount would determine a percentage here.

applies_toobject
If it is not included in the PUT request, its existing value on the coupon will be cleared. Also required to be set on the POST request
codestringformat: "[a-zA-Z0-9_\ -]"<=50 characters
The coupon code that customers will use to receive their discounts. Value must be unique. Only letters, numbers, white space, underscores, and hyphens are allowed.
idinteger

The coupon’s ID. This is a read-only field; do not set or modify its value in a POST or PUT request.

namestring<=100 characters
The name of the coupon. The value must be unique.
typeenum
date_createdstring
Date Created
enabledboolean

If the coupon is enabled, this field’s value is true; otherwise, false.

expiresstring
Specifies when a coupon expires. Coupons need not have an expiry date – you can also control expiry via + `max_uses` or `max_uses_per_customer`. If you do use this date field, the value must be in <a href="http://tools.ietf.org/html/rfc2822#section-3.3" target="_blank">RFC 2822</a> format.
max_usesinteger
Maximum number of times this coupon can be used.
max_uses_per_customerinteger
Maximum number of times each customer can use this coupon.
min_purchasestring
Specifies a minimum value that an order must have before the coupon can be applied to it.
num_usesinteger

Number of times this coupon has been used. This is a read-only field; do not set or modify its value in a POST or PUT request.

restricted_toobject
shipping_methodslist of strings

This is a list of shipping-method names. A shipping method must be enabled on the store to use it with a coupon. To check which shipping methods are enabled, please use the List Shipping Methods endpoint.