Transférez des crédits

Cette méthode vous permet de transférer des crédits à un sous-compte.

POST

/account/transfer

Paramètres du body

to_account
requis
L'id de votre sous-compte
credits
requis
Montant des crédits

Exemples


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,
  ]
]);
        
      

Format de la réponse


{
  "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>