Versioning

When backwards-incompatible changes are made to the API, we release a new, dated version. The current version is 2023-10-16. Learn more about API upgrades and backwards compatibility. For information on all API updates, view our API changelog.

You can upgrade your API version in the Developer Dashboard. As a precaution, use API versioning to test a new API version before committing to an upgrade.

curl https://api.stripe.com/v1/charges \
-u sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc: \
-H "Stripe-Version: 2023-10-16"

Balance

This is an object representing your Stripe balance. You can retrieve it to see the balance currently on your Stripe account.

You can also retrieve the balance history, which contains a list of transactions that contributed to the balance (charges, payouts, and so forth).

The available and pending amounts for each currency are broken down further by payment source types.

Related guide: Understanding Connect account balances

Balance Transactions

Balance transactions represent funds moving through your Stripe account. Stripe creates them for every type of transaction that enters or leaves your Stripe account balance.

Related guide: Balance transaction types

Charges

The Charge object represents a single attempt to move money into your Stripe account. PaymentIntent confirmation is the most common way to create Charges, but transferring money to a different Stripe account through Connect also creates Charges. Some legacy payment flows create Charges directly, which is not recommended for new integrations.

Customers

This object represents a customer of your business. Use it to create recurring charges and track payments that belong to the same customer.

Related guide: Save a card during payment

The Customer object

Attributes

  • idstring

    Unique identifier for the object.

  • addressnullable object

    The customer’s address.

  • descriptionnullable string

    An arbitrary string attached to the object. Often useful for displaying to users.

  • emailnullable string

    The customer’s email address.

  • metadataobject

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

  • namenullable string

    The customer’s full name or business name.

  • phonenullable string

    The customer’s phone number.

  • shippingnullable object

    Mailing and shipping address for the customer. Appears on invoices emailed to this customer.

More attributes

  • objectstring

  • balanceinteger

  • cash_balancenullable objectExpandable

  • createdtimestamp

  • currencynullable string

  • default_sourcenullable stringExpandable

  • delinquentnullable boolean

  • discountnullable object

  • invoice_credit_balanceobjectExpandable

  • invoice_prefixnullable string

  • invoice_settingsobject

  • livemodeboolean

  • next_invoice_sequencenullable integer

  • preferred_localesnullable array of strings

  • sourcesnullable objectExpandable

  • subscriptionsnullable objectExpandable

  • taxobjectExpandable

  • tax_exemptnullable enum

  • tax_idsnullable objectExpandable

  • test_clocknullable stringExpandable

The Customer object
{
"id": "cus_NffrFeUfNV2Hib",
"object": "customer",
"address": null,
"balance": 0,
"created": 1680893993,
"currency": null,
"default_source": null,
"delinquent": false,
"description": null,
"discount": null,
"email": "jennyrosen@example.com",
"invoice_prefix": "0759376C",
"invoice_settings": {
"custom_fields": null,
"default_payment_method": null,
"footer": null,
"rendering_options": null
},
"livemode": false,
"metadata": {},
"name": "Jenny Rosen",
"next_invoice_sequence": 1,
"phone": null,
"preferred_locales": [],
"shipping": null,
"tax_exempt": "none",
"test_clock": null
}

Create a customer

Parameters

  • addressobject

    The customer’s address.

  • descriptionstring

    An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard.

  • emailstring

    Customer’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.

  • metadataobject

    Set of key-value pairs 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.

  • namestring

    The customer’s full name or business name.

  • payment_methodstring

    The ID of the PaymentMethod to attach to the customer.

  • phonestring

    The customer’s phone number.

  • shippingobject

    The customer’s shipping information. Appears on invoices emailed to this customer.

More parameters

  • balanceinteger

  • cash_balanceobject

  • couponstring

  • invoice_prefixstring

  • invoice_settingsobject

  • next_invoice_sequenceinteger

  • preferred_localesarray of strings

  • promotion_codestring

  • sourcestring

  • taxobject

  • tax_exemptenum

  • tax_id_dataarray of objects

  • test_clockstring

Returns

Returns the Customer object after successful customer creation. Raises an error if create parameters are invalid (for example, specifying an invalid coupon or an invalid source).

POST /v1/customers
curl https://api.stripe.com/v1/customers \
-u "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc:" \
-d name="Jenny Rosen" \
--data-urlencode email="jennyrosen@example.com"
Response
{
"id": "cus_NffrFeUfNV2Hib",
"object": "customer",
"address": null,
"balance": 0,
"created": 1680893993,
"currency": null,
"default_source": null,
"delinquent": false,
"description": null,
"discount": null,
"email": "jennyrosen@example.com",
"invoice_prefix": "0759376C",
"invoice_settings": {
"custom_fields": null,
"default_payment_method": null,
"footer": null,
"rendering_options": null
},
"livemode": false,
"metadata": {},
"name": "Jenny Rosen",
"next_invoice_sequence": 1,
"phone": null,
"preferred_locales": [],
"shipping": null,
"tax_exempt": "none",
"test_clock": null
}

Update a customer

Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer’s active source (e.g., 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 will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.

This request accepts mostly the same arguments as the customer creation call.

Parameters

  • addressobject

    The customer’s address.

  • descriptionstring

    An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard.

  • emailstring

    Customer’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.

  • metadataobject

    Set of key-value pairs 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.

  • namestring

    The customer’s full name or business name.

  • phonestring

    The customer’s phone number.

  • shippingobject

    The customer’s shipping information. Appears on invoices emailed to this customer.

More parameters

  • balanceinteger

  • cash_balanceobject

  • couponstring

  • default_sourcestring

  • invoice_prefixstring

  • invoice_settingsobject

  • next_invoice_sequenceinteger

  • preferred_localesarray of strings

  • promotion_codestring

  • sourcestring

  • taxobject

  • tax_exemptenum

Returns

Returns the customer object if the update succeeded. Raises an error if update parameters are invalid (e.g. specifying an invalid coupon or an invalid source).

POST /v1/customers/:id
curl https://api.stripe.com/v1/customers/cus_NffrFeUfNV2Hib \
-u "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc:" \
-d "metadata[order_id]"=6735
Response
{
"id": "cus_NffrFeUfNV2Hib",
"object": "customer",
"address": null,
"balance": 0,
"created": 1680893993,
"currency": null,
"default_source": null,
"delinquent": false,
"description": null,
"discount": null,
"email": "jennyrosen@example.com",
"invoice_prefix": "0759376C",
"invoice_settings": {
"custom_fields": null,
"default_payment_method": null,
"footer": null,
"rendering_options": null
},
"livemode": false,
"metadata": {
"order_id": "6735"
},
"name": "Jenny Rosen",
"next_invoice_sequence": 1,
"phone": null,
"preferred_locales": [],
"shipping": null,
"tax_exempt": "none",
"test_clock": null
}
Stripe Shell
Test mode
Welcome to the Stripe Shell! Stripe Shell is a browser-based shell with the Stripe CLI pre-installed. Log in to your Stripe account and press Control + Backtick (`) on your keyboard to start managing your Stripe resources in test mode. - View supported Stripe commands: - Find webhook events: - Listen for webhook events: - Call Stripe APIs: stripe [api resource] [operation] (e.g., )
The Stripe Shell is best experienced on desktop.
$