Payment Methods
PaymentMethod objects represent your customer’s payment instruments. You can use them with PaymentIntents to collect payments or save them to Customer objects to store instrument details for future payments.
Related guides: Payment Methods and More Payment Scenarios.
The PaymentMethod object
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.
More attributes
- objectstring
- acss_
debitnullable Map - affirmnullable Map
- afterpay_
clearpaynullable Map - alipaynullable Map
- allow_
redisplaynullable enumPreview feature - amazon_
paynullable Map - au_
becs_ debitnullable Map - bacs_
debitnullable Map - bancontactnullable 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 - klarnanullable Map
- konbininullable Map
- linknullable Map
- livemodeboolean
- mobilepaynullable Map
- oxxonullable Map
- p24nullable Map
- paynownullable Map
- paypalnullable Map
- pixnullable Map
- promptpaynullable Map
- radar_
optionsnullable Map - revolut_
paynullable Map - sepa_
debitnullable Map - sofortnullable Map
- swishnullable Map
- us_
bank_ accountnullable Map - wechat_
paynullable Map - zipnullable Map
Create a PaymentMethod
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.
- 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 - amazon_
payMap - au_
becs_ debitMap - bacs_
debitMap - bancontactMap
- blikMap
- boletoMap
- cardMap
- cashappMap
- customer_
balanceMap - epsMap
- fpxMap
- giropayMap
- grabpayMap
- idealMap
- interac_
presentMapPreview feature - klarnaMap
- konbiniMap
- linkMap
- mobilepayMap
- oxxoMap
- p24Map
- paynowMap
- paypalMap
- pixMap
- promptpayMap
- radar_
optionsMap - revolut_
payMap - sepa_
debitMap - sofortMap
- swishMap
- us_
bank_ accountMap - wechat_
payMap - zipMap
Returns
Returns a PaymentMethod object.
Update a PaymentMethod
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
- us_
bank_ accountMap
Returns
Returns a PaymentMethod object.
Retrieve a Customer's PaymentMethod
Retrieves a PaymentMethod object for a given Customer.
Parameters
No parameters.
Returns
Returns a PaymentMethod object.