# Update a coupon

```
PUT 
https://api.freemius.com/v1/products/{product_id}/coupons/{coupon_id}.json
```

#### Auth:Bearer TokenSCOPE: <!-- -->PRODUCT

Product-scoped API tokens allow you to operate on the product itself. This token usually allows read-only access to the product configuration and write access to several operations on subscriptions, customers, payments, and more. For most SaaS or app integrations, this is the token you will need.

1. Go to the [Freemius Developer Dashboard](https://dashboard.freemius.com/).
2. Open the Settings page of the relevant product.
3. Click the API & Keys tab.
4. Copy the API Bearer Authorization Token from the UI.

***

Update a specific coupon's details by ID.

## Request[​](#request "Direct link to request")

### Path Parameters

* **product\_id**
  <!-- -->
  integer\<int64>[](#param-property-coupons-update-param-path-product-id "Direct link to product_id")required

  The ID of the product.

  **Possible values:** `>= 1`

  **Example:<!-- -->&#x20;**`1234`

  **coupon\_id**
  <!-- -->
  integer\<int64>[](#param-property-coupons-update-param-path-coupon-id "Direct link to coupon_id")required

  The ID of the coupon.

  **Possible values:** `>= 1`

  **Example:<!-- -->&#x20;**`1234`

application/json

### Body**required**

* **plans**string[](#schema-property-coupons-update-request-body-plans-string "Direct link to plans")nullable

  Comma separated IDs of plans the coupon would work for. If `null`, coupon supports all plans.

  **Example:<!-- -->&#x20;**`123,654,8757`

  **licenses**string[](#schema-property-coupons-update-request-body-licenses-string "Direct link to licenses")nullable

  Comma separated licenses quota limits. If `null`, coupon supports all license limits. `0` is used for an unlimited-site license.

  **Example:<!-- -->&#x20;**`1,5,10,0`

  **billing\_cycles**string[](#schema-property-coupons-update-request-body-billing-cycles-string "Direct link to billing_cycles")nullable

  Comma separated billing cycles. If `null`, coupon supports all billing cycles. `0` is used for lifetime billing cycle.

  **Example:<!-- -->&#x20;**`1,12`

  **user\_type**string[](#schema-property-coupons-update-request-body-user-type-string "Direct link to user_type")

  **Default value:<!-- -->&#x20;**`all`

  The user type the coupon is applicable to.

  **Possible values:** \[`all`, `new`, `current`, `previous`, `customer`, `migrated`]

  **code**string[](#schema-property-coupons-update-request-body-code-string "Direct link to code")

  The coupon code.

  **Example:<!-- -->&#x20;**`BLACKFRIDAY2024`

  **discount**integer[](#schema-property-coupons-update-request-body-discount-integer "Direct link to discount")

  The discount amount.

  **discount\_type**string[](#schema-property-coupons-update-request-body-discount-type-string "Direct link to discount_type")

  The type of the discount. "percentage" means the discount is a percentage of the price, "dollar" means the discount is a fixed amount.

  **Possible values:** \[`dollar`, `percentage`]

  **start\_date**string\<date-time>[](#schema-property-coupons-update-request-body-start-date-string-date-time "Direct link to start_date")

  Date and time from when the coupon will be activated.

  **Example:<!-- -->&#x20;**`2025-04-01 11:13:28`

  **end\_date**string\<date-time>[](#schema-property-coupons-update-request-body-end-date-string-date-time "Direct link to end_date")

  Date and time, after which the coupon will be expired.

  **Example:<!-- -->&#x20;**`2025-04-30 19:17:21`

  **redemptions\_limit**integer[](#schema-property-coupons-update-request-body-redemptions-limit-integer "Direct link to redemptions_limit")nullable

  The total number of redemptions limit of this coupon.

  **has\_renewals\_discount**boolean[](#schema-property-coupons-update-request-body-has-renewals-discount-boolean "Direct link to has_renewals_discount")

  Whether the coupon also supports discount for renewals or first payment only.

  **has\_addons\_discount**boolean[](#schema-property-coupons-update-request-body-has-addons-discount-boolean "Direct link to has_addons_discount")

  Whether the coupon supports discount for add-ons or not.

  **is\_one\_per\_user**boolean[](#schema-property-coupons-update-request-body-is-one-per-user-boolean "Direct link to is_one_per_user")

  Whether to limit the coupon usage one per user.

  **is\_active**boolean[](#schema-property-coupons-update-request-body-is-active-boolean "Direct link to is_active")

  Whether the coupon is active. Use this flag to temporarily disable the coupon.

## Responses[​](#responses "Direct link to Responses")

* 200
* 400
* 401
* 402
* 404

The coupon is updated.

application/json

**Schema**

**id**string\<int64>[](#schema-property-coupons-update-response-schema-id-string-int64 "Direct link to id")

The unique identifier of the entity.

**Possible values:** `>= 1`

**Example:<!-- -->&#x20;**`123456`

**created**string\<date-time>[](#schema-property-coupons-update-response-schema-created-string-date-time "Direct link to created")

The date and time the entity was created, under UTC timezone.

**Example:<!-- -->&#x20;**`2025-01-01 00:00:00`

**updated**string\<date-time>[](#schema-property-coupons-update-response-schema-updated-string-date-time "Direct link to updated")nullable

The date and time the entity was updated, under UTC timezone. If `null` then the entity was never updated since its creation.

**Example:<!-- -->&#x20;**`2025-01-01 00:00:00`

**entity\_id**string\<int64>[](#schema-property-coupons-update-response-schema-entity-id-string-int64 "Direct link to entity_id")

The ID of the entity the coupon belongs to.

**Possible values:** `>= 1`

**Example:<!-- -->&#x20;**`12345`

**entity\_type**string[](#schema-property-coupons-update-response-schema-entity-type-string "Direct link to entity_type")

The type of the entity the coupon belongs to.

**Possible values:** \[`plugin`, `store`, `marketplace`]

**Example:<!-- -->&#x20;**`plugin`

**plans**string[](#schema-property-coupons-update-response-schema-plans-string "Direct link to plans")nullable

Comma separated IDs of plans the coupon would work for. If `null`, coupon supports all plans.

**Example:<!-- -->&#x20;**`123,654,8757`

**licenses**string[](#schema-property-coupons-update-response-schema-licenses-string "Direct link to licenses")nullable

Comma separated licenses quota limits. If `null`, coupon supports all license limits. `0` is used for an unlimited-site license.

**Example:<!-- -->&#x20;**`1,5,10,0`

**billing\_cycles**string[](#schema-property-coupons-update-response-schema-billing-cycles-string "Direct link to billing_cycles")nullable

Comma separated billing cycles. If `null`, coupon supports all billing cycles. `0` is used for lifetime billing cycle.

**Example:<!-- -->&#x20;**`1,12`

**code**string[](#schema-property-coupons-update-response-schema-code-string "Direct link to code")

The coupon code.

**Example:<!-- -->&#x20;**`BLACKFRIDAY2024`

**discount**integer[](#schema-property-coupons-update-response-schema-discount-integer "Direct link to discount")

The discount amount.

**discount\_type**string[](#schema-property-coupons-update-response-schema-discount-type-string "Direct link to discount_type")

The type of the discount. "percentage" means the discount is a percentage of the price, "dollar" means the discount is a fixed amount.

**Possible values:** \[`dollar`, `percentage`]

**start\_date**string\<date-time>[](#schema-property-coupons-update-response-schema-start-date-string-date-time "Direct link to start_date")

Date and time from when the coupon will be activated.

**Example:<!-- -->&#x20;**`2025-04-01 11:13:28`

**end\_date**string\<date-time>[](#schema-property-coupons-update-response-schema-end-date-string-date-time "Direct link to end_date")

Date and time, after which the coupon will be expired.

**Example:<!-- -->&#x20;**`2025-04-30 19:17:21`

**redemptions**integer[](#schema-property-coupons-update-response-schema-redemptions-integer "Direct link to redemptions")

The total number of redemptions of this coupon.

**redemptions\_limit**integer[](#schema-property-coupons-update-response-schema-redemptions-limit-integer "Direct link to redemptions_limit")nullable

The total number of redemptions limit of this coupon.

**has\_renewals\_discount**boolean[](#schema-property-coupons-update-response-schema-has-renewals-discount-boolean "Direct link to has_renewals_discount")

Whether the coupon also supports discount for renewals or first payment only.

**has\_addons\_discount**boolean[](#schema-property-coupons-update-response-schema-has-addons-discount-boolean "Direct link to has_addons_discount")

Whether the coupon supports discount for add-ons or not.

**is\_one\_per\_user**boolean[](#schema-property-coupons-update-response-schema-is-one-per-user-boolean "Direct link to is_one_per_user")

Whether to limit the coupon usage one per user.

**is\_active**boolean[](#schema-property-coupons-update-response-schema-is-active-boolean "Direct link to is_active")

Whether the coupon is active. Use this flag to temporarily disable the coupon.

**user\_type**string[](#schema-property-coupons-update-response-schema-user-type-string "Direct link to user_type")

**Default value:<!-- -->&#x20;**`all`

The user type the coupon is applicable to.

**Possible values:** \[`all`, `new`, `current`, `previous`, `customer`, `migrated`]

**source**number[](#schema-property-coupons-update-response-schema-source-number "Direct link to source")

The source of the migration data. To get support migrating from other platform please see our [documentation](https://freemius.com/help/documentation/migration/).

* `0` - Freemius
* `1` - Other
* `2` - Easy Digital Downloads (EDD)
* `3` - WooCommerce (WC)
* `4` - Rating Widget
* `5` - Gumroad
* `6` - CodeCanyon
* `7` - ThemeForest
* `8` - AppSumo
* `9` - SendOwl
* `10` - WHMCS
* `11` - Lemon Squeezy

**Possible values:** \[`0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`]

Bad request. The request could not be understood by the server due to malformed syntax or arguments.

application/json

**Schema**

**path**string[](#schema-property-coupons-update-response-schema-path-string "Direct link to path")

The API request path.

**Example:<!-- -->&#x20;**`:/products/product_id/users.json`

**error** <!-- -->object

This object contains the error details.

**type**string[](#schema-property-coupons-update-response-schema-type-string "Direct link to type")

The type of the error encountered by the server.

**Example:<!-- -->&#x20;**`UnauthorizedAccess`

**message**string[](#schema-property-coupons-update-response-schema-message-string "Direct link to message")

The descriptive error message.

**Example:<!-- -->&#x20;**`Some error has occured.`

**code**string[](#schema-property-coupons-update-response-schema-code-string "Direct link to code")

The error code.

**Example:<!-- -->&#x20;**`unauthorized_access`

**http**integer[](#schema-property-coupons-update-response-schema-http-integer "Direct link to http")

The HTTP status code returned by the server.

**Example:<!-- -->&#x20;**`401`

**timestamp**string[](#schema-property-coupons-update-response-schema-timestamp-string "Direct link to timestamp")

Current timestamp.

**Example:<!-- -->&#x20;**`Thu, 11 May 2023 11:45:30 +0000`

**request** <!-- -->object

This object sends back the request payload as received by the server (both from path and from body or query).

**property name\***&#x61;ny[](#schema-property-coupons-update-response-schema-property-name-any "Direct link to property name*")

This object sends back the request payload as received by the server (both from path and from body or query).

**Example:<!-- -->&#x20;**`{"beautify":true,"format":"json"}`

Unauthorized access error. The request requires [authentication](https://freemius.com/help/api/#bearer-token-authentication) but was not provided or the provided authentication does not satisfy the required permissions.

application/json

**Schema**

**path**string[](#schema-property-coupons-update-response-schema-path-string "Direct link to path")

The API request path.

**Example:<!-- -->&#x20;**`:/products/product_id/users.json`

**error** <!-- -->object

This object contains the error details.

**type**string[](#schema-property-coupons-update-response-schema-type-string "Direct link to type")

The type of the error encountered by the server.

**Example:<!-- -->&#x20;**`UnauthorizedAccess`

**message**string[](#schema-property-coupons-update-response-schema-message-string "Direct link to message")

The descriptive error message.

**Example:<!-- -->&#x20;**`Some error has occured.`

**code**string[](#schema-property-coupons-update-response-schema-code-string "Direct link to code")

The error code.

**Example:<!-- -->&#x20;**`unauthorized_access`

**http**integer[](#schema-property-coupons-update-response-schema-http-integer "Direct link to http")

The HTTP status code returned by the server.

**Example:<!-- -->&#x20;**`401`

**timestamp**string[](#schema-property-coupons-update-response-schema-timestamp-string "Direct link to timestamp")

Current timestamp.

**Example:<!-- -->&#x20;**`Thu, 11 May 2023 11:45:30 +0000`

**request** <!-- -->object

This object sends back the request payload as received by the server (both from path and from body or query).

**property name\***&#x61;ny[](#schema-property-coupons-update-response-schema-property-name-any "Direct link to property name*")

This object sends back the request payload as received by the server (both from path and from body or query).

**Example:<!-- -->&#x20;**`{"beautify":true,"format":"json"}`

The request is missing the specified argument.

application/json

**Schema**

**path**string[](#schema-property-coupons-update-response-schema-path-string "Direct link to path")

The API request path.

**Example:<!-- -->&#x20;**`:/products/product_id/users.json`

**error** <!-- -->object

This object contains the error details.

**type**string[](#schema-property-coupons-update-response-schema-type-string "Direct link to type")

The type of the error encountered by the server.

**Example:<!-- -->&#x20;**`UnauthorizedAccess`

**message**string[](#schema-property-coupons-update-response-schema-message-string "Direct link to message")

The descriptive error message.

**Example:<!-- -->&#x20;**`Some error has occured.`

**code**string[](#schema-property-coupons-update-response-schema-code-string "Direct link to code")

The error code.

**Example:<!-- -->&#x20;**`unauthorized_access`

**http**integer[](#schema-property-coupons-update-response-schema-http-integer "Direct link to http")

The HTTP status code returned by the server.

**Example:<!-- -->&#x20;**`401`

**timestamp**string[](#schema-property-coupons-update-response-schema-timestamp-string "Direct link to timestamp")

Current timestamp.

**Example:<!-- -->&#x20;**`Thu, 11 May 2023 11:45:30 +0000`

**request** <!-- -->object

This object sends back the request payload as received by the server (both from path and from body or query).

**property name\***&#x61;ny[](#schema-property-coupons-update-response-schema-property-name-any "Direct link to property name*")

This object sends back the request payload as received by the server (both from path and from body or query).

**Example:<!-- -->&#x20;**`{"beautify":true,"format":"json"}`

The requested resource was not found.

application/json

**Schema**

**path**string[](#schema-property-coupons-update-response-schema-path-string "Direct link to path")

The API request path.

**Example:<!-- -->&#x20;**`:/products/product_id/users.json`

**error** <!-- -->object

This object contains the error details.

**type**string[](#schema-property-coupons-update-response-schema-type-string "Direct link to type")

The type of the error encountered by the server.

**Example:<!-- -->&#x20;**`UnauthorizedAccess`

**message**string[](#schema-property-coupons-update-response-schema-message-string "Direct link to message")

The descriptive error message.

**Example:<!-- -->&#x20;**`Some error has occured.`

**code**string[](#schema-property-coupons-update-response-schema-code-string "Direct link to code")

The error code.

**Example:<!-- -->&#x20;**`unauthorized_access`

**http**integer[](#schema-property-coupons-update-response-schema-http-integer "Direct link to http")

The HTTP status code returned by the server.

**Example:<!-- -->&#x20;**`401`

**timestamp**string[](#schema-property-coupons-update-response-schema-timestamp-string "Direct link to timestamp")

Current timestamp.

**Example:<!-- -->&#x20;**`Thu, 11 May 2023 11:45:30 +0000`

**request** <!-- -->object

This object sends back the request payload as received by the server (both from path and from body or query).

**property name\***&#x61;ny[](#schema-property-coupons-update-response-schema-property-name-any "Direct link to property name*")

This object sends back the request payload as received by the server (both from path and from body or query).

**Example:<!-- -->&#x20;**`{"beautify":true,"format":"json"}`
