Attributes

  • idstring

    Unique identifier for the object.

  • billing_detailsmap

    Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.

  • customernullable stringExpandable

    The 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.

  • metadatanullable map

    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.

  • typeenum

    The 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.

    Possible enum values
    acss_debit

    Pre-authorized debit payments are used to debit Canadian bank accounts through the Automated Clearing Settlement System (ACSS).

    affirm

    Affirm is a buy now, pay later payment method in the US.

    afterpay_clearpay

    Afterpay / Clearpay is a buy now, pay later payment method used in Australia, Canada, France, New Zealand, Spain, the UK, and the US.

    alipay

    Alipay is a digital wallet payment method used in China.

    alma

    Alma is a Buy Now, Pay Later payment method that lets customers pay in 2, 3, or 4 installments.

    amazon_pay

    Amazon Pay is a Wallet payment method that lets hundreds of millions of Amazon customers pay their way, every day.

    au_becs_debit

    BECS Direct Debit is used to debit Australian bank accounts through the Bulk Electronic Clearing System (BECS).

    bacs_debit

    Bacs Direct Debit is used to debit UK bank accounts.

    bancontact

    Bancontact is a bank redirect payment method used in Belgium.

    billie

    Billie is a payment method.

    Show 79 more

More attributes

  • objectstring

  • acss_debitnullable map

  • affirmnullable map

  • afterpay_clearpaynullable map

  • alipaynullable map

  • allow_redisplaynullable enum

  • almanullable map

  • amazon_paynullable map

  • au_becs_debitnullable map

  • bacs_debitnullable map

  • bancontactnullable map

  • billienullable map

  • bliknullable map

  • boletonullable map

  • cardnullable map

  • card_presentnullable map

  • cashappnullable map

  • createdtimestamp

  • customer_balancenullable map

  • epsnullable map

  • fpxnullable map

  • giropaynullable map

  • grabpaynullable map

  • idealnullable map

  • interac_presentnullable mapPreview feature

  • kakao_paynullable map

  • klarnanullable map

  • konbininullable map

  • kr_cardnullable map

  • linknullable map

  • livemodeboolean

  • mobilepaynullable map

  • multibanconullable map

  • naver_paynullable map

  • nz_bank_accountnullable map

  • oxxonullable map

  • p24nullable map

  • pay_by_banknullable mapPreview feature

  • payconullable map

  • paynownullable map

  • paypalnullable map

  • pixnullable map

  • promptpaynullable map

  • radar_optionsnullable map

  • revolut_paynullable map

  • samsung_paynullable map

  • satispaynullable map

  • sepa_debitnullable map

  • sofortnullable map

  • swishnullable map

  • twintnullable map

  • us_bank_accountnullable map

  • wechat_paynullable map

  • zipnullable map

The PaymentMethod object
{
"id": "pm_1Q0PsIJvEtkwdCNYMSaVuRz6",
"object": "payment_method",
"allow_redisplay": "unspecified",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": "John Doe",
"phone": null
},
"created": 1726673582,
"customer": null,
"livemode": false,
"metadata": {},
"type": "us_bank_account",
"us_bank_account": {
"account_holder_type": "individual",
"account_type": "checking",
"bank_name": "STRIPE TEST BANK",
"financial_connections_account": null,
"fingerprint": "LstWJFsCK7P349Bg",
"last4": "6789",
"networks": {
"preferred": "ach",
"supported": [
"ach"
]
},
"routing_number": "110000000",
"status_details": {}
}
}

Creates a PaymentMethod object. Read the Stripe.js reference to learn how to create PaymentMethods via Stripe.js.

Instead of creating a PaymentMethod directly, we recommend using the PaymentIntents API to accept a payment immediately or the SetupIntent API to collect payment method details ahead of a future payment.

Parameters

  • typeenumRequired

    The 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.

    Possible enum values
    acss_debit

    Pre-authorized debit payments are used to debit Canadian bank accounts through the Automated Clearing Settlement System (ACSS).

    affirm

    Affirm is a buy now, pay later payment method in the US.

    afterpay_clearpay

    Afterpay / Clearpay is a buy now, pay later payment method used in Australia, Canada, France, New Zealand, Spain, the UK, and the US.

    alipay

    Alipay is a digital wallet payment method used in China.

    alma

    Alma is a Buy Now, Pay Later payment method that lets customers pay in 2, 3, or 4 installments.

    amazon_pay

    Amazon Pay is a Wallet payment method that lets hundreds of millions of Amazon customers pay their way, every day.

    au_becs_debit

    BECS Direct Debit is used to debit Australian bank accounts through the Bulk Electronic Clearing System (BECS).

    bacs_debit

    Bacs Direct Debit is used to debit UK bank accounts.

    bancontact

    Bancontact is a bank redirect payment method used in Belgium.

    billie

    Billie is a payment method.

    Show 78 more
  • billing_detailsmap

    Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.

  • 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

  • acss_debitmap

  • affirmmap

  • afterpay_clearpaymap

  • alipaymap

  • allow_redisplayenum

  • almamap

  • amazon_paymap

  • au_becs_debitmap

  • bacs_debitmap

  • bancontactmap

  • billiemap

  • blikmap

  • boletomap

  • cardmap

  • cashappmap

  • customer_balancemap

  • epsmap

  • fpxmap

  • giropaymap

  • grabpaymap

  • idealmap

  • interac_presentmapPreview feature

  • kakao_paymap

  • klarnamap

  • konbinimap

  • kr_cardmap

  • linkmap

  • mobilepaymap

  • multibancomap

  • naver_paymap

  • nz_bank_accountmap

  • oxxomap

  • p24map

  • pay_by_bankmapPreview feature

  • paycomap

  • paynowmap

  • paypalmap

  • pixmap

  • promptpaymap

  • radar_optionsmap

  • revolut_paymap

  • samsung_paymap

  • satispaymap

  • sepa_debitmap

  • sofortmap

  • swishmap

  • twintmap

  • us_bank_accountmap

  • wechat_paymap

  • zipmap

Returns

Returns a PaymentMethod object.

POST /v1/payment_methods
stripe.Key = "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2"
params := &stripe.PaymentMethodParams{
Type: stripe.String(string(stripe.PaymentMethodTypeUSBankAccount)),
USBankAccount: &stripe.PaymentMethodUSBankAccountParams{
AccountHolderType: stripe.String(string(stripe.PaymentMethodUSBankAccountAccountHolderTypeIndividual)),
AccountNumber: stripe.String("000123456789"),
RoutingNumber: stripe.String("110000000"),
},
BillingDetails: &stripe.PaymentMethodBillingDetailsParams{
Name: stripe.String("John Doe"),
},
};
result, err := paymentmethod.New(params);
Response
{
"id": "pm_1Q0PsIJvEtkwdCNYMSaVuRz6",
"object": "payment_method",
"allow_redisplay": "unspecified",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": "John Doe",
"phone": null
},
"created": 1726673582,
"customer": null,
"livemode": false,
"metadata": {},
"type": "us_bank_account",
"us_bank_account": {
"account_holder_type": "individual",
"account_type": "checking",
"bank_name": "STRIPE TEST BANK",
"financial_connections_account": null,
"fingerprint": "LstWJFsCK7P349Bg",
"last4": "6789",
"networks": {
"preferred": "ach",
"supported": [
"ach"
]
},
"routing_number": "110000000",
"status_details": {}
}
}

Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.

Parameters

  • billing_detailsmap

    Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.

  • 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

  • allow_redisplayenum

  • cardmap

  • linkmap

  • pay_by_bankmapPreview feature

  • us_bank_accountmap

Returns

Returns a PaymentMethod object.

POST /v1/payment_methods/:id
stripe.Key = "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2"
params := &stripe.PaymentMethodParams{};
params.AddMetadata("order_id", "6735")
result, err := paymentmethod.Update("pm_1Q0PsIJvEtkwdCNYMSaVuRz6", params);
Response
{
"id": "pm_1Q0PsIJvEtkwdCNYMSaVuRz6",
"object": "payment_method",
"allow_redisplay": "unspecified",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": "John Doe",
"phone": null
},
"created": 1726673582,
"customer": null,
"livemode": false,
"metadata": {
"order_id": "6735"
},
"type": "us_bank_account",
"us_bank_account": {
"account_holder_type": "individual",
"account_type": "checking",
"bank_name": "STRIPE TEST BANK",
"financial_connections_account": null,
"fingerprint": "LstWJFsCK7P349Bg",
"last4": "6789",
"networks": {
"preferred": "ach",
"supported": [
"ach"
]
},
"routing_number": "110000000",
"status_details": {}
}
}

Retrieves a PaymentMethod object for a given Customer.

Parameters

No parameters.

Returns

Returns a PaymentMethod object.

GET /v1/customers/:id/payment_methods/:id
stripe.Key = "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2"
params := &stripe.CustomerRetrievePaymentMethodParams{
Customer: stripe.String("cus_9s6XKzkNRiz8i3"),
};
result, err := customer.RetrievePaymentMethod("pm_1NVChw2eZvKYlo2CHxiM5E2E", params);
Response
{
"id": "pm_1NVChw2eZvKYlo2CHxiM5E2E",
"object": "payment_method",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": null,
"phone": null
},
"card": {
"brand": "visa",
"checks": {
"address_line1_check": null,
"address_postal_code_check": null,
"cvc_check": "pass"
},
"country": "US",
"exp_month": 12,
"exp_year": 2034,
"fingerprint": "Xt5EWLLDS7FJjR1c",
"funding": "credit",
"generated_from": null,
"last4": "4242",
"networks": {
"available": [
"visa"
],
"preferred": null
},
"three_d_secure_usage": {
"supported": true
},
"wallet": null
},
"created": 1689682128,
"customer": "cus_9s6XKzkNRiz8i3",
"livemode": false,
"metadata": {},
"redaction": null,
"type": "card"
}

Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use Retrieve a Customer’s PaymentMethods

Parameters

No parameters.

Returns

Returns a PaymentMethod object.

GET /v1/payment_methods/:id
stripe.Key = "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2"
params := &stripe.PaymentMethodParams{};
result, err := paymentmethod.Get("pm_1Q0PsIJvEtkwdCNYMSaVuRz6", params);
Response
{
"id": "pm_1Q0PsIJvEtkwdCNYMSaVuRz6",
"object": "payment_method",
"allow_redisplay": "unspecified",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": "John Doe",
"phone": null
},
"created": 1726673582,
"customer": null,
"livemode": false,
"metadata": {},
"type": "us_bank_account",
"us_bank_account": {
"account_holder_type": "individual",
"account_type": "checking",
"bank_name": "STRIPE TEST BANK",
"financial_connections_account": null,
"fingerprint": "LstWJFsCK7P349Bg",
"last4": "6789",
"networks": {
"preferred": "ach",
"supported": [
"ach"
]
},
"routing_number": "110000000",
"status_details": {}
}
}