POST
https://api.octopush.com/v1/public/subaccount/credit-transfer/transferEncodage : UTF-8
Authentification
Vos identifiants « api-key » et « api-login » doivent être ajoutés dans les headers.
Vous pouvez également utiliser Basic Auth.
Définition
Ce service permet de transférer du crédit depuis votre compte principal vers un sous-compte.
Vous devez pour cela obtenir un token de transfère. Il s’agit d’un jeton autorisant une transaction. Il ne peut y avoir plus d’un seul jeton en cours de validité.
Paramètres particuliers
| Nom | Type | Description |
|---|---|---|
token | string | Token de transfert obtenu dans une étape précédente. |
from_wallet_pack_id | string | Identifiant du wallet pack à débiter. Vous pouvez récupérer l’ensemble de vos wallet packs disponibles grâce à l’API [check-balance?with_details=true] |
amount | integer | Montant du transfert en euros. |
Exemple Curl
curl -X POST \
'https://api.octopush.com/v1/public/subaccount/credit-transfer/transfer' \
-H 'Content-Type: application/json' \
-H 'api-login: ******@email.org' \
-H 'api-key: ************' \
-H 'cache-control: no-cache' \
-d '{
"token": "******************************",
"from_wallet_pack_id": "abc123abc456abc",
"amount": 25
}'Code à copier-coller
curl -X POST 'https://api.octopush.com/v1/public/subaccount/credit-transfer/transfer' -H 'Content-Type: application/json' -H 'api-login: ******@email.org' -H 'api-key: ************' -H 'cache-control: no-cache' -d '{"token": "******************************", "from_wallet_pack_id": "abc123abc456abc", "amount": 25}'Retour Server en json
Si succès : 200 OK
{
"wallet_pack_from":{
"id":"1232-323232-33223",
"residual_credit":120.0
},
"wallet_pack_to":{
"id":"9843-4343-89768",
"residual_credit":800.0
}
}