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

Get a customer's discount

Retrieves the discount currently applied to a customer. Use customer to identify the customer and expand to include additional response fields when needed.

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

2 parameters
customerstringrequired
The customer identifier whose current discount you want to retrieve.
expandarray<string>optional
Fields to expand in the response; each value must be no longer than 5000 characters.

2 status codes
200Returns the customer's discount, including its identifier, source, start time, and any related customer, invoice, invoice item, subscription, or checkout session.
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 must be a string no longer than 5000 characters that identifies the customer. Each expand value must be a string no longer than 5000 characters.