Stripe: Get Customers Customer Discount
Stripe customers.getCustomersCustomerDiscount: arguments, response, policy and SDK examples.
← Customers operations · Get started
Operation stripe.getcustomerscustomerdiscount
Provider route: GET /v1/customers/{customer}/discount. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/stripe with npm, or alter-sdk-stripe with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { StripeIntegration } from "@alter-ai/stripe";
async function execute(input: Parameters<StripeIntegration["customers"]["getCustomersCustomerDiscount"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new StripeIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.customers.getCustomersCustomerDiscount(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_stripe import StripeIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = StripeIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.customers.get_customers_customer_discount(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.customer | string | Required within parent | Maximum length: 5000 |
query | object | Optional | Additional keys: not allowed |
query.expand | array | Optional | |
query.expand[] | string | Each item | Maximum length: 5000 |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Get Customers Customer Discount — response body |
Referenced models: Get Customers Customer Discount — response body
Schemas
Section titled “Schemas”703 more schemas are linked from the tables above, on the schema pages.
Get Customers Customer Discount — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes). It contains information about when the discount began, when it will end, and what it is applied to. Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts) |
checkout_session | JSON | Optional | |
checkout_session (anyOf 1) | string | Alternative | 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. Maximum length: 5000 |
checkout_session (anyOf 2) | null | Alternative | |
customer | JSON | Optional | |
customer (anyOf 1) | JSON | Alternative | The ID of the customer associated with this discount. |
customer (anyOf 1) (anyOf 1) | string | Alternative | Maximum length: 5000 |
customer (anyOf 1) (anyOf 2) | Model | Alternative | Expand Create a customer — response body |
customer (anyOf 1) (anyOf 3) | Model | Alternative | Expand Delete a customer — response body |
customer (anyOf 2) | null | Alternative | |
customer_account | JSON | Optional | |
customer_account (anyOf 1) | string | Alternative | The ID of the account representing the customer associated with this discount. Maximum length: 5000 |
customer_account (anyOf 2) | null | Alternative | |
end | JSON | Optional | |
end (anyOf 1) | JSON | Alternative | |
end (anyOf 1) (anyOf 1) | integer | Alternative | 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. Format: unix-time |
end (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
end (anyOf 2) | null | Alternative | |
id | string | Required within parent | 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. Maximum length: 5000 |
invoice | JSON | Optional | |
invoice (anyOf 1) | string | Alternative | The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice. Maximum length: 5000 |
invoice (anyOf 2) | null | Alternative | |
invoice_item | JSON | Optional | |
invoice_item (anyOf 1) | string | Alternative | 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. Maximum length: 5000 |
invoice_item (anyOf 2) | null | Alternative | |
object | string | Required within parent | String representing the object's type. Objects of the same type share the same value. Known values: discount |
promotion_code | JSON | Optional | |
promotion_code (anyOf 1) | JSON | Alternative | The promotion code applied to create this discount. |
promotion_code (anyOf 1) (anyOf 1) | string | Alternative | Maximum length: 5000 |
promotion_code (anyOf 1) (anyOf 2) | Model | Alternative | Expand Create a promotion code — response body |
promotion_code (anyOf 2) | null | Alternative | |
source | Model | Required within parent | Expand Get Customers Customer Discount — response body — source |
start | JSON | Required within parent | |
start (anyOf 1) | integer | Alternative | Date that the coupon was applied. Format: unix-time |
start (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
subscription | JSON | Optional | |
subscription (anyOf 1) | string | Alternative | The subscription that this coupon is applied to, if it is applied to a particular subscription. Maximum length: 5000 |
subscription (anyOf 2) | null | Alternative | |
subscription_item | JSON | Optional | |
subscription_item (anyOf 1) | string | Alternative | The subscription item that this coupon is applied to, if it is applied to a particular subscription item. Maximum length: 5000 |
subscription_item (anyOf 2) | null | Alternative |
Referenced models: Create a customer — response body, Delete a customer — response body, Get Customers Customer Discount — response body — source, Create a promotion code — response body
Delete a customer — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
deleted | boolean | Required within parent | Always true for a deleted object Known values: True |
id | string | Required within parent | Unique identifier for the object. Maximum length: 5000 |
object | string | Required within parent | String representing the object's type. Objects of the same type share the same value. Known values: customer |
Get Customers Customer Discount — response body — source
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
coupon | JSON | Optional | |
coupon (anyOf 1) | JSON | Alternative | The coupon that was redeemed to create this discount. |
coupon (anyOf 1) (anyOf 1) | string | Alternative | Maximum length: 5000 |
coupon (anyOf 1) (anyOf 2) | Model | Alternative | Expand Create a coupon — response body |
coupon (anyOf 2) | null | Alternative | |
type | string | Required within parent | The source type of the discount. Known values: coupon |
Referenced models: Create a coupon — response body
Create a Location — response body — address
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
city | JSON | Optional | |
city (anyOf 1) | string | Alternative | City, district, suburb, town, or village. Maximum length: 5000 |
city (anyOf 2) | null | Alternative | |
country | JSON | Optional | |
country (anyOf 1) | string | Alternative | Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). Maximum length: 5000 |
country (anyOf 2) | null | Alternative | |
line1 | JSON | Optional | |
line1 (anyOf 1) | string | Alternative | Address line 1, such as the street, PO Box, or company name. Maximum length: 5000 |
line1 (anyOf 2) | null | Alternative | |
line2 | JSON | Optional | |
line2 (anyOf 1) | string | Alternative | Address line 2, such as the apartment, suite, unit, or building. Maximum length: 5000 |
line2 (anyOf 2) | null | Alternative | |
postal_code | JSON | Optional | |
postal_code (anyOf 1) | string | Alternative | ZIP or postal code. Maximum length: 5000 |
postal_code (anyOf 2) | null | Alternative | |
state | JSON | Optional | |
state (anyOf 1) | string | Alternative | State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). Maximum length: 5000 |
state (anyOf 2) | null | Alternative |
Retrieve a cash balance — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A customer's `Cash balance` represents real funds. Customers can add funds to their cash balance by sending a bank transfer. These funds can be used for payment and can eventually be paid out to your bank account. |
available | JSON | Optional | |
available (anyOf 1) | object | Alternative | A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). Additional keys: see wildcard field |
available (anyOf 1).* | JSON | Additional keys | |
available (anyOf 1).* (anyOf 1) | integer | Alternative | |
available (anyOf 1).* (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
available (anyOf 2) | null | Alternative | |
customer | string | Required within parent | The ID of the customer whose cash balance this object represents. Maximum length: 5000 |
customer_account | JSON | Optional | |
customer_account (anyOf 1) | string | Alternative | The ID of an Account representing a customer whose cash balance this object represents. Maximum length: 5000 |
customer_account (anyOf 2) | null | Alternative | |
livemode | boolean | Required within parent | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
object | string | Required within parent | String representing the object's type. Objects of the same type share the same value. Known values: cash_balance |
settings | Model | Required within parent | Expand Retrieve a cash balance — response body — settings |
Referenced models: Retrieve a cash balance — response body — settings
Pay an invoice — response body — custom fields Custom fields displayed on the invoice item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
name | string | Required within parent | The name of the custom field. Maximum length: 5000 |
value | string | Required within parent | The value of the custom field. Maximum length: 5000 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: stripe.getcustomerscustomerdiscount. Catalog operation: GetCustomersCustomerDiscount. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Pinned headers: {"Stripe-Version": "2026-09-30.endive"}