Knox Docs Sign in

API reference

Test mode. Use your secret key on your server; live processing is currently disabled.

https://api.knoxapi.com

Send form-encoded requests with Authorization: Bearer sk_test_....

Complete OpenAPI specification · Integration guide

Operations and schemas are based on the pinned Stripe OpenAPI specification (MIT). Nested object definitions and enums are available in the complete specification.

GET /v1/customers

List all customers

Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.

Request parameters

ParameterLocationTypeDescription
createdqueryone of multiple schemasOnly return customers that were created during the given date interval.
emailquerystringA case-sensitive filter on the list based on the customer's `email` field. The value must be a string.
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
test_clockquerystringProvides a list of customers that are associated with the specified test clock. The response will not include customers with test clocks if this parameter is not set.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of customer
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers

Create a customer

Creates a new customer object.

Request parameters

FieldTypeDescription
addressone of multiple schemasThe customer's address. Learn about [country-specific requirements for calculating tax](https://docs.stripe.com/invoicing/taxes?dashboard-or-api=dashboard#set-up-customer).
balanceintegerAn integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice.
business_nameone of multiple schemasThe customer's business name. This may be up to *150 characters*.
cash_balanceobjectBalance information and default balance settings for this customer.
descriptionstringAn arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard.
emailstringCustomer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*.
expandarray of stringSpecifies which fields in the response should be expanded.
individual_nameone of multiple schemasThe customer's full name. This may be up to *150 characters*.
invoice_prefixstringThe prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers.
invoice_settingsobjectDefault invoice settings for this customer.
metadataone of multiple schemasSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
namestringThe customer's full name or business name.
next_invoice_sequenceintegerThe sequence to be used on the customer's next invoice. Defaults to 1.
payment_methodstring
phonestringThe customer's phone number.
preferred_localesarray of stringCustomer's preferred languages, ordered by preference.
shippingone of multiple schemasThe customer's shipping information. Appears on invoices emailed to this customer.
sourcestring
taxobjectTax details about the customer.
tax_exemptstringThe customer's tax exemption. One of `none`, `exempt`, or `reverse`.
tax_id_dataarray of objectThe customer's tax IDs.
test_clockstringID of the test clock to attach to the customer.

Responses

HTTP 200: Successful response.
FieldTypeDescription
addressone of multiple schemasThe customer's address.
balanceintegerThe current balance, if any, that's stored on the customer in their default currency. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that's added to their next invoice. The balance only considers amounts that Stripe hasn't successfully applied to any invoice. It doesn't reflect unpaid invoices. This balance is only taken into account after invoices finalize. For multi-currency balances, see [invoice_credit_balance](https://docs.stripe.com/api/customers/object#customer_object-invoice_credit_balance).
business_namestringThe customer's business name.
cash_balanceone of multiple schemasThe current funds being held by Stripe on behalf of the customer. You can apply these funds towards payment intents when the source is "cash_balance". The `settings[reconciliation_mode]` field describes if these funds apply to these payment intents manually or automatically.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
currencystringThree-letter [ISO code for the currency](https://stripe.com/docs/currencies) the customer can be charged in for recurring billing purposes.
customer_accountstringThe ID of an Account representing a customer. You can use this ID with any v1 API that accepts a customer_account parameter.
default_sourceone of multiple schemasID of the default payment source for the customer. If you use payment methods created through the PaymentMethods API, see the [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) field instead.
delinquentbooleanTracks the most recent state change on any invoice belonging to the customer. Paying an invoice or marking it uncollectible via the API will set this field to false. An automatic payment failure or passing the `invoice.due_date` will set this field to `true`. If an invoice becomes uncollectible by [dunning](https://docs.stripe.com/billing/automatic-collection), `delinquent` doesn't reset to `false`. If you care whether the customer has paid their most recent subscription invoice, use `subscription.status` instead. Paying or marking uncollectible any customer invoice regardless of whether it is the latest invoice for a subscription will always set this field to `false`.
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
discountone of multiple schemasDescribes the current discount active on the customer, if there is one.
emailstringThe customer's email address.
id requiredstringUnique identifier for the object.
individual_namestringThe customer's individual name.
invoice_credit_balanceobjectThe current multi-currency balances, if any, that's stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. These balances don't apply to unpaid invoices. They solely track amounts that Stripe hasn't successfully applied to any invoice. Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes.
invoice_prefixstringThe prefix for the customer used to generate unique invoice numbers.
invoice_settingsinvoice_setting_customer_setting
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
namestringThe customer's full name or business name.
next_invoice_sequenceintegerThe suffix of the customer's next invoice number (for example, 0001). When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses.
object requiredstringString representing the object's type. Objects of the same type share the same value.
phonestringThe customer's phone number.
preferred_localesarray of stringThe customer's preferred locales (languages), ordered by preference.
shippingone of multiple schemasMailing and shipping address for the customer. Appears on invoices emailed to this customer.
sourcesobjectThe customer's payment sources, if any.
subscriptionsobjectThe customer's current subscriptions, if any.
taxcustomer_tax
tax_exemptstringDescribes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to `reverse`, invoice and receipt PDFs include the following text: **"Reverse charge"**.
tax_idsobjectThe customer's tax IDs.
test_clockone of multiple schemasID of the test clock that this customer belongs to.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/search

Search customers

Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.

Request parameters

ParameterLocationTypeDescription
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
pagequerystringA cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
queryquerystringThe search query string. See [search query language](https://docs.stripe.com/search#search-query-language) and the list of supported [query fields for customers](https://docs.stripe.com/search#query-fields-for-customers).

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of customer
has_more requiredboolean
next_pagestring
object requiredstringString representing the object's type. Objects of the same type share the same value.
total_countintegerThe total number of objects that match the query, only accurate up to 10,000.
url requiredstring
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
DELETE /v1/customers/{customer}

Delete a customer

Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
deleted requiredbooleanAlways true for a deleted object
id requiredstringUnique identifier for the object.
object requiredstringString representing the object's type. Objects of the same type share the same value.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}

Retrieve a customer

Retrieves a Customer object.

Request parameters

ParameterLocationTypeDescription
customerpathstring
expandqueryarray of stringSpecifies which fields in the response should be expanded.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.

one of multiple schemas. See the OpenAPI specification for the complete schema.

HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers/{customer}

Update a customer

Updates the specified customer by setting the values of the parameters passed. Any parameters not provided are left unchanged. For example, if you pass the source parameter, that becomes the customer’s active source (such as a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled is retried. This retry doesn’t count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer doesn’t trigger this behavior. This request accepts mostly the same arguments as the customer creation call.

Request parameters

ParameterLocationTypeDescription
customerpathstring
FieldTypeDescription
addressone of multiple schemasThe customer's address. Learn about [country-specific requirements for calculating tax](https://docs.stripe.com/invoicing/taxes?dashboard-or-api=dashboard#set-up-customer).
balanceintegerAn integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice.
bank_accountone of multiple schemasEither a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details.
business_nameone of multiple schemasThe customer's business name. This may be up to *150 characters*.
cardone of multiple schemasA token, like the ones returned by [Stripe.js](https://stripe.com/docs/js).
cash_balanceobjectBalance information and default balance settings for this customer.
default_alipay_accountstringID of Alipay account to make the customer's new default for invoice payments.
default_bank_accountstringID of bank account to make the customer's new default for invoice payments.
default_cardstringID of card to make the customer's new default for invoice payments.
default_sourcestringIf you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter. Provide the ID of a payment source already attached to this customer to make it this customer's default payment source. If you want to add a new payment source and make it the default, see the [source](https://docs.stripe.com/api/customers/update#update_customer-source) property.
descriptionstringAn arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard.
emailstringCustomer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*.
expandarray of stringSpecifies which fields in the response should be expanded.
individual_nameone of multiple schemasThe customer's full name. This may be up to *150 characters*.
invoice_prefixstringThe prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers.
invoice_settingsobjectDefault invoice settings for this customer.
metadataone of multiple schemasSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
namestringThe customer's full name or business name.
next_invoice_sequenceintegerThe sequence to be used on the customer's next invoice. Defaults to 1.
phonestringThe customer's phone number.
preferred_localesarray of stringCustomer's preferred languages, ordered by preference.
shippingone of multiple schemasThe customer's shipping information. Appears on invoices emailed to this customer.
sourcestring
taxobjectTax details about the customer.
tax_exemptstringThe customer's tax exemption. One of `none`, `exempt`, or `reverse`.

Responses

HTTP 200: Successful response.
FieldTypeDescription
addressone of multiple schemasThe customer's address.
balanceintegerThe current balance, if any, that's stored on the customer in their default currency. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that's added to their next invoice. The balance only considers amounts that Stripe hasn't successfully applied to any invoice. It doesn't reflect unpaid invoices. This balance is only taken into account after invoices finalize. For multi-currency balances, see [invoice_credit_balance](https://docs.stripe.com/api/customers/object#customer_object-invoice_credit_balance).
business_namestringThe customer's business name.
cash_balanceone of multiple schemasThe current funds being held by Stripe on behalf of the customer. You can apply these funds towards payment intents when the source is "cash_balance". The `settings[reconciliation_mode]` field describes if these funds apply to these payment intents manually or automatically.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
currencystringThree-letter [ISO code for the currency](https://stripe.com/docs/currencies) the customer can be charged in for recurring billing purposes.
customer_accountstringThe ID of an Account representing a customer. You can use this ID with any v1 API that accepts a customer_account parameter.
default_sourceone of multiple schemasID of the default payment source for the customer. If you use payment methods created through the PaymentMethods API, see the [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) field instead.
delinquentbooleanTracks the most recent state change on any invoice belonging to the customer. Paying an invoice or marking it uncollectible via the API will set this field to false. An automatic payment failure or passing the `invoice.due_date` will set this field to `true`. If an invoice becomes uncollectible by [dunning](https://docs.stripe.com/billing/automatic-collection), `delinquent` doesn't reset to `false`. If you care whether the customer has paid their most recent subscription invoice, use `subscription.status` instead. Paying or marking uncollectible any customer invoice regardless of whether it is the latest invoice for a subscription will always set this field to `false`.
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
discountone of multiple schemasDescribes the current discount active on the customer, if there is one.
emailstringThe customer's email address.
id requiredstringUnique identifier for the object.
individual_namestringThe customer's individual name.
invoice_credit_balanceobjectThe current multi-currency balances, if any, that's stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. These balances don't apply to unpaid invoices. They solely track amounts that Stripe hasn't successfully applied to any invoice. Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes.
invoice_prefixstringThe prefix for the customer used to generate unique invoice numbers.
invoice_settingsinvoice_setting_customer_setting
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
namestringThe customer's full name or business name.
next_invoice_sequenceintegerThe suffix of the customer's next invoice number (for example, 0001). When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses.
object requiredstringString representing the object's type. Objects of the same type share the same value.
phonestringThe customer's phone number.
preferred_localesarray of stringThe customer's preferred locales (languages), ordered by preference.
shippingone of multiple schemasMailing and shipping address for the customer. Appears on invoices emailed to this customer.
sourcesobjectThe customer's payment sources, if any.
subscriptionsobjectThe customer's current subscriptions, if any.
taxcustomer_tax
tax_exemptstringDescribes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to `reverse`, invoice and receipt PDFs include the following text: **"Reverse charge"**.
tax_idsobjectThe customer's tax IDs.
test_clockone of multiple schemasID of the test clock that this customer belongs to.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/balance_transactions

List customer balance transactions

Returns a list of transactions that updated the customer’s balances.

Request parameters

ParameterLocationTypeDescription
createdqueryone of multiple schemasOnly return customer balance transactions that were created during the given date interval.
customerpathstring
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
invoicequerystringOnly return transactions that are related to the specified invoice.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of customer_balance_transactionDetails about each object.
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers/{customer}/balance_transactions

Create a customer balance transaction

Creates an immutable transaction that updates the customer’s credit balance.

Request parameters

ParameterLocationTypeDescription
customerpathstring
FieldTypeDescription
amount requiredintegerThe integer amount in **cents (or local equivalent)** to apply to the customer's credit balance.
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Specifies the [`invoice_credit_balance`](https://docs.stripe.com/api/customers/object#customer_object-invoice_credit_balance) that this transaction will apply to. If the customer's `currency` is not set, it will be updated to this value.
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
expandarray of stringSpecifies which fields in the response should be expanded.
metadataone of multiple schemasSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.

Responses

HTTP 200: Successful response.
FieldTypeDescription
amount requiredintegerThe amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's `balance`.
checkout_sessionone of multiple schemasThe ID of the checkout session (if any) that created the transaction.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
credit_noteone of multiple schemasThe ID of the credit note (if any) related to the transaction.
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
customer requiredone of multiple schemasThe ID of the customer the transaction belongs to.
customer_accountstringThe ID of an Account representing a customer that the transaction belongs to.
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
ending_balance requiredintegerThe customer's `balance` after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice.
id requiredstringUnique identifier for the object.
invoiceone of multiple schemasThe ID of the invoice (if any) related to the transaction.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
object requiredstringString representing the object's type. Objects of the same type share the same value.
type requiredstringTransaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, `unapplied_from_invoice`, `checkout_session_subscription_payment`, or `checkout_session_subscription_payment_canceled`. See the [Customer Balance page](https://docs.stripe.com/billing/customer/balance#types) to learn more about transaction types.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/bank_accounts

List all bank accounts

You can see a list of the bank accounts belonging to a Customer. Note that the 10 most recent sources are always available by default on the Customer. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional bank accounts.

Request parameters

ParameterLocationTypeDescription
customerpathstring
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of bank_accountDetails about each object.
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers/{customer}/bank_accounts

Create a card

When you create a new credit card, you must specify a customer or recipient on which to create it. If the card’s owner has no default card, then the new card will become the default. However, if the owner already has a default, then it will not change. To change the default, you should update the customer to have a new default_source.

Request parameters

ParameterLocationTypeDescription
customerpathstring
FieldTypeDescription
alipay_accountstringA token returned by [Stripe.js](https://stripe.com/docs/js) representing the user’s Alipay account details.
bank_accountone of multiple schemasEither a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details.
cardone of multiple schemasA token, like the ones returned by [Stripe.js](https://stripe.com/docs/js).
expandarray of stringSpecifies which fields in the response should be expanded.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
sourcestringPlease refer to full [documentation](https://api.stripe.com) instead.

Responses

HTTP 200: Successful response.

one of multiple schemas. See the OpenAPI specification for the complete schema.

HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/cards

List all cards

You can see a list of the cards belonging to a customer. Note that the 10 most recent sources are always available on the Customer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional cards.

Request parameters

ParameterLocationTypeDescription
customerpathstring
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of card
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers/{customer}/cards

Create a card

When you create a new credit card, you must specify a customer or recipient on which to create it. If the card’s owner has no default card, then the new card will become the default. However, if the owner already has a default, then it will not change. To change the default, you should update the customer to have a new default_source.

Request parameters

ParameterLocationTypeDescription
customerpathstring
FieldTypeDescription
alipay_accountstringA token returned by [Stripe.js](https://stripe.com/docs/js) representing the user’s Alipay account details.
bank_accountone of multiple schemasEither a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details.
cardone of multiple schemasA token, like the ones returned by [Stripe.js](https://stripe.com/docs/js).
expandarray of stringSpecifies which fields in the response should be expanded.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
sourcestringPlease refer to full [documentation](https://api.stripe.com) instead.

Responses

HTTP 200: Successful response.

one of multiple schemas. See the OpenAPI specification for the complete schema.

HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/cash_balance

Retrieve a cash balance

Retrieves a customer’s cash balance.

Request parameters

ParameterLocationTypeDescription
customerpathstring
expandqueryarray of stringSpecifies which fields in the response should be expanded.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
availableobjectA 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).
customer requiredstringThe ID of the customer whose cash balance this object represents.
customer_accountstringThe ID of an Account representing a customer whose cash balance this object represents.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
settings requiredcustomer_balance_customer_balance_settings
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers/{customer}/cash_balance

Update a cash balance's settings

Changes the settings on a customer’s cash balance.

Request parameters

ParameterLocationTypeDescription
customerpathstring
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.
settingsobjectA hash of settings for this cash balance.

Responses

HTTP 200: Successful response.
FieldTypeDescription
availableobjectA 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).
customer requiredstringThe ID of the customer whose cash balance this object represents.
customer_accountstringThe ID of an Account representing a customer whose cash balance this object represents.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
settings requiredcustomer_balance_customer_balance_settings
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/cash_balance_transactions

List cash balance transactions

Returns a list of transactions that modified the customer’s cash balance.

Request parameters

ParameterLocationTypeDescription
customerpathstring
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of customer_cash_balance_transactionDetails about each object.
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
DELETE /v1/customers/{customer}/discount

Delete a customer discount

Removes the currently applied discount on a customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
checkout_sessionstringThe Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Not present for subscription mode.
customerone of multiple schemasThe ID of the customer associated with this discount.
customer_accountstringThe ID of the account representing the customer associated with this discount.
deleted requiredbooleanAlways true for a deleted object
id requiredstringThe 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.
invoicestringThe invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.
invoice_itemstringThe 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.
object requiredstringString representing the object's type. Objects of the same type share the same value.
promotion_codeone of multiple schemasThe promotion code applied to create this discount.
source requireddiscount_source
start requiredintegerDate that the coupon was applied.
subscriptionstringThe subscription that this coupon is applied to, if it is applied to a particular subscription.
subscription_itemstringThe subscription item that this coupon is applied to, if it is applied to a particular subscription item.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/discount

/v1/customers/{customer}/discount

Request parameters

ParameterLocationTypeDescription
customerpathstring
expandqueryarray of stringSpecifies which fields in the response should be expanded.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
checkout_sessionstringThe Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Not present for subscription mode.
customerone of multiple schemasThe ID of the customer associated with this discount.
customer_accountstringThe ID of the account representing the customer associated with this discount.
endintegerIf 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.
id requiredstringThe 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.
invoicestringThe invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.
invoice_itemstringThe 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.
object requiredstringString representing the object's type. Objects of the same type share the same value.
promotion_codeone of multiple schemasThe promotion code applied to create this discount.
source requireddiscount_source
start requiredintegerDate that the coupon was applied.
subscriptionstringThe subscription that this coupon is applied to, if it is applied to a particular subscription.
subscription_itemstringThe subscription item that this coupon is applied to, if it is applied to a particular subscription item.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers/{customer}/funding_instructions

Create or retrieve funding instructions for a customer cash balance

Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new funding instructions will be created. If funding instructions have already been created for a given customer, the same funding instructions will be retrieved. In other words, we will return the same funding instructions each time.

Request parameters

ParameterLocationTypeDescription
customerpathstring
FieldTypeDescription
bank_transfer requiredobjectAdditional parameters for `bank_transfer` funding types
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
expandarray of stringSpecifies which fields in the response should be expanded.
funding_type requiredstringThe `funding_type` to get the instructions for.

Responses

HTTP 200: Successful response.
FieldTypeDescription
bank_transfer requiredfunding_instructions_bank_transfer
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
funding_type requiredstringThe `funding_type` of the returned instructions
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/payment_methods

List a Customer's PaymentMethods

Returns a list of PaymentMethods for a given Customer

Request parameters

ParameterLocationTypeDescription
allow_redisplayquerystringThis field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow.
customerpathstring
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
typequerystringAn optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of payment_method
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/sources

/v1/customers/{customer}/sources

List sources for a specified customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
objectquerystringFilter sources according to a particular object type.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of one of multiple schemasDetails about each object.
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers/{customer}/sources

Create a card

When you create a new credit card, you must specify a customer or recipient on which to create it. If the card’s owner has no default card, then the new card will become the default. However, if the owner already has a default, then it will not change. To change the default, you should update the customer to have a new default_source.

Request parameters

ParameterLocationTypeDescription
customerpathstring
FieldTypeDescription
alipay_accountstringA token returned by [Stripe.js](https://stripe.com/docs/js) representing the user’s Alipay account details.
bank_accountone of multiple schemasEither a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details.
cardone of multiple schemasA token, like the ones returned by [Stripe.js](https://stripe.com/docs/js).
expandarray of stringSpecifies which fields in the response should be expanded.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
sourcestringPlease refer to full [documentation](https://api.stripe.com) instead.

Responses

HTTP 200: Successful response.

one of multiple schemas. See the OpenAPI specification for the complete schema.

HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/subscriptions

List active subscriptions

You can see a list of the customer’s active subscriptions. Note that the 10 most recent active subscriptions are always available by default on the customer object. If you need more than those 10, you can use the limit and starting_after parameters to page through additional subscriptions.

Request parameters

ParameterLocationTypeDescription
customerpathstring
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of subscriptionDetails about each object.
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers/{customer}/subscriptions

Create a subscription

Creates a new subscription on an existing customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring
FieldTypeDescription
add_invoice_itemsarray of objectA list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items.
application_fee_percentone of multiple schemasA non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
automatic_taxobjectAutomatic tax settings for this subscription.
backdate_start_dateintegerA past timestamp to backdate the subscription's start date to. If set, the first invoice will contain line items for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor.
billing_cycle_anchorintegerA future timestamp in UTC format to anchor the subscription's [billing cycle](https://docs.stripe.com/subscriptions/billing-cycle). The anchor is the reference point that aligns future billing cycle dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals.
billing_thresholdsone of multiple schemasDefine thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
cancel_atone of multiple schemasA timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
cancel_at_period_endbooleanIndicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
collection_methodstringEither `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`.
currencystringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
days_until_dueintegerNumber of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`.
default_payment_methodstringID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://docs.stripe.com/api/customers/object#customer_object-default_source).
default_sourcestringID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://docs.stripe.com/api/customers/object#customer_object-default_source).
default_tax_ratesone of multiple schemasThe tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription.
discountsone of multiple schemasThe coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer.
expandarray of stringSpecifies which fields in the response should be expanded.
invoice_settingsobjectAll invoices will be billed using the specified settings.
itemsarray of objectA list of up to 20 subscription items, each with an attached price.
metadataone of multiple schemasSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
off_sessionbooleanIndicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `false` (on-session).
payment_behaviorstringControls how Stripe handles the first invoice when payment is required and `collection_method=charge_automatically`. Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first Invoice status.
payment_settingsobjectPayment settings to pass to invoices created by the subscription.
pending_invoice_item_intervalone of multiple schemasSpecifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](/api/invoices/create) for the given subscription at the specified interval.
proration_behaviorstringDetermines how to handle [prorations](https://docs.stripe.com/billing/subscriptions/prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`.
transfer_dataobjectIf specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges.
trial_endone of multiple schemasUnix timestamp representing the end of the trial period the customer will get before being charged for the first time. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials) to learn more.
trial_from_planbooleanIndicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials) to learn more.
trial_period_daysintegerInteger representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials) to learn more.
trial_settingsobjectSettings related to subscription trials.

Responses

HTTP 200: Successful response.
FieldTypeDescription
applicationone of multiple schemasID of the Connect Application that created the subscription.
application_fee_percentnumberA non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account.
automatic_tax requiredsubscription_automatic_tax
billing_cycle_anchor requiredintegerThe reference point that aligns future [billing cycle](https://docs.stripe.com/subscriptions/billing-cycle) dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. The timestamp is in UTC format.
billing_cycle_anchor_configone of multiple schemasThe fixed values used to calculate the `billing_cycle_anchor`.
billing_mode requiredsubscriptions_resource_billing_mode
billing_schedules requiredarray of subscriptions_resource_billing_schedulesBilling schedules for this subscription.
billing_thresholdsone of multiple schemasDefine thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
cancel_atintegerA date in the future at which the subscription will automatically get canceled
cancel_at_period_end requiredbooleanWhether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period.
canceled_atintegerIf the subscription has been canceled, the date of that cancellation. If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
cancellation_detailsone of multiple schemasDetails about why this subscription was cancelled
collection_method requiredstringEither `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
customer requiredone of multiple schemasID of the customer who owns the subscription.
customer_accountstringID of the account representing the customer who owns the subscription.
days_until_dueintegerNumber of days a customer has to pay invoices generated by this subscription. This value will be `null` for subscriptions where `collection_method=charge_automatically`.
default_payment_methodone of multiple schemasID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://docs.stripe.com/api/customers/object#customer_object-default_source).
default_sourceone of multiple schemasID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://docs.stripe.com/api/customers/object#customer_object-default_source).
default_tax_ratesarray of tax_rateThe tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription.
descriptionstringThe subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
discounts requiredarray of one of multiple schemasThe discounts applied to the subscription. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount.
ended_atintegerIf the subscription has ended, the date the subscription ended.
id requiredstringUnique identifier for the object.
invoice_settings requiredsubscriptions_resource_subscription_invoice_settings
items requiredobjectList of subscription items, each with an attached price.
latest_invoiceone of multiple schemasThe most recent invoice this subscription has generated over its lifecycle (for example, when it cycles or is updated).
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
managed_paymentsone of multiple schemasSettings for Managed Payments for this Subscription and resulting [Invoices](/api/invoices/object) and [PaymentIntents](/api/payment_intents/object).
metadata requiredobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
next_pending_invoice_item_invoiceintegerSpecifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
on_behalf_ofone of multiple schemasThe account (if any) the charge was made on behalf of for charges associated with this subscription. See the [Connect documentation](https://docs.stripe.com/connect/subscriptions#on-behalf-of) for details.
pause_collectionone of multiple schemasIf specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://docs.stripe.com/billing/subscriptions/pause-payment).
payment_settingsone of multiple schemasPayment settings passed on to invoices created by the subscription.
pending_invoice_item_intervalone of multiple schemasSpecifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](/api/invoices/create) for the given subscription at the specified interval.
pending_setup_intentone of multiple schemasYou can use this [SetupIntent](https://docs.stripe.com/api/setup_intents) to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the [SCA Migration Guide](https://docs.stripe.com/billing/migration/strong-customer-authentication#scenario-2).
pending_updateone of multiple schemasIf specified, [pending updates](https://docs.stripe.com/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid.
presentment_detailssubscriptions_resource_subscription_presentment_details
scheduleone of multiple schemasThe schedule attached to the subscription
start_date requiredintegerDate when the subscription was first created. The date might differ from the `created` date due to backdating.
status requiredstringPossible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, `unpaid`, or `paused`. For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this status can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` status. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a terminal status, the open invoice will be voided and no further invoices will be generated. A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. A subscription can only enter a `paused` status [when a trial ends without a payment method](https://docs.stripe.com/billing/subscriptions/trials#create-free-trials-without-payment). A `paused` subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The `paused` status is different from [pausing collection](https://docs.stripe.com/billing/subscriptions/pause-payment), which still generates invoices and leaves the subscription's status unchanged. If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.
test_clockone of multiple schemasID of the test clock this subscription belongs to.
transfer_dataone of multiple schemasThe account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
trial_endintegerIf the subscription has a trial, the end of that trial.
trial_settingsone of multiple schemasSettings related to subscription trials.
trial_startintegerIf the subscription has a trial, the beginning of that trial.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/tax_ids

List all Customer tax IDs

Returns a list of tax IDs for a customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of tax_idDetails about each object.
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers/{customer}/tax_ids

Create a Customer tax ID

Creates a new tax_id object for a customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.
type requiredstringType of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `ic_nif`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`
value requiredstringValue of the tax ID.

Responses

HTTP 200: Successful response.
FieldTypeDescription
countrystringTwo-letter ISO code representing the country of the tax ID.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customerone of multiple schemasID of the customer.
customer_accountstringID of the Account representing the customer.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
ownerone of multiple schemasThe account or customer the tax ID belongs to.
type requiredstringType of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `ic_nif`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`. Note that some legacy tax IDs have type `unknown`
value requiredstringValue of the tax ID.
verificationone of multiple schemasTax ID verification information.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/balance_transactions/{transaction}

Retrieve a customer balance transaction

Retrieves a specific customer balance transaction that updated the customer’s balances.

Request parameters

ParameterLocationTypeDescription
customerpathstring
expandqueryarray of stringSpecifies which fields in the response should be expanded.
transactionpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
amount requiredintegerThe amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's `balance`.
checkout_sessionone of multiple schemasThe ID of the checkout session (if any) that created the transaction.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
credit_noteone of multiple schemasThe ID of the credit note (if any) related to the transaction.
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
customer requiredone of multiple schemasThe ID of the customer the transaction belongs to.
customer_accountstringThe ID of an Account representing a customer that the transaction belongs to.
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
ending_balance requiredintegerThe customer's `balance` after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice.
id requiredstringUnique identifier for the object.
invoiceone of multiple schemasThe ID of the invoice (if any) related to the transaction.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
object requiredstringString representing the object's type. Objects of the same type share the same value.
type requiredstringTransaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, `unapplied_from_invoice`, `checkout_session_subscription_payment`, or `checkout_session_subscription_payment_canceled`. See the [Customer Balance page](https://docs.stripe.com/billing/customer/balance#types) to learn more about transaction types.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers/{customer}/balance_transactions/{transaction}

Update a customer credit balance transaction

Most credit balance transaction fields are immutable, but you may update its description and metadata.

Request parameters

ParameterLocationTypeDescription
customerpathstring
transactionpathstring
FieldTypeDescription
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
expandarray of stringSpecifies which fields in the response should be expanded.
metadataone of multiple schemasSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.

Responses

HTTP 200: Successful response.
FieldTypeDescription
amount requiredintegerThe amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's `balance`.
checkout_sessionone of multiple schemasThe ID of the checkout session (if any) that created the transaction.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
credit_noteone of multiple schemasThe ID of the credit note (if any) related to the transaction.
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
customer requiredone of multiple schemasThe ID of the customer the transaction belongs to.
customer_accountstringThe ID of an Account representing a customer that the transaction belongs to.
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
ending_balance requiredintegerThe customer's `balance` after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice.
id requiredstringUnique identifier for the object.
invoiceone of multiple schemasThe ID of the invoice (if any) related to the transaction.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
object requiredstringString representing the object's type. Objects of the same type share the same value.
type requiredstringTransaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, `unapplied_from_invoice`, `checkout_session_subscription_payment`, or `checkout_session_subscription_payment_canceled`. See the [Customer Balance page](https://docs.stripe.com/billing/customer/balance#types) to learn more about transaction types.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
DELETE /v1/customers/{customer}/bank_accounts/{id}

Delete a customer source

Delete a specified source for a given customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring
idpathstring
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.

one of multiple schemas. See the OpenAPI specification for the complete schema.

HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/bank_accounts/{id}

Retrieve a bank account

By default, you can see the 10 most recent sources stored on a Customer directly on the object, but you can also retrieve details about a specific bank account stored on the Stripe account.

Request parameters

ParameterLocationTypeDescription
customerpathstring
expandqueryarray of stringSpecifies which fields in the response should be expanded.
idpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
accountone of multiple schemasThe account this bank account belongs to. Only applicable on Accounts (not customers or recipients) This property is only available when returned as an [External Account](/api/external_account_bank_accounts/object) where [controller.is_controller](/api/accounts/object#account_object-controller-is_controller) is `true`.
account_holder_namestringThe name of the person or business that owns the bank account.
account_holder_typestringThe type of entity that holds the account. This can be either `individual` or `company`.
account_typestringThe bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`.
available_payout_methodsarray of stringA set of available payout methods for this bank account. Only values from this set should be passed as the `method` when creating a payout.
bank_namestringName of the bank associated with the routing number (e.g., `WELLS FARGO`).
country requiredstringTwo-letter ISO code representing the country the bank account is located in.
currency requiredstringThree-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account.
customerone of multiple schemasThe ID of the customer that the bank account is associated with.
default_for_currencybooleanWhether this bank account is the default external account for its currency.
fingerprintstringUniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
future_requirementsone of multiple schemasInformation about the [upcoming new requirements for the bank account](https://docs.stripe.com/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when.
id requiredstringUnique identifier for the object.
last4 requiredstringThe last four digits of the bank account number.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
object requiredstringString representing the object's type. Objects of the same type share the same value.
requirementsone of multiple schemasInformation about the requirements for the bank account, including what information needs to be collected.
routing_numberstringThe routing transit number for the bank account.
status requiredstringFor bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, `tokenized_account_number_deactivated` or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If the status is `tokenized_account_number_deactivated`, the account utilizes a tokenized account number which has been deactivated due to expiration or revocation. This account will need to be reverified to continue using it for money movement. If a payout sent to this bank account fails, we'll set the status to `errored` and will not continue to send [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) until the bank details are updated. For external accounts, possible values are `new`, `errored`, `verification_failed`, and `tokenized_account_number_deactivated`. If a payout fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. In the US and India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers/{customer}/bank_accounts/{id}

Update a card

Update a specified source for a given customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring
idpathstring
FieldTypeDescription
account_holder_namestringThe name of the person or business that owns the bank account.
account_holder_typestringThe type of entity that holds the account. This can be either `individual` or `company`.
address_citystringCity/District/Suburb/Town/Village.
address_countrystringBilling address country, if provided when creating card.
address_line1stringAddress line 1 (Street address/PO Box/Company name).
address_line2stringAddress line 2 (Apartment/Suite/Unit/Building).
address_statestringState/County/Province/Region.
address_zipstringZIP or postal code.
exp_monthstringTwo digit number representing the card’s expiration month.
exp_yearstringFour digit number representing the card’s expiration year.
expandarray of stringSpecifies which fields in the response should be expanded.
metadataone of multiple schemasSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
namestringCardholder name.
ownerobject

Responses

HTTP 200: Successful response.

one of multiple schemas. See the OpenAPI specification for the complete schema.

HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers/{customer}/bank_accounts/{id}/verify

Verify a bank account

Verify a specified bank account for a given customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring
idpathstring
FieldTypeDescription
amountsarray of integerTwo positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.
FieldTypeDescription
accountone of multiple schemasThe account this bank account belongs to. Only applicable on Accounts (not customers or recipients) This property is only available when returned as an [External Account](/api/external_account_bank_accounts/object) where [controller.is_controller](/api/accounts/object#account_object-controller-is_controller) is `true`.
account_holder_namestringThe name of the person or business that owns the bank account.
account_holder_typestringThe type of entity that holds the account. This can be either `individual` or `company`.
account_typestringThe bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`.
available_payout_methodsarray of stringA set of available payout methods for this bank account. Only values from this set should be passed as the `method` when creating a payout.
bank_namestringName of the bank associated with the routing number (e.g., `WELLS FARGO`).
country requiredstringTwo-letter ISO code representing the country the bank account is located in.
currency requiredstringThree-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account.
customerone of multiple schemasThe ID of the customer that the bank account is associated with.
default_for_currencybooleanWhether this bank account is the default external account for its currency.
fingerprintstringUniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
future_requirementsone of multiple schemasInformation about the [upcoming new requirements for the bank account](https://docs.stripe.com/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when.
id requiredstringUnique identifier for the object.
last4 requiredstringThe last four digits of the bank account number.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
object requiredstringString representing the object's type. Objects of the same type share the same value.
requirementsone of multiple schemasInformation about the requirements for the bank account, including what information needs to be collected.
routing_numberstringThe routing transit number for the bank account.
status requiredstringFor bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, `tokenized_account_number_deactivated` or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If the status is `tokenized_account_number_deactivated`, the account utilizes a tokenized account number which has been deactivated due to expiration or revocation. This account will need to be reverified to continue using it for money movement. If a payout sent to this bank account fails, we'll set the status to `errored` and will not continue to send [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) until the bank details are updated. For external accounts, possible values are `new`, `errored`, `verification_failed`, and `tokenized_account_number_deactivated`. If a payout fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. In the US and India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
DELETE /v1/customers/{customer}/cards/{id}

Delete a customer source

Delete a specified source for a given customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring
idpathstring
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.

one of multiple schemas. See the OpenAPI specification for the complete schema.

HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/cards/{id}

Retrieve a card

You can always see the 10 most recent cards directly on a customer; this method lets you retrieve details about a specific card stored on the customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring
expandqueryarray of stringSpecifies which fields in the response should be expanded.
idpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
accountone of multiple schemas
address_citystringCity/District/Suburb/Town/Village.
address_countrystringBilling address country, if provided when creating card.
address_line1stringAddress line 1 (Street address/PO Box/Company name).
address_line1_checkstringIf `address_line1` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`.
address_line2stringAddress line 2 (Apartment/Suite/Unit/Building).
address_statestringState/County/Province/Region.
address_zipstringZIP or postal code.
address_zip_checkstringIf `address_zip` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`.
allow_redisplaystringThis field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”.
available_payout_methodsarray of stringA set of available payout methods for this card. Only values from this set should be passed as the `method` when creating a payout.
brand requiredstringCard brand. Can be `American Express`, `Cartes Bancaires`, `Diners Club`, `Discover`, `Eftpos Australia`, `Girocard`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`.
countrystringTwo-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
currencystringThree-letter [ISO code for currency](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. Must be a [supported currency](https://docs.stripe.com/currencies). Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available when returned as an [External Account](/api/external_account_cards/object) where [controller.is_controller](/api/accounts/object#account_object-controller-is_controller) is `true`.
customerone of multiple schemasThe customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead.
cvc_checkstringIf a CVC was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see [Check if a card is valid without a charge](https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge).
default_for_currencybooleanWhether this card is the default external account for its currency. This property is only available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts.
dynamic_last4string(For tokenized numbers only.) The last four digits of the device account number.
exp_month requiredintegerTwo-digit number representing the card's expiration month.
exp_year requiredintegerFour-digit number representing the card's expiration year.
fingerprintstringUniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*
funding requiredstringCard funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
id requiredstringUnique identifier for the object.
last4 requiredstringThe last four digits of the card.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
namestringCardholder name.
networkstoken_card_networks
object requiredstringString representing the object's type. Objects of the same type share the same value.
regulated_statusstringStatus of a card based on the card issuer.
statusstringFor external accounts that are cards, possible values are `new` and `errored`. If a payout fails, the status is set to `errored` and [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) are stopped until account details are updated.
tokenization_methodstringIf the card number is tokenized, this is the method that was used. Can be `android_pay` (includes Google Pay), `apple_pay`, `masterpass`, `visa_checkout`, or null.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers/{customer}/cards/{id}

Update a card

Update a specified source for a given customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring
idpathstring
FieldTypeDescription
account_holder_namestringThe name of the person or business that owns the bank account.
account_holder_typestringThe type of entity that holds the account. This can be either `individual` or `company`.
address_citystringCity/District/Suburb/Town/Village.
address_countrystringBilling address country, if provided when creating card.
address_line1stringAddress line 1 (Street address/PO Box/Company name).
address_line2stringAddress line 2 (Apartment/Suite/Unit/Building).
address_statestringState/County/Province/Region.
address_zipstringZIP or postal code.
exp_monthstringTwo digit number representing the card’s expiration month.
exp_yearstringFour digit number representing the card’s expiration year.
expandarray of stringSpecifies which fields in the response should be expanded.
metadataone of multiple schemasSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
namestringCardholder name.
ownerobject

Responses

HTTP 200: Successful response.

one of multiple schemas. See the OpenAPI specification for the complete schema.

HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/cash_balance_transactions/{transaction}

Retrieve a cash balance transaction

Retrieves a specific cash balance transaction, which updated the customer’s cash balance.

Request parameters

ParameterLocationTypeDescription
customerpathstring
expandqueryarray of stringSpecifies which fields in the response should be expanded.
transactionpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
adjusted_for_overdraftcustomer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft
applied_to_paymentcustomer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
customer requiredone of multiple schemasThe customer whose available cash balance changed as a result of this transaction.
customer_accountstringThe ID of an Account representing a customer whose available cash balance changed as a result of this transaction.
ending_balance requiredintegerThe total available cash balance for the specified currency after this transaction was applied. Represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
fundedcustomer_balance_resource_cash_balance_transaction_resource_funded_transaction
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
net_amount requiredintegerThe amount by which the cash balance changed, represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). A positive value represents funds being added to the cash balance, a negative value represents funds being removed from the cash balance.
object requiredstringString representing the object's type. Objects of the same type share the same value.
refunded_from_paymentcustomer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction
transferred_to_balancecustomer_balance_resource_cash_balance_transaction_resource_transferred_to_balance
type requiredstringThe type of the cash balance transaction. New types may be added in future. See [Customer Balance](https://docs.stripe.com/payments/customer-balance#types) to learn more about these types.
unapplied_from_paymentcustomer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/payment_methods/{payment_method}

Retrieve a Customer's PaymentMethod

Retrieves a PaymentMethod object for a given Customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring
expandqueryarray of stringSpecifies which fields in the response should be expanded.
payment_methodpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
acss_debitpayment_method_acss_debit
affirmpayment_method_affirm
afterpay_clearpaypayment_method_afterpay_clearpay
alipaypayment_flows_private_payment_methods_alipay
allow_redisplaystringThis field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”.
almapayment_method_alma
amazon_paypayment_method_amazon_pay
au_becs_debitpayment_method_au_becs_debit
bacs_debitpayment_method_bacs_debit
bancontactpayment_method_bancontact
billiepayment_method_billie
billing_details requiredbilling_details
bizumpayment_method_bizum
blikpayment_method_blik
boletopayment_method_boleto
cardpayment_method_card
card_presentpayment_method_card_present
cashapppayment_method_cashapp
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
cryptopayment_method_crypto
custompayment_method_custom
customerone of multiple schemasThe ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer.
customer_accountstring
customer_balancepayment_method_customer_balance
epspayment_method_eps
fpxpayment_method_fpx
giropaypayment_method_giropay
grabpaypayment_method_grabpay
id requiredstringUnique identifier for the object.
idealpayment_method_ideal
interac_presentpayment_method_interac_present
kakao_paypayment_method_kakao_pay
klarnapayment_method_klarna
konbinipayment_method_konbini
kr_cardpayment_method_kr_card
linkpayment_method_link
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
mb_waypayment_method_mb_way
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
mobilepaypayment_method_mobilepay
multibancopayment_method_multibanco
naver_paypayment_method_naver_pay
nz_bank_accountpayment_method_nz_bank_account
object requiredstringString representing the object's type. Objects of the same type share the same value.
oxxopayment_method_oxxo
p24payment_method_p24
pay_by_bankpayment_method_pay_by_bank
paycopayment_method_payco
paynowpayment_method_paynow
paypalpayment_method_paypal
paytopayment_method_payto
pixpayment_method_pix
promptpaypayment_method_promptpay
radar_optionsradar_radar_options
revolut_paypayment_method_revolut_pay
samsung_paypayment_method_samsung_pay
satispaypayment_method_satispay
scalapaypayment_method_scalapay
sepa_debitpayment_method_sepa_debit
sofortpayment_method_sofort
sunbitpayment_method_sunbit
swishpayment_method_swish
twintpayment_method_twint
type requiredstringThe type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
upipayment_method_upi
us_bank_accountpayment_method_us_bank_account
wechat_paypayment_method_wechat_pay
zippayment_method_zip
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
DELETE /v1/customers/{customer}/sources/{id}

Delete a customer source

Delete a specified source for a given customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring
idpathstring
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.

one of multiple schemas. See the OpenAPI specification for the complete schema.

HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/sources/{id}

/v1/customers/{customer}/sources/{id}

Retrieve a specified source for a given customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring
expandqueryarray of stringSpecifies which fields in the response should be expanded.
idpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.

one of multiple schemas. See the OpenAPI specification for the complete schema.

HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers/{customer}/sources/{id}

Update a card

Update a specified source for a given customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring
idpathstring
FieldTypeDescription
account_holder_namestringThe name of the person or business that owns the bank account.
account_holder_typestringThe type of entity that holds the account. This can be either `individual` or `company`.
address_citystringCity/District/Suburb/Town/Village.
address_countrystringBilling address country, if provided when creating card.
address_line1stringAddress line 1 (Street address/PO Box/Company name).
address_line2stringAddress line 2 (Apartment/Suite/Unit/Building).
address_statestringState/County/Province/Region.
address_zipstringZIP or postal code.
exp_monthstringTwo digit number representing the card’s expiration month.
exp_yearstringFour digit number representing the card’s expiration year.
expandarray of stringSpecifies which fields in the response should be expanded.
metadataone of multiple schemasSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
namestringCardholder name.
ownerobject

Responses

HTTP 200: Successful response.

one of multiple schemas. See the OpenAPI specification for the complete schema.

HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers/{customer}/sources/{id}/verify

Verify a bank account

Verify a specified bank account for a given customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring
idpathstring
FieldTypeDescription
amountsarray of integerTwo positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.
FieldTypeDescription
accountone of multiple schemasThe account this bank account belongs to. Only applicable on Accounts (not customers or recipients) This property is only available when returned as an [External Account](/api/external_account_bank_accounts/object) where [controller.is_controller](/api/accounts/object#account_object-controller-is_controller) is `true`.
account_holder_namestringThe name of the person or business that owns the bank account.
account_holder_typestringThe type of entity that holds the account. This can be either `individual` or `company`.
account_typestringThe bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`.
available_payout_methodsarray of stringA set of available payout methods for this bank account. Only values from this set should be passed as the `method` when creating a payout.
bank_namestringName of the bank associated with the routing number (e.g., `WELLS FARGO`).
country requiredstringTwo-letter ISO code representing the country the bank account is located in.
currency requiredstringThree-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account.
customerone of multiple schemasThe ID of the customer that the bank account is associated with.
default_for_currencybooleanWhether this bank account is the default external account for its currency.
fingerprintstringUniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
future_requirementsone of multiple schemasInformation about the [upcoming new requirements for the bank account](https://docs.stripe.com/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when.
id requiredstringUnique identifier for the object.
last4 requiredstringThe last four digits of the bank account number.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
object requiredstringString representing the object's type. Objects of the same type share the same value.
requirementsone of multiple schemasInformation about the requirements for the bank account, including what information needs to be collected.
routing_numberstringThe routing transit number for the bank account.
status requiredstringFor bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, `tokenized_account_number_deactivated` or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If the status is `tokenized_account_number_deactivated`, the account utilizes a tokenized account number which has been deactivated due to expiration or revocation. This account will need to be reverified to continue using it for money movement. If a payout sent to this bank account fails, we'll set the status to `errored` and will not continue to send [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) until the bank details are updated. For external accounts, possible values are `new`, `errored`, `verification_failed`, and `tokenized_account_number_deactivated`. If a payout fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. In the US and India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
DELETE /v1/customers/{customer}/subscriptions/{subscription_exposed_id}

Cancel a subscription

Cancels a customer’s subscription. If you set the at_period_end parameter to true, the subscription will remain active until the end of the period, at which point it will be canceled and not renewed. Otherwise, with the default false value, the subscription is terminated immediately. In either case, the customer will not be charged again for the subscription. Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.

Request parameters

ParameterLocationTypeDescription
customerpathstring
subscription_exposed_idpathstring
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.
invoice_nowbooleanCan be set to `true` if `at_period_end` is not set to `true`. Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items.
proratebooleanCan be set to `true` if `at_period_end` is not set to `true`. Will generate a proration invoice item that credits remaining unused time until the subscription period end.

Responses

HTTP 200: Successful response.
FieldTypeDescription
applicationone of multiple schemasID of the Connect Application that created the subscription.
application_fee_percentnumberA non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account.
automatic_tax requiredsubscription_automatic_tax
billing_cycle_anchor requiredintegerThe reference point that aligns future [billing cycle](https://docs.stripe.com/subscriptions/billing-cycle) dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. The timestamp is in UTC format.
billing_cycle_anchor_configone of multiple schemasThe fixed values used to calculate the `billing_cycle_anchor`.
billing_mode requiredsubscriptions_resource_billing_mode
billing_schedules requiredarray of subscriptions_resource_billing_schedulesBilling schedules for this subscription.
billing_thresholdsone of multiple schemasDefine thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
cancel_atintegerA date in the future at which the subscription will automatically get canceled
cancel_at_period_end requiredbooleanWhether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period.
canceled_atintegerIf the subscription has been canceled, the date of that cancellation. If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
cancellation_detailsone of multiple schemasDetails about why this subscription was cancelled
collection_method requiredstringEither `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
customer requiredone of multiple schemasID of the customer who owns the subscription.
customer_accountstringID of the account representing the customer who owns the subscription.
days_until_dueintegerNumber of days a customer has to pay invoices generated by this subscription. This value will be `null` for subscriptions where `collection_method=charge_automatically`.
default_payment_methodone of multiple schemasID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://docs.stripe.com/api/customers/object#customer_object-default_source).
default_sourceone of multiple schemasID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://docs.stripe.com/api/customers/object#customer_object-default_source).
default_tax_ratesarray of tax_rateThe tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription.
descriptionstringThe subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
discounts requiredarray of one of multiple schemasThe discounts applied to the subscription. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount.
ended_atintegerIf the subscription has ended, the date the subscription ended.
id requiredstringUnique identifier for the object.
invoice_settings requiredsubscriptions_resource_subscription_invoice_settings
items requiredobjectList of subscription items, each with an attached price.
latest_invoiceone of multiple schemasThe most recent invoice this subscription has generated over its lifecycle (for example, when it cycles or is updated).
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
managed_paymentsone of multiple schemasSettings for Managed Payments for this Subscription and resulting [Invoices](/api/invoices/object) and [PaymentIntents](/api/payment_intents/object).
metadata requiredobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
next_pending_invoice_item_invoiceintegerSpecifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
on_behalf_ofone of multiple schemasThe account (if any) the charge was made on behalf of for charges associated with this subscription. See the [Connect documentation](https://docs.stripe.com/connect/subscriptions#on-behalf-of) for details.
pause_collectionone of multiple schemasIf specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://docs.stripe.com/billing/subscriptions/pause-payment).
payment_settingsone of multiple schemasPayment settings passed on to invoices created by the subscription.
pending_invoice_item_intervalone of multiple schemasSpecifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](/api/invoices/create) for the given subscription at the specified interval.
pending_setup_intentone of multiple schemasYou can use this [SetupIntent](https://docs.stripe.com/api/setup_intents) to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the [SCA Migration Guide](https://docs.stripe.com/billing/migration/strong-customer-authentication#scenario-2).
pending_updateone of multiple schemasIf specified, [pending updates](https://docs.stripe.com/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid.
presentment_detailssubscriptions_resource_subscription_presentment_details
scheduleone of multiple schemasThe schedule attached to the subscription
start_date requiredintegerDate when the subscription was first created. The date might differ from the `created` date due to backdating.
status requiredstringPossible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, `unpaid`, or `paused`. For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this status can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` status. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a terminal status, the open invoice will be voided and no further invoices will be generated. A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. A subscription can only enter a `paused` status [when a trial ends without a payment method](https://docs.stripe.com/billing/subscriptions/trials#create-free-trials-without-payment). A `paused` subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The `paused` status is different from [pausing collection](https://docs.stripe.com/billing/subscriptions/pause-payment), which still generates invoices and leaves the subscription's status unchanged. If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.
test_clockone of multiple schemasID of the test clock this subscription belongs to.
transfer_dataone of multiple schemasThe account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
trial_endintegerIf the subscription has a trial, the end of that trial.
trial_settingsone of multiple schemasSettings related to subscription trials.
trial_startintegerIf the subscription has a trial, the beginning of that trial.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/subscriptions/{subscription_exposed_id}

Retrieve a subscription

Retrieves the subscription with the given ID.

Request parameters

ParameterLocationTypeDescription
customerpathstring
expandqueryarray of stringSpecifies which fields in the response should be expanded.
subscription_exposed_idpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
applicationone of multiple schemasID of the Connect Application that created the subscription.
application_fee_percentnumberA non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account.
automatic_tax requiredsubscription_automatic_tax
billing_cycle_anchor requiredintegerThe reference point that aligns future [billing cycle](https://docs.stripe.com/subscriptions/billing-cycle) dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. The timestamp is in UTC format.
billing_cycle_anchor_configone of multiple schemasThe fixed values used to calculate the `billing_cycle_anchor`.
billing_mode requiredsubscriptions_resource_billing_mode
billing_schedules requiredarray of subscriptions_resource_billing_schedulesBilling schedules for this subscription.
billing_thresholdsone of multiple schemasDefine thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
cancel_atintegerA date in the future at which the subscription will automatically get canceled
cancel_at_period_end requiredbooleanWhether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period.
canceled_atintegerIf the subscription has been canceled, the date of that cancellation. If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
cancellation_detailsone of multiple schemasDetails about why this subscription was cancelled
collection_method requiredstringEither `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
customer requiredone of multiple schemasID of the customer who owns the subscription.
customer_accountstringID of the account representing the customer who owns the subscription.
days_until_dueintegerNumber of days a customer has to pay invoices generated by this subscription. This value will be `null` for subscriptions where `collection_method=charge_automatically`.
default_payment_methodone of multiple schemasID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://docs.stripe.com/api/customers/object#customer_object-default_source).
default_sourceone of multiple schemasID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://docs.stripe.com/api/customers/object#customer_object-default_source).
default_tax_ratesarray of tax_rateThe tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription.
descriptionstringThe subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
discounts requiredarray of one of multiple schemasThe discounts applied to the subscription. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount.
ended_atintegerIf the subscription has ended, the date the subscription ended.
id requiredstringUnique identifier for the object.
invoice_settings requiredsubscriptions_resource_subscription_invoice_settings
items requiredobjectList of subscription items, each with an attached price.
latest_invoiceone of multiple schemasThe most recent invoice this subscription has generated over its lifecycle (for example, when it cycles or is updated).
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
managed_paymentsone of multiple schemasSettings for Managed Payments for this Subscription and resulting [Invoices](/api/invoices/object) and [PaymentIntents](/api/payment_intents/object).
metadata requiredobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
next_pending_invoice_item_invoiceintegerSpecifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
on_behalf_ofone of multiple schemasThe account (if any) the charge was made on behalf of for charges associated with this subscription. See the [Connect documentation](https://docs.stripe.com/connect/subscriptions#on-behalf-of) for details.
pause_collectionone of multiple schemasIf specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://docs.stripe.com/billing/subscriptions/pause-payment).
payment_settingsone of multiple schemasPayment settings passed on to invoices created by the subscription.
pending_invoice_item_intervalone of multiple schemasSpecifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](/api/invoices/create) for the given subscription at the specified interval.
pending_setup_intentone of multiple schemasYou can use this [SetupIntent](https://docs.stripe.com/api/setup_intents) to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the [SCA Migration Guide](https://docs.stripe.com/billing/migration/strong-customer-authentication#scenario-2).
pending_updateone of multiple schemasIf specified, [pending updates](https://docs.stripe.com/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid.
presentment_detailssubscriptions_resource_subscription_presentment_details
scheduleone of multiple schemasThe schedule attached to the subscription
start_date requiredintegerDate when the subscription was first created. The date might differ from the `created` date due to backdating.
status requiredstringPossible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, `unpaid`, or `paused`. For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this status can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` status. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a terminal status, the open invoice will be voided and no further invoices will be generated. A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. A subscription can only enter a `paused` status [when a trial ends without a payment method](https://docs.stripe.com/billing/subscriptions/trials#create-free-trials-without-payment). A `paused` subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The `paused` status is different from [pausing collection](https://docs.stripe.com/billing/subscriptions/pause-payment), which still generates invoices and leaves the subscription's status unchanged. If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.
test_clockone of multiple schemasID of the test clock this subscription belongs to.
transfer_dataone of multiple schemasThe account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
trial_endintegerIf the subscription has a trial, the end of that trial.
trial_settingsone of multiple schemasSettings related to subscription trials.
trial_startintegerIf the subscription has a trial, the beginning of that trial.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/customers/{customer}/subscriptions/{subscription_exposed_id}

Update a subscription on a customer

Updates an existing subscription on a customer to match the specified parameters. When changing plans or quantities, we will optionally prorate the price we charge next month to make up for any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint.

Request parameters

ParameterLocationTypeDescription
customerpathstring
subscription_exposed_idpathstring
FieldTypeDescription
add_invoice_itemsarray of objectA list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items.
application_fee_percentone of multiple schemasA non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
automatic_taxobjectAutomatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed.
billing_cycle_anchorstringEither `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time. For more information, see the billing cycle [documentation](https://docs.stripe.com/billing/subscriptions/billing-cycle).
billing_thresholdsone of multiple schemasDefine thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
cancel_atone of multiple schemasA timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
cancel_at_period_endbooleanIndicate whether this subscription should cancel at the end of the current period (`current_period_end`).
cancellation_detailsobjectDetails about why this subscription was cancelled
collection_methodstringEither `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`.
days_until_dueintegerNumber of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`.
default_payment_methodstringID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://docs.stripe.com/api/customers/object#customer_object-default_source).
default_sourceone of multiple schemasID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://docs.stripe.com/api/customers/object#customer_object-default_source).
default_tax_ratesone of multiple schemasThe tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. Pass an empty string to remove previously-defined tax rates.
discountsone of multiple schemasThe coupons to redeem into discounts for the subscription. A populated array overwrites the existing discounts on the subscription. If not specified or empty array, it leaves the subscription's discounts unchanged. If empty string, it clears the subscription's discounts.
expandarray of stringSpecifies which fields in the response should be expanded.
invoice_settingsobjectAll invoices will be billed using the specified settings.
itemsarray of objectA list of up to 20 subscription items, each with an attached price.
metadataone of multiple schemasSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
off_sessionbooleanIndicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `false` (on-session).
pause_collectionone of multiple schemasIf specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://docs.stripe.com/billing/subscriptions/pause-payment).
payment_behaviorstringControls how Stripe handles payment when a subscription update requires payment and `collection_method=charge_automatically`.
payment_settingsobjectPayment settings to pass to invoices created by the subscription.
pending_invoice_item_intervalone of multiple schemasSpecifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](/api/invoices/create) for the given subscription at the specified interval.
proration_behaviorstringDetermines how to handle [prorations](https://docs.stripe.com/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`.
proration_dateintegerIf set, prorations will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same prorations that were previewed with the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint. `proration_date` can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations.
transfer_dataone of multiple schemasIf specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. This will be unset if you POST an empty value.
trial_endone of multiple schemasUnix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`.
trial_from_planbooleanIndicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials) to learn more.
trial_settingsobjectSettings related to subscription trials.

Responses

HTTP 200: Successful response.
FieldTypeDescription
applicationone of multiple schemasID of the Connect Application that created the subscription.
application_fee_percentnumberA non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account.
automatic_tax requiredsubscription_automatic_tax
billing_cycle_anchor requiredintegerThe reference point that aligns future [billing cycle](https://docs.stripe.com/subscriptions/billing-cycle) dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. The timestamp is in UTC format.
billing_cycle_anchor_configone of multiple schemasThe fixed values used to calculate the `billing_cycle_anchor`.
billing_mode requiredsubscriptions_resource_billing_mode
billing_schedules requiredarray of subscriptions_resource_billing_schedulesBilling schedules for this subscription.
billing_thresholdsone of multiple schemasDefine thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
cancel_atintegerA date in the future at which the subscription will automatically get canceled
cancel_at_period_end requiredbooleanWhether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period.
canceled_atintegerIf the subscription has been canceled, the date of that cancellation. If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
cancellation_detailsone of multiple schemasDetails about why this subscription was cancelled
collection_method requiredstringEither `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
customer requiredone of multiple schemasID of the customer who owns the subscription.
customer_accountstringID of the account representing the customer who owns the subscription.
days_until_dueintegerNumber of days a customer has to pay invoices generated by this subscription. This value will be `null` for subscriptions where `collection_method=charge_automatically`.
default_payment_methodone of multiple schemasID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://docs.stripe.com/api/customers/object#customer_object-default_source).
default_sourceone of multiple schemasID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://docs.stripe.com/api/customers/object#customer_object-default_source).
default_tax_ratesarray of tax_rateThe tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription.
descriptionstringThe subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
discounts requiredarray of one of multiple schemasThe discounts applied to the subscription. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount.
ended_atintegerIf the subscription has ended, the date the subscription ended.
id requiredstringUnique identifier for the object.
invoice_settings requiredsubscriptions_resource_subscription_invoice_settings
items requiredobjectList of subscription items, each with an attached price.
latest_invoiceone of multiple schemasThe most recent invoice this subscription has generated over its lifecycle (for example, when it cycles or is updated).
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
managed_paymentsone of multiple schemasSettings for Managed Payments for this Subscription and resulting [Invoices](/api/invoices/object) and [PaymentIntents](/api/payment_intents/object).
metadata requiredobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
next_pending_invoice_item_invoiceintegerSpecifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
on_behalf_ofone of multiple schemasThe account (if any) the charge was made on behalf of for charges associated with this subscription. See the [Connect documentation](https://docs.stripe.com/connect/subscriptions#on-behalf-of) for details.
pause_collectionone of multiple schemasIf specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://docs.stripe.com/billing/subscriptions/pause-payment).
payment_settingsone of multiple schemasPayment settings passed on to invoices created by the subscription.
pending_invoice_item_intervalone of multiple schemasSpecifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](/api/invoices/create) for the given subscription at the specified interval.
pending_setup_intentone of multiple schemasYou can use this [SetupIntent](https://docs.stripe.com/api/setup_intents) to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the [SCA Migration Guide](https://docs.stripe.com/billing/migration/strong-customer-authentication#scenario-2).
pending_updateone of multiple schemasIf specified, [pending updates](https://docs.stripe.com/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid.
presentment_detailssubscriptions_resource_subscription_presentment_details
scheduleone of multiple schemasThe schedule attached to the subscription
start_date requiredintegerDate when the subscription was first created. The date might differ from the `created` date due to backdating.
status requiredstringPossible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, `unpaid`, or `paused`. For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this status can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` status. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a terminal status, the open invoice will be voided and no further invoices will be generated. A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. A subscription can only enter a `paused` status [when a trial ends without a payment method](https://docs.stripe.com/billing/subscriptions/trials#create-free-trials-without-payment). A `paused` subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The `paused` status is different from [pausing collection](https://docs.stripe.com/billing/subscriptions/pause-payment), which still generates invoices and leaves the subscription's status unchanged. If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.
test_clockone of multiple schemasID of the test clock this subscription belongs to.
transfer_dataone of multiple schemasThe account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
trial_endintegerIf the subscription has a trial, the end of that trial.
trial_settingsone of multiple schemasSettings related to subscription trials.
trial_startintegerIf the subscription has a trial, the beginning of that trial.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
DELETE /v1/customers/{customer}/subscriptions/{subscription_exposed_id}/discount

Delete a customer discount

Removes the currently applied discount on a customer.

Request parameters

ParameterLocationTypeDescription
customerpathstring
subscription_exposed_idpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
checkout_sessionstringThe Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Not present for subscription mode.
customerone of multiple schemasThe ID of the customer associated with this discount.
customer_accountstringThe ID of the account representing the customer associated with this discount.
deleted requiredbooleanAlways true for a deleted object
id requiredstringThe 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.
invoicestringThe invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.
invoice_itemstringThe 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.
object requiredstringString representing the object's type. Objects of the same type share the same value.
promotion_codeone of multiple schemasThe promotion code applied to create this discount.
source requireddiscount_source
start requiredintegerDate that the coupon was applied.
subscriptionstringThe subscription that this coupon is applied to, if it is applied to a particular subscription.
subscription_itemstringThe subscription item that this coupon is applied to, if it is applied to a particular subscription item.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/subscriptions/{subscription_exposed_id}/discount

/v1/customers/{customer}/subscriptions/{subscription_exposed_id}/discount

Request parameters

ParameterLocationTypeDescription
customerpathstring
expandqueryarray of stringSpecifies which fields in the response should be expanded.
subscription_exposed_idpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
checkout_sessionstringThe Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Not present for subscription mode.
customerone of multiple schemasThe ID of the customer associated with this discount.
customer_accountstringThe ID of the account representing the customer associated with this discount.
endintegerIf 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.
id requiredstringThe 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.
invoicestringThe invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.
invoice_itemstringThe 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.
object requiredstringString representing the object's type. Objects of the same type share the same value.
promotion_codeone of multiple schemasThe promotion code applied to create this discount.
source requireddiscount_source
start requiredintegerDate that the coupon was applied.
subscriptionstringThe subscription that this coupon is applied to, if it is applied to a particular subscription.
subscription_itemstringThe subscription item that this coupon is applied to, if it is applied to a particular subscription item.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
DELETE /v1/customers/{customer}/tax_ids/{id}

Delete a Customer tax ID

Deletes an existing tax_id object.

Request parameters

ParameterLocationTypeDescription
customerpathstring
idpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
deleted requiredbooleanAlways true for a deleted object
id requiredstringUnique identifier for the object.
object requiredstringString representing the object's type. Objects of the same type share the same value.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/customers/{customer}/tax_ids/{id}

Retrieve a Customer tax ID

Retrieves the tax_id object with the given identifier.

Request parameters

ParameterLocationTypeDescription
customerpathstring
expandqueryarray of stringSpecifies which fields in the response should be expanded.
idpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
countrystringTwo-letter ISO code representing the country of the tax ID.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customerone of multiple schemasID of the customer.
customer_accountstringID of the Account representing the customer.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
ownerone of multiple schemasThe account or customer the tax ID belongs to.
type requiredstringType of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `ic_nif`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`. Note that some legacy tax IDs have type `unknown`
value requiredstringValue of the tax ID.
verificationone of multiple schemasTax ID verification information.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors