Payment methods
We take your security seriously. When using our Payment Methods API, powered by Stripe, you can trust that your payment data is handled with the utmost care. Stripe is a leading payment processing platform that employs industry-standard security practices to protect your sensitive information. All transactions are encrypted using SSL (Secure Socket Layer) technology, ensuring that your payment details are transmitted securely over the internet.
Getting payment methods
To get your payment methods, you can use the following endpoint:
GET https://api.safsira.com/v1/payment-methods/
The response will contain the necessary information to create an order (i.e. the payment method id).
Example response:
{
"card": [
{
"id": "pm_ABCDEFGHIJKLMNOPQRSTUVWX",
"billing_details": {
//..
},
"customer": "cus_CUSTOMERID",
"type": "card",
"card": {
"brand": "visa",
"country": "US",
"exp_month": 3,
"exp_year": 2029,
"last4": "4242",
//...
}
//...
}
],
"us_bank_account": [
{
"id": "pm_XWVUTSRQPONMLKJIHGFEDCBA",
"billing_details": {
//..
},
"customer": "cus_CUSTOMERID",
"type": "us_bank_account",
"us_bank_account": {
"account_type": "checking",
"bank_name": "BANK NAME",
"last4": "6789",
"routing_number": "110000000",
//...
}
//...
}
]
}
Currently, we support payment via credit card and US bank account. We will be adding more payment methods in the future.
Set payment method as default
To set a payment method as default, you can use the following endpoint:
PATCH https://api.safsira.com/v1/payment-methods/{id}
Body:
{
"is_default": true
}
Removing payment methods
You can remove payment methods using the following endpoint:
DELETE https://api.safsira.com/v1/payment-methods/{id}
You can't remove the default payment method unless it is the only payment method you have.