Subaccounts API
The Subaccounts API enables you to create subaccounts under your primary account. Subaccounts facilitate differential product configuration, reporting, and billing. The Subaccounts API is released initially with restricted availability. You can read more about the API in the Subaccounts documentation.
Opérations disponibles
Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
bbe6222fUnique subaccount ID.
Subaccount department AName of the subaccount.
acc6111fUnique primary account ID.
trueFlag showing if balance is shared with primary account.
2018-03-02T16:34:49ZSubaccount creation date and time.
Subaccount suspension status.
100.25Balance of the subAccount. Value is null if balance is shared with primary account.
-100.25Credit limit of the subAccount. Value is null if balance is shared with primary account.
bbe6222fUnique subaccount ID.
Subaccount department AName of the subaccount.
acc6111fUnique primary account ID.
trueFlag showing if balance is shared with primary account.
2018-03-02T16:34:49ZSubaccount creation date and time.
Subaccount suspension status.
100.25Balance of the subAccount. Value is null if balance is shared with primary account.
-100.25Credit limit of the subAccount. Value is null if balance is shared with primary account.
Exemple Réponse
{
"_embedded": {
"primary_account": {
"api_key": "bbe6222f",
"name": "Subaccount department A",
"primary_account_api_key": "acc6111f",
"use_primary_account_balance": true,
"created_at": "2018-03-02T16:34:49Z",
"suspended": false,
"balance": 100.25,
"credit_limit": -100.25
},
"subaccounts": [
{
"api_key": "bbe6222f",
"name": "Subaccount department A",
"primary_account_api_key": "acc6111f",
"use_primary_account_balance": true,
"created_at": "2018-03-02T16:34:49Z",
"suspended": false,
"balance": 100.25,
"credit_limit": -100.25
}
]
}
}Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
80Subaccount department APassword123trueExemple Demande
{
"name": "Subaccount department A",
"secret": "Password123",
"use_primary_account_balance": false
}{
"name": "Subaccount department A",
"secret": "Password123",
"use_primary_account_balance": false
}Password123API secret of the subaccount.
bbe6222fUnique subaccount ID.
Subaccount department AName of the subaccount.
acc6111fUnique primary account ID.
trueFlag showing if balance is shared with primary account.
2018-03-02T16:34:49ZSubaccount creation date and time.
Subaccount suspension status.
100.25Balance of the subAccount. Value is null if balance is shared with primary account.
-100.25Credit limit of the subAccount. Value is null if balance is shared with primary account.
Exemple Réponse
{
"secret": "Password123",
"api_key": "bbe6222f",
"name": "Subaccount department A",
"primary_account_api_key": "acc6111f",
"use_primary_account_balance": true,
"created_at": "2018-03-02T16:34:49Z",
"suspended": false,
"balance": 100.25,
"credit_limit": -100.25
}Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
bbe6222fUnique subaccount ID.
Subaccount department AName of the subaccount.
acc6111fUnique primary account ID.
trueFlag showing if balance is shared with primary account.
2018-03-02T16:34:49ZSubaccount creation date and time.
Subaccount suspension status.
100.25Balance of the subAccount. Value is null if balance is shared with primary account.
-100.25Credit limit of the subAccount. Value is null if balance is shared with primary account.
Exemple Réponse
{
"api_key": "bbe6222f",
"name": "Subaccount department A",
"primary_account_api_key": "acc6111f",
"use_primary_account_balance": true,
"created_at": "2018-03-02T16:34:49Z",
"suspended": false,
"balance": 100.25,
"credit_limit": -100.25
}Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
trueSubaccount department BExemple Demande
{
"suspended": true,
"use_primary_account_balance": false,
"name": "Subaccount department B"
}{
"suspended": true,
"use_primary_account_balance": false,
"name": "Subaccount department B"
}bbe6222fUnique subaccount ID.
Subaccount department AName of the subaccount.
acc6111fUnique primary account ID.
trueFlag showing if balance is shared with primary account.
2018-03-02T16:34:49ZSubaccount creation date and time.
Subaccount suspension status.
100.25Balance of the subAccount. Value is null if balance is shared with primary account.
-100.25Credit limit of the subAccount. Value is null if balance is shared with primary account.
Exemple Réponse
{
"api_key": "bbe6222f",
"name": "Subaccount department A",
"primary_account_api_key": "acc6111f",
"use_primary_account_balance": true,
"created_at": "2018-03-02T16:34:49Z",
"suspended": false,
"balance": 100.25,
"credit_limit": -100.25
}Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
07b5-46e1-a527-85530e625800Unique credit transfer ID
123.45Credit transfer amount
7c9738e6Account the credit is transferred from
ad6dc56fAccount the credit is transferred to
This gets added to the audit logReference for the credit transfer
2019-03-02T16:34:49ZThe date and time when the credit transfer was executed
Exemple Réponse
{
"_embedded": {
"credit-transfers": [
{
"credit_transfer_id": "07b5-46e1-a527-85530e625800",
"amount": 123.45,
"from": "7c9738e6",
"to": "ad6dc56f",
"reference": "This gets added to the audit log",
"created_at": "2019-03-02T16:34:49Z"
}
]
}
}Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
7c9738e6ad6dc56f123.45This gets added to the audit logExemple Demande
{
"from": "7c9738e6",
"to": "ad6dc56f",
"amount": "123.45",
"reference": "This gets added to the audit log"
}{
"from": "7c9738e6",
"to": "ad6dc56f",
"amount": "123.45",
"reference": "This gets added to the audit log"
}07b5-46e1-a527-85530e625800Unique credit transfer ID
123.45Credit transfer amount
7c9738e6Account the credit is transferred from
ad6dc56fAccount the credit is transferred to
This gets added to the audit logReference for the credit transfer
2019-03-02T16:34:49ZThe date and time when the credit transfer was executed
Exemple Réponse
{
"credit_transfer_id": "07b5-46e1-a527-85530e625800",
"amount": 123.45,
"from": "7c9738e6",
"to": "ad6dc56f",
"reference": "This gets added to the audit log",
"created_at": "2019-03-02T16:34:49Z"
}Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
07b5-46e1-a527-85530e625800Unique balance transfer ID
123.45Balance transfer amount
7c9738e6Account the balance is transferred from
ad6dc56fAccount the balance is transferred to
This gets added to the audit logReference for the balance transfer
2019-03-02T16:34:49ZThe date and time when the balance transfer was executed
Exemple Réponse
{
"_embedded": {
"balance_transfers": [
{
"balance_transfer_id": "07b5-46e1-a527-85530e625800",
"amount": 123.45,
"from": "7c9738e6",
"to": "ad6dc56f",
"reference": "This gets added to the audit log",
"created_at": "2019-03-02T16:34:49Z"
}
]
}
}Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
7c9738e6ad6dc56f123.45This gets added to the audit logExemple Demande
{
"from": "7c9738e6",
"to": "ad6dc56f",
"amount": "123.45",
"reference": "This gets added to the audit log"
}{
"from": "7c9738e6",
"to": "ad6dc56f",
"amount": "123.45",
"reference": "This gets added to the audit log"
}07b5-46e1-a527-85530e625800Unique balance transfer ID
123.45Balance transfer amount
7c9738e6Account the balance is transferred from
ad6dc56fAccount the balance is transferred to
This gets added to the audit logReference for the balance transfer
2019-03-02T16:34:49ZThe date and time when the balance transfer was executed
Exemple Réponse
{
"balance_transfer_id": "07b5-46e1-a527-85530e625800",
"amount": 123.45,
"from": "7c9738e6",
"to": "ad6dc56f",
"reference": "This gets added to the audit log",
"created_at": "2019-03-02T16:34:49Z"
}Authentification
| Clé | Description | Où | Exemple |
|---|---|---|---|
| Authorization | Clé et secret de l'API encodés en Base64 et reliés par deux points. | Headers | Basic <base64> |
7c9738e6ad6dc56f23507703696GBExemple Demande
{
"from": "7c9738e6",
"to": "ad6dc56f",
"number": "23507703696",
"country": "GB"
}{
"from": "7c9738e6",
"to": "ad6dc56f",
"number": "23507703696",
"country": "GB"
}235077036Number transfered
GBThe two character country code in ISO 3166-1 alpha-2 format
7c9738e6Account the number is transferred from
ad6dc56fAccount the number is transferred to
Exemple Réponse
{
"number": "235077036",
"country": "GB",
"from": "7c9738e6",
"to": "ad6dc56f"
}Erreurs
Voici une liste non exhaustive des codes d'erreur susceptibles de se produire lors de l'utilisation de cette API.
Ces codes s'ajoutent à ceux de notre site codes d'erreur génériques.
| Code | Informations |
|---|---|
| validation | Description The request failed due to validation errors Résolution See the |
| invalid-transfers | Description Invalid transfer Résolution See the |
| provisioning | Description Maximum number of sub-accounts reached Résolution If you need more subaccounts, contact Vonage Support. |
| internal-error | Description An error has occurred in the platform while processing this request Résolution If the error persists, contact Vonage Support. |
| invalid-number-transfer | Description Failed to perform transfer number from source account to destination account Résolution See the |
| missing-number-transfer | Description Could not transfer number from source account to destination account - ShortCode not found Résolution See the |
| transfer-conflict | Description Could not transfer number from source account to destination account - ShortCode is already owned by requesting account Résolution See the |