Transfer credits

This method allows you to transfer credits to a sub-account.

POST

/account/transfer

Body Parameters

to_account
required
The account id of your sub-account
credits
required
Amount of credits

Examples


POST /account/transfer HTTP/1.1
Host: api.smsfactor.com
Authorization: Bearer your.token
Accept: application/json

{
  "transfer": {
     "to_account" : 1010101,
     "credits": 10
  }
}
          
        

POST /account/transfer HTTP/1.1
Host: api.smsfactor.com
Authorization: Bearer your.token
Accept: application/xml

<?xml version="1.0" encoding="UTF-8"?>
<transfer>
  <to_account>1010101</to_account>
  <credits>10</credits>
</transfer>
        
      

$response = \SMSFactor\Account::create([
  'transfer' => [
    "to_account" => 1010101,
    "credits" => 10,
  ]
]);
        
      

Result Format


{
  "status": 1,
  "message": "OK",
  "credits": "990",
  "child_credits": "1010"
}
          
        

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>1</status>
  <message>OK</message>
  <credits>990</credits>
  <child_credits>1010</child_credits>
</response>