Payment methods
The payment method object represents a customer’s payment instrument. Payment methods are automatically created when a payment is created. Create a re-usable payment method by using the payment create resource with payment_method.setup_future_usage
.
The PaymentMethod object
- Name
object
- Type
- "payment_method",
- Description
- Literal representing the object’s type.
- Name
id
- Type
- string,
- Description
- Unique identifier for the object.
- Name
live
- Type
- boolean,
- Description
- Has the value
true
if the object exists in a production environment or the valuefalse
if the object exists in a sandbox environment.
- Name
created_at
- Type
- integer,
- Description
- Time at which the object was created. Measured in milliseconds since the Unix epoch.
- Name
active
- Type
- boolean,
- Description
- Whether the payment method can be used for new payments. Has a value of
false
if the payment method has been deactivated or if it was created withoutsetup_future_usage
.
- Name
billing_details
- Type
- empty object,
- Description
- Billing information for the payment method.
- Child properties
- Name
card
- Type
- empty object or null,
- Description
- The payment method’s card details.
- Child properties
- Name
customer
- Type
- string or Customer or null,
- Description
- Expandable. The customer this payment method is attached to.
- Name
type
- Type
- enum,
- Description
- The type of the payment method.
- Array item properties
The PaymentMethod object
Get a payment method
Retrieve a payment method by its ID.
Optional parameters
- Name
expand
- Type
- empty object,
- Description
- Optional object that allows you to expand certain ID fields to include related resources.
- Child properties
Returns
Returns the payment method.
Retrieve a payment method
Response example
List all payment methods
Retrieve a paginated list of payment methods.
Optional parameters
- Name
expand
- Type
- empty object,
- Description
- Optional object that allows you to expand certain ID fields to include related resources.
- Child properties
- Name
ending_before
- Type
- string,
- Description
- A cursor for use in pagination.
ending_before
is an object ID that results will end before. Used to move backward through the list.
- Name
starting_after
- Type
- string,
- Description
- A cursor for use in pagination.
starting_after
is an object ID that results will start after. Used to move forward through the list.
- Name
limit
- Type
- number, at least 1, at most 1000, default is 50
- Description
- Maximum number of objects to return.
- Name
filters
- Type
- ,
- Description
- Filters to apply to the list. Combine multiple conditions with
and
andor
. - Child properties
Returns
Returns a list of payment methods.
List all payment methods
Response example
Update a payment method
Update a payment method’s customer or billing details. Values of null
will set the field to null
. Omit a field to keep its current value.
Optional parameters
- Name
billing_details
- Type
- empty object,
- Description
- Billing information for the payment method
- Child properties
- Name
customer
- Type
- string or null,
- Description
- The customer to associate with the payment method
Returns
Returns the updated payment method.
Update a payment method
Response example
Deactivate a payment method
Render a payment method inactive, preventing it from being used in future transactions.
Returns
Returns the deactivated payment method.