Skip to main content

Documentation

Coupon

Defines a discount on charges to the customer.

The coupon can be applied to the following objects:

  • Subscription - All charges in the subscription are subject to the discount described in the coupon. To add a coupon to a subscription, first use Create Coupon. Next, add the coupon ID to the coupon field of the subscription with Create Subscription, Update Subscription, or Create Subscription by Hosted Page.

  • Customer - The discount applies to all charges to the customer. To add a coupon to a customer, first use Create Coupon. Then add the coupon ID to the coupon field of the customer with Create Customer or Update Customer.

  • Order - The discount applies to a single order. To add a coupon to an order, first use Create Coupon. The duration field of the coupon must be set to repeating, and the duration_in_months and discount_duration_in_uses fields must be set to 1. Then add the coupon ID to the coupon field of the order with Create an Order or Update Order

A coupon can be applied to one or more customers or subscriptions. However, a subscription can have only one coupon, and the only way to assign two or more coupons to a customer is to assign them to separate subscriptions.

If there is a coupon for the customer and another coupon for the customer's subscription, the subscription coupon takes precedence.

Note

  • For defining the discount, you must choose either a percentage or a fixed amount.

  • The validity of a discount can extend beyond the validity of the coupon it is based on.

You cannot update a coupon after it is created, except for the client-defined metadata. However, you can switch from one coupon to another when you update a customer or subscription. See Update Customer and Update Subscription.

Coupon Methods

Coupon Error Messages