provider POST /v1/customers/{customer}/sources
@utdk/stripe /v1/customers/{customer}/sources
Create a card
<p>When you create a new credit card, you must specify a customer or recipient on which to create it.</p> <p>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 <a href="/api/customers/update">update the customer</a> to have a new <code>default_source</code>.</p>
customer path required
string

Try it

Authentication
Configure credentials for Stripe API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

postcustomerscustomersources
POST/v1/customers/{customer}/sources
<p>When you create a new credit card, you must specify a customer or recipient on which to create it.</p> <p>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 <a href="/api/customers/update">update the customer</a> to have a new <code>default_source</code>.</p>

Parameters

required

Input

A token returned by [Stripe.js](https://stripe.com/docs/js) representing the user’s Alipay account details.

Either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details.

A token, like the ones returned by [Stripe.js](https://stripe.com/docs/js).

Specifies which fields in the response should be expanded.

Set 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`.

Please refer to full [documentation](https://api.stripe.com) instead.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import stripe from '@utdk/stripe';

await stripe.postcustomerscustomersources()