Billing

Manage users billing settings.


All Payment Methods

Show a list of user payment methods

Endpoint

Method URI Authentication
GET /cards true

{success} Example Success Response Code 200

Content

{
    "success": true,
    "message": "Show payment methods",
    "data": [
        {
            "id": 1,
            "user_id": 1,
            "stripe_customer_id": "cus_FsQcawWaxlmfbs",
            "stripe_card_id": "card_1FMflHD2YnIDoaEIqLthZhO8",
            "card_type": "Visa",
            "card_last4": "4242",
            "exp_month": 12,
            "exp_year": 2023,
            "default": true,
            "created_at": "2020-09-22T13:23:49.000000Z",
            "updated_at": "2020-09-22T13:23:49.000000Z"
        }
    ]
}

Single Payment Method

Show a single user payment method.

Endpoint

Method URI Authentication
GET /card/{id} true

{success} Example Success Response Code 200

Content

{
    "success": true,
    "message": "Show payment method",
    "data": {
        "id": 1,
        "user_id": 1,
        "stripe_customer_id": "cus_FsQcawWaxlmfbs",
        "stripe_card_id": "card_1FMflHD2YnIDoaEIqLthZhO8",
        "card_type": "Visa",
        "card_last4": "4242",
        "exp_month": 12,
        "exp_year": 2023,
        "default": true,
        "created_at": "2020-09-22T13:23:49.000000Z",
        "updated_at": "2020-09-22T13:23:49.000000Z"
    }
}

Save Card

Save a customers payment details via Stripe

Endpoint

Method URI Authentication
POST /cards true

{success} Example Success Response Code 200

Content

{
    "success": true,
    "message": "Your card has been saved.",
    "data": null
}

Make Default

Make a payment method the default.

Endpoint

Method URI Authentication
PATCH /card/{id} true

{success} Example Success Response Code 200

Content

{
    "success": true,
    "message": "Default payment method has been saved.",
    "data": null
}

Remove Payment Method

Remove a user payment method.

Endpoint

Method URI Authentication
DELETE /card/{id} true

{success} Example Success Response Code 200

Content

{
    "success": true,
    "message": "This payment method has been removed.",
    "data": null
}