Attach a PaymentMethod to a Customer
POST
/v1/payment_methods/{paymentmethod_id}/attachAttaches a PaymentMethod object to a Customer.
To attach a new PaymentMethod to a customer for future payments, we recommend you use a SetupIntent or a PaymentIntent with setup_future_usage. These approaches will perform any necessary steps to set up the PaymentMethod for future payments.
To use this PaymentMethod as the default for invoice or subscription payments, set invoice_settings.default_payment_method, on the Customer to the PaymentMethod’s ID.
请求参数
Path Params
paymentmethod_id
string
required
Body Params application/json
customer
string
required
The ID of the customer to which to attach the PaymentMethod.
Example
{
"customer": "string"
}
示例代码
Responses
OK(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
Data Schema
No schema defined
Example
Not configured
Last modified: 5 个月前