Skip to content

Purchase Credit

This API allows you to purchase SMS or MMS credits for your Cellcast account.

Parameters for getting List Credit Card

Headers Parameters

ParametersDescription
AuthorizationPlease add provided Bearer token - linked to your Cellcast account. Check here
Content-Typeapplication/json

Request Body Parameters

NameExampleDescription
typesmsCredit type "sms" or "mms"
credits1000Amount of credit to be purchased
cardcard_1QfFjoGOd000000000000000Credit Card ID. You can add your Credit Card via the Cellcast App Learn How. Retrieve the Credit Card ID using the Get List Credit Card API Here

Code Samples

GET https://api.cellcast.com/api/v1/user/subscribe

bash
curl --location 'https://api.cellcast.com/api/v1/user/subscribe' \
--header 'accept: application/json \
--data '{
    "credit": {
        "type": "sms",
        "credits": 2000
    },
    "card": "card_1QfFjoGOd000000000000000"
}'

Replace with the actual API key that you own.

Responses

200 Success

json
{
    "app_type": "web",
    "app_version": "1.0",
    "maintainence": 0,
    "new_version": 0,
    "force_update": 0,
    "invalid_token": 0,
    "refresh_token": "",
    "show_message": 1,
    "is_enc": false,
    "status": true,
    "message": "Payment is Successful and 2000 credits added to your account.",
    "message_type": "toast",
    "data": {
        "user": {
            "updateModel": {
                ...
            },
            "totalCredits": {
                "sms": 2000,
                "mms": 0
            }
        }
    },
    "error": {}
}

401 Bad Request

json
{
  "code": 400,
  "message": "\"card\" is not allowed to be empty",
  "stack": "APIError: \"card\" is not allowed to be empty ...."
}

401 Unauthorized

json
{
  "code": 401,
  "message": "Token expired",
  "stack": "APIError: Token expired ...."
}