Credit and debit cards

Learn how to use Payment Method Sessions to save payment method details for future card payments.

1. Create a payment method session

You'll need to supply the ID of the customer you'd like to attach the payment method.
curl \
-H "Authorization: Bearer {{API_KEY}}" \
-H "Content-Type: application/json" \
-d '{
"customer": "cus_kowie32023325",
"payment_method_types": ["card"],
"return_url": ""
"object": "payment_method_session",
"created": 1607473397,
"url": ""

2. Redirect the customer to collect their payment details

Once you're created the payment method session you should redirect your customer to the url returned in the response so they can enter their payment details.

3. Retrieve the payment method

curl \
-H "Authorization: Bearer {{API_KEY}}" \
The payment method session will include a payment_method you can use in future requests.

4. Create a subscription