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.
Operaciones disponibles
Autenticación
| Clave | Descripción | Dónde | Ejemplo |
|---|---|---|---|
| Authorization | Clave API codificada en Base64 y secreto unidos por dos puntos. | 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.
Ejemplo Respuesta
{
"_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
}
]
}
}Autenticación
| Clave | Descripción | Dónde | Ejemplo |
|---|---|---|---|
| Authorization | Clave API codificada en Base64 y secreto unidos por dos puntos. | Headers | Basic <base64> |
80Subaccount department APassword123trueEjemplo Solicitar
{
"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.
Ejemplo Respuesta
{
"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
}Autenticación
| Clave | Descripción | Dónde | Ejemplo |
|---|---|---|---|
| Authorization | Clave API codificada en Base64 y secreto unidos por dos puntos. | 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.
Ejemplo Respuesta
{
"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
}Autenticación
| Clave | Descripción | Dónde | Ejemplo |
|---|---|---|---|
| Authorization | Clave API codificada en Base64 y secreto unidos por dos puntos. | Headers | Basic <base64> |
trueSubaccount department BEjemplo Solicitar
{
"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.
Ejemplo Respuesta
{
"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
}Autenticación
| Clave | Descripción | Dónde | Ejemplo |
|---|---|---|---|
| Authorization | Clave API codificada en Base64 y secreto unidos por dos puntos. | 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
Ejemplo Respuesta
{
"_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"
}
]
}
}Autenticación
| Clave | Descripción | Dónde | Ejemplo |
|---|---|---|---|
| Authorization | Clave API codificada en Base64 y secreto unidos por dos puntos. | Headers | Basic <base64> |
7c9738e6ad6dc56f123.45This gets added to the audit logEjemplo Solicitar
{
"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
Ejemplo Respuesta
{
"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"
}Autenticación
| Clave | Descripción | Dónde | Ejemplo |
|---|---|---|---|
| Authorization | Clave API codificada en Base64 y secreto unidos por dos puntos. | 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
Ejemplo Respuesta
{
"_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"
}
]
}
}Autenticación
| Clave | Descripción | Dónde | Ejemplo |
|---|---|---|---|
| Authorization | Clave API codificada en Base64 y secreto unidos por dos puntos. | Headers | Basic <base64> |
7c9738e6ad6dc56f123.45This gets added to the audit logEjemplo Solicitar
{
"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
Ejemplo Respuesta
{
"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"
}Autenticación
| Clave | Descripción | Dónde | Ejemplo |
|---|---|---|---|
| Authorization | Clave API codificada en Base64 y secreto unidos por dos puntos. | Headers | Basic <base64> |
7c9738e6ad6dc56f23507703696GBEjemplo Solicitar
{
"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
Ejemplo Respuesta
{
"number": "235077036",
"country": "GB",
"from": "7c9738e6",
"to": "ad6dc56f"
}Errores
La siguiente es una lista no exhaustiva de códigos de error que pueden producirse al utilizar esta API.
Estos códigos se suman a cualquiera de nuestros códigos de error genéricos.
| Código | Información |
|---|---|
| validation | Descripción The request failed due to validation errors Resolución See the |
| invalid-transfers | Descripción Invalid transfer Resolución See the |
| provisioning | Descripción Maximum number of sub-accounts reached Resolución If you need more subaccounts, contact Vonage Support. |
| internal-error | Descripción An error has occurred in the platform while processing this request Resolución If the error persists, contact Vonage Support. |
| invalid-number-transfer | Descripción Failed to perform transfer number from source account to destination account Resolución See the |
| missing-number-transfer | Descripción Could not transfer number from source account to destination account - ShortCode not found Resolución See the |
| transfer-conflict | Descripción Could not transfer number from source account to destination account - ShortCode is already owned by requesting account Resolución See the |