Skip to main content

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.
  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

Path Parameters

    product_id integer<int64>required

    The ID of the product.

    Possible values: >= 1

    Example: 1234
    coupon_id integer<int64>required

    The ID of the coupon.

    Possible values: >= 1

    Example: 1234

Bodyrequired

    plansstringnullable

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

    Example: 123,654,8757
    licensesstringnullable

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

    Example: 1,5,10,0
    billing_cyclesstringnullable

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

    Example: 1,12
    user_typestring
    Default value: all

    The user type the coupon is applicable to.

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

    codestring

    The coupon code.

    Example: BLACKFRIDAY2024
    discountinteger

    The discount amount.

    discount_typestring

    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_datestring<date-time>

    Date and time from when the coupon will be activated.

    Example: 2025-04-01 11:13:28
    end_datestring<date-time>

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

    Example: 2025-04-30 19:17:21
    redemptions_limitintegernullable

    The total number of redemptions limit of this coupon.

    has_renewals_discountboolean

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

    has_addons_discountboolean

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

    is_one_per_userboolean

    Whether to limit the coupon usage one per user.

    is_activeboolean

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

Responses

The coupon is updated.

Schema
idstring<int64>

The unique identifier of the entity.

Possible values: >= 1

Example: 123456
createdstring<date-time>

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

Example: 2025-01-01 00:00:00
updatedstring<date-time>nullable

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

Example: 2025-01-01 00:00:00
entity_idstring<int64>

The ID of the entity the coupon belongs to.

Possible values: >= 1

Example: 12345
entity_typestring

The type of the entity the coupon belongs to.

Possible values: [plugin, store, marketplace]

Example: plugin
plansstringnullable

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

Example: 123,654,8757
licensesstringnullable

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

Example: 1,5,10,0
billing_cyclesstringnullable

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

Example: 1,12
codestring

The coupon code.

Example: BLACKFRIDAY2024
discountinteger

The discount amount.

discount_typestring

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_datestring<date-time>

Date and time from when the coupon will be activated.

Example: 2025-04-01 11:13:28
end_datestring<date-time>

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

Example: 2025-04-30 19:17:21
redemptionsinteger

The total number of redemptions of this coupon.

redemptions_limitintegernullable

The total number of redemptions limit of this coupon.

has_renewals_discountboolean

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

has_addons_discountboolean

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

is_one_per_userboolean

Whether to limit the coupon usage one per user.

is_activeboolean

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

user_typestring
Default value: all

The user type the coupon is applicable to.

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

sourcenumber

The source of the migration data. To get support migrating from other platform please see our documentation.

  • 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]

We use essential cookies to enable our site to function. With your consent, we also use analytics and advertising cookies to understand how visitors interact with our site and to improve our services.
Learn More