Attributes
- idstring
The ID of the discount object. Discounts cannot be fetched by ID. Use
expand[]=discounts
in API calls to expand discount IDs in an array. - couponobject
Hash describing the coupon applied to create this discount.
- customernullable stringExpandable
The ID of the customer associated with this discount.
- endnullable timestamp
If the coupon has a duration of
repeating
, the date that this discount will end. If the coupon has a duration ofonce
orforever
, this attribute will be null. - starttimestamp
Date that the coupon was applied.
- subscriptionnullable string
The subscription that this coupon is applied to, if it is applied to a particular subscription.
More attributes
- objectstring
- checkout_
sessionnullable string - invoicenullable string
- invoice_
itemnullable string - promotion_
codenullable stringExpandable - subscription_
itemnullable string
{ "id": "di_1M6vk22eZvKYlo2CYMGIhk14", "object": "discount", "checkout_session": "cs_test_b1mywbZHtQCQW2ncaItVPFqupwmfqNU4IMMdw3lArEBGt0QD0CZDrNQswR", "coupon": { "id": "wsd", "object": "coupon", "amount_off": null, "created": 1669116350, "currency": null, "duration": "forever", "duration_in_months": null, "livemode": false, "max_redemptions": null, "metadata": {}, "name": null, "percent_off": 10, "redeem_by": null, "times_redeemed": 1, "valid": true }, "customer": "cus_9s6XKzkNRiz8i3", "end": null, "invoice": null, "invoice_item": null, "promotion_code": null, "start": 1669120702, "subscription": null}
Removes the currently applied discount on a customer.
Parameters
No parameters.
Returns
An object with a deleted flag set to true upon success. This call returns an error otherwise, such as if no discount exists on this customer.
{ "object": "discount", "deleted": true}
Removes the currently applied discount on a subscription.
Parameters
No parameters.
Returns
An object with a deleted flag set to true upon success. This call returns an error otherwise, such as if no discount exists on this subscription.
{ "object": "discount", "deleted": true}
Tax codes classify goods and services for tax purposes.
Tax rates can be applied to invoices, subscriptions and Checkout Sessions to collect tax.
Related guide: Tax rates