Create a card 

Connect
External Account Cards
Create a card

When you create a new debit card, you must specify a connected account to create it on. You can only specify connected accounts where account.controller.requirement_collection is application (includes Custom accounts).

If the account has no default destination 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 set default_for_currency to true.

Parameters

  • external_accountobject | stringRequired

    A token, like the ones returned by Stripe.js or a dictionary containing a user’s card details (with the options shown below). Stripe will automatically validate the card.

    • external_account.exp_monthintegerRequired

      Two-digit number representing the card’s expiration month.

    • external_account.exp_yearintegerRequired

      Two- or -four-digit number representing the card’s expiration year.

    • external_account.numberstringRequired

      The card number, as a string without any separators.

    • external_account.objectstringRequired

      The type of payment source. It should be card.

    • external_account.address_citystring

      City / District / Suburb / Town / Village.

    • external_account.address_countrystring

      Billing address country, if provided.

    • external_account.address_line1string

      Address line 1 (Street address / PO Box / Company name).

    • external_account.address_line2string

      Address line 2 (Apartment / Suite / Unit / Building).

    • external_account.address_statestring

      State / County / Province / Region.

    • external_account.address_zipstring

      ZIP or postal code.

    • external_account.currencystringcustom Connect only

      Required when adding a card to an account (not applicable to customers or recipients). The card (which must be a debit card) can be used as a transfer destination for funds in this currency.

    • external_account.cvcstring

      Card security code. Highly recommended to always include this value, but it’s required only for accounts based in European countries.

    • external_account.default_for_currencybooleancustom Connect only

      Applicable only on accounts (not customers or recipients). If you set this to true (or if this is the first external account being added in this currency), this card will become the default external account for its currency.

    • external_account.metadatamap

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

    • external_account.namestring

      Cardholder’s full name.

  • metadatamap

    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.

More parameters

  • default_for_currencyboolean

    When set to true, or if this is the first external account added in this currency, this account becomes the default external account for its currency.

Returns

Returns the card object

POST /v1/accounts/:id/external_accounts
stripe.Key = "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2"
params := &stripe.BankAccountParams{
Account: stripe.String("acct_1032D82eZvKYlo2C"),
Token: stripe.String("tok_visa_debit"),
}
result, _ := bankaccount.New(params)
Response
{
"id": "card_1NAiaG2eZvKYlo2CDXvcMb6m",
"object": "card",
"account": "acct_1032D82eZvKYlo2C",
"address_city": null,
"address_country": null,
"address_line1": null,
"address_line1_check": null,
"address_line2": null,
"address_state": null,
"address_zip": null,
"address_zip_check": null,
"brand": "Visa",
"country": "US",
"cvc_check": "pass",
"dynamic_last4": null,
"exp_month": 8,
"exp_year": 2024,
"fingerprint": "Xt5EWLLDS7FJjR1c",
"funding": "credit",
"last4": "4242",
"metadata": {},
"name": null,
"redaction": null,
"tokenization_method": null,
"wallet": null
}