Do Recharge

Post  https://api.bos.center/api/BOS/DoRecharge


Use this API to authenticate with the BOS system and obtain the authorization bearer token. All other API calls must have this token as Authorization header in the format 'Bearer' (without quotes) for them to get processed. The generated token is valid for 600 seconds.

Click to view the steps to generate a public key and the signature.

Body Parameters
{     
  "operator": 311,
  "canumber": "DL12CB4685",
  "amount": 10,
  "referenceid": "1234435687678",
  "RegisterID": "1234"
}
                        
Responses

200

200

Response

200

RESPONSE BODY

object

status    boolean

response_code    integer

operatorid    integer

ackno    string

message    string

Response

401

RESPONSE BODY

object

status     boolean

response_code     integer

message     string

401

401

412

412

Response

412

RESPONSE BODY

Object

status     boolean

response_code     integer

message     string


Did this page help you?     Yes    No

Language
shell Shell
python Python
node Node
c# C#
php PHP

cURL

curl --location 'https://api.bos.center/api/BOS/DoRecharge' \
--header 'Content-Type: application/json' \
--data  '{
  "operator": 311,,
  "canumber": "DL12CB4685",
  "amount": 10,
  "referenceid": "1234435687678",
  "RegisterID": "1234",
}'
                                
import requests
import json

url = 'https://api.bos.center/api/BOS/DoRecharge'
payload = json.dumps({
  "operator": 311,,
  "canumber": "DL12CB4685",
  "amount": 10,
  "referenceid": "1234435687678",
  "RegisterID": "1234",
}) 

headers = {
  "Content-type" : "application/json"
}

response = requests.request("POST", url, headers=headers, data=payload)

print (response.text)
                                
var requests = require("request");
var options = { 
  "method" : "POST",
  "url" : 'https://api.bos.center/api/BOS/DoRecharge',
  "headers" : {
    "Content-Type" : 'application/json'
  },
  body: JSON.stringify({
    "operator": 311,,
    "canumber": "DL12CB4685",
    "amount": 10,
    "referenceid": "1234435687678",
    "RegisterID": "1234",
  }) 
}; 
request(options, function(error, response){
   if(error) throw new Error(error);
   console.log(response.body); 
}); 
                                
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post,'https://api.bos.center/api/BOS/DoRecharge')
var content = new StringContent(
  "{
    "operator": 311,,
    "canumber": "DL12CB4685",
    "amount": 10,
    "referenceid": "1234435687678",
    "RegisterID": "1234",
  }",
  null,"application/json"
); 

request.Content = content;
var response =  await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
                                
<?php
$curl =  curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL =>  'https://api.bos.center/api/BOS/DoRecharge',
  CURLOPT_RETURNTRANSFER =>  true,
  CURLOPT_ENCODING =>  '',
  CURLOPT_MAXREDIRS =>  10,
  CURLOPT_TIMEOUT =>  0,
  CURLOPT_FOLLOWLOCATION =>  true,
  CURLOPT_HTTP_VERSION =>  CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST =>  'POST',
  CURLOPT_POSTFIELDS =>  '{
    "operator": 311,,
    "canumber": "DL12CB4685",
    "amount": 10,
    "referenceid": "1234435687678",
    "RegisterID": "1234",
  }',
  CURLOPT_HTTPHEADER =>  array(
    'Content-Type: application/json'
  ),
));
$response =  curl_exec($curl);
curl_close($curl);
echo $response;
                                

RESPONSE

200

401

412

-Result

Example

{
  "status": true,
  "response_code": 1,
  "operatorid": 1111122233,
  "ackno": "11224445565",
  "message": "Recharge for Aircel of Amount 50 is successful"
}
                                
 
{
  "status": false,
  "response_code": 11,
  "message": "Duplicate Transaction"
}
                                
 
{
  "status": false,
  "response_code": 16,
  "message": "Authentication failed"
}

                                
 
{
  "status": false,
  "response_code": 15,
  "message": "Invalid signature encoding"
}