Credit and debit cards
Learn how to use Payment Method Sessions to save payment method details for future card payments.
You'll need to supply the ID of the customer you'd like to attach the payment method.
curl https://api.yorlet.com/v1/payment_method_sessions \
-H "Authorization: Bearer {{API_KEY}}" \
-H "Content-Type: application/json" \
-d '{
"customer": "cus_kowie32023325",
"payment_method_types": ["card"],
"return_url": "https://example.com/success"
}'
{
"object": "payment_method_session",
"created": 1607473397,
"url": "https://pay.yorlet.com/payment_methods/pmsess_kfpOalkieq092Pm"
}
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.curl https://api.yorlet.com/v1/payment_method_sessions/pmsess_kopfaoko02plaQ \
-H "Authorization: Bearer {{API_KEY}}" \
The payment method session will include a
payment_method
you can use in future requests.Last modified 2yr ago