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.
Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | 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.
Exemplo Resposta
{
"_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
}
]
}
}Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | Headers | Basic <base64> |
80Subaccount department APassword123trueExemplo Solicitação
{
"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.
Exemplo Resposta
{
"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
}Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | 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.
Exemplo Resposta
{
"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
}Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | Headers | Basic <base64> |
trueSubaccount department BExemplo Solicitação
{
"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.
Exemplo Resposta
{
"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
}Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | 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
Exemplo Resposta
{
"_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"
}
]
}
}Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | Headers | Basic <base64> |
7c9738e6ad6dc56f123.45This gets added to the audit logExemplo Solicitação
{
"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
Exemplo Resposta
{
"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"
}Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | 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
Exemplo Resposta
{
"_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"
}
]
}
}Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | Headers | Basic <base64> |
7c9738e6ad6dc56f123.45This gets added to the audit logExemplo Solicitação
{
"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
Exemplo Resposta
{
"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"
}Autenticação
| Chave | Descrição | Onde | Exemplo |
|---|---|---|---|
| Authorization | Chave e segredo da API codificados em Base64, separados por dois pontos. | Headers | Basic <base64> |
7c9738e6ad6dc56f23507703696GBExemplo Solicitação
{
"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
Exemplo Resposta
{
"number": "235077036",
"country": "GB",
"from": "7c9738e6",
"to": "ad6dc56f"
}Erros
A seguir, apresentamos uma lista não exaustiva de códigos de erro que podem ocorrer durante o uso desta API.
Esses códigos são adicionais aos que constam em nosso site códigos de erro genéricos.
| Código | Informações |
|---|---|
| validation | Descrição The request failed due to validation errors Resolução See the |
| invalid-transfers | Descrição Invalid transfer Resolução See the |
| provisioning | Descrição Maximum number of sub-accounts reached Resolução If you need more subaccounts, contact Vonage Support. |
| internal-error | Descrição An error has occurred in the platform while processing this request Resolução If the error persists, contact Vonage Support. |
| invalid-number-transfer | Descrição Failed to perform transfer number from source account to destination account Resolução See the |
| missing-number-transfer | Descrição Could not transfer number from source account to destination account - ShortCode not found Resolução See the |
| transfer-conflict | Descrição Could not transfer number from source account to destination account - ShortCode is already owned by requesting account Resolução See the |