Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 13 KB

File metadata and controls

16 lines (13 loc) · 13 KB

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

Name Type Required Description
coupon Coupon 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. 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.
customer str ID of the Customer object that the discount applies to. String starting with cus_. Response only.
end float The final time that a discount can be used, in Unix time. When the value is -1, the discount never expires. Response only.
id_ str ID of the Discount object. String starting with dis_. Response only.
number_of_uses float The 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.
start float The time that a discount was created, in Unix time. Response only.
subscription str ID of the Subscription object that the discount applies to. String starting with sub_. Response only.
valid bool Indicates whether the discount can be used. Response only.