Sample - Stripe API
GET/v1/customers/{customer}/subscriptions/{subscription_exposed_id}/discount

Retrieve a subscription discount

Retrieves the discount currently applied to a customer's subscription. Provide the customer and subscription identifiers to select the discount associated with that subscription. Use expand to request expanded fields in the response.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters
customerstringrequired
The identifier of the customer associated with the subscription. Maximum 5000 characters.
subscription_exposed_idstringrequired
The identifier of the subscription whose discount to retrieve. Maximum 5000 characters.
expandarray<string>optional
Fields to expand in the response. Each entry can be no longer than 5000 characters.

2 status codes
200Returns the subscription discount object, including its source, start time, associated subscription, and optional end time.
checkout_sessionstringoptional
The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Not present for subscription mode.
customerstringoptional
The ID of the customer associated with this discount.
customer_accountstringoptional
The ID of the account representing the customer associated with this discount.
endintegeroptional
If the coupon has a duration of `repeating`, the date that this discount will end. If the coupon has a duration of `once` or `forever`, this attribute will be null.
idstringrequired
The ID of the discount object. Discounts can't be fetched by ID. Use `expand[]=discounts` in API calls to expand discount IDs in an array.
invoicestringoptional
The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.
invoice_itemstringoptional
The invoice item `id` (or invoice line item `id` for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:discount
promotion_codestringoptional
The promotion code applied to create this discount.
sourceobjectrequired
startintegerrequired
Date that the coupon was applied.
subscriptionstringoptional
The subscription that this coupon is applied to, if it is applied to a particular subscription.
subscription_itemstringoptional
The subscription item that this coupon is applied to, if it is applied to a particular subscription item.
defaultError response.
errorobjectrequired

Error handling

customer and subscription_exposed_id must each be identifiers no longer than 5000 characters. Each expand entry must also be no longer than 5000 characters.