Skip to main content

Discount

Describes the fields relating to discounts in REST messages and webhooks for customer profiles and subscriptions Contains information about the coupon that applies to the customer. Read-only field. Adding a discount is a 2-step process - 1. Create Coupon, which returns a coupon ID. 2. Add the coupon ID to the coupon field of the customer with Create Customer or Update Customer.

Properties

NameTypeRequiredDescription
couponCouponThe 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. Then add the coupon ID to the coupon field of the subscription with Create Subscription or Update Subscription. _ 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.
customerstrID of the Customer object that the discount applies to. String starting with cus_. Response only.
endfloatThe final time that a discount can be used, in Unix time. When the value is -1, the discount never expires. Response only.
id_strID of the Discount object. String starting with dis_. Response only.
number_of_usesfloatThe number of times that the discount was used for a specific customer or subscription. The initial value is 0. The value is incremented by 1 each time that the discount is used. Response only.
startfloatThe time that a discount was created, in Unix time. Response only.
subscriptionstrID of the Subscription object that the discount applies to. String starting with sub_. Response only.
validboolIndicates whether the discount can be used. Response only.

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →