Billing - API Endpoints
Fetch Payment details
Endpoint /billing/payment-details
Method GET
Response
Status Code 200
{
"payment_details": [{
"id": "18756274-8a10-4c0a-ac01-663fcb911f74",
"default": false,
"brand": "Visa",
"last_four": "4242",
"expiry_month": "4",
"expiry_year": "2023",
"created_at": "2023-01-05T11:08:27+00:00"
}]
}
Get card collection token for client side collection
Endpoint /billing/card/token/start
Token GET
Providers Adyen
, Stripe
Response
Status Code 200
{
"token": "token-here",
"api_info": "api info here"
}
Add card by token
Endpoint /billing/card/token/add
Method POST
Providers Stripe
Request
{
"token": "token-we-got-from-the-payment-provider"
}
Response
Status Code 202
Body
{
"success": true,
"payment_details": {
"id": "18756274-8a10-4c0a-ac01-663fcb911f74",
"default": false,
"brand": "Visa",
"last_four": "4242",
"expiry_month": "4",
"expiry_year": "2023",
"created_at": "2023-01-05T11:08:27+00:00"
}
}
Fetch billing details
Endpoint /billing/details
Method GET
Response
Status Code 200
{
"address": {
"company_name": null,
"street_line_one": "Test",
"street_line_two": null,
"city": "test",
"region": null,
"country": "",
"post_code": null
}
}
Update billing details
Endpoint /billing/details
Method POST
Body
{
"company_name": null,
"street_line_one": "Test",
"street_line_two": null,
"city": "test",
"region": null,
"country": "",
"post_code": null
}
Response
Error
Status Code 400
{
"success": false,
"errors": {
"country": [
"error message one",
"error message two"
]
}
}
Success
Status Code 202
{
"success": true
}
Delete Payment Method
Endpoint /billing/card/{id}
Method DELETE
Error
Status Code 404
{
"success": false
}
Success
Status Code 202
{
"success": true
}