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.
Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | 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.
Example Response
{
"_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
}
]
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
80Subaccount department APassword123trueExample Request
{
"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.
Example Response
{
"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
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | 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.
Example Response
{
"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
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
trueSubaccount department BExample Request
{
"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.
Example Response
{
"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
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | 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
Example Response
{
"_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"
}
]
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
7c9738e6ad6dc56f123.45This gets added to the audit logExample Request
{
"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
Example Response
{
"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"
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | 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
Example Response
{
"_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"
}
]
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
7c9738e6ad6dc56f123.45This gets added to the audit logExample Request
{
"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
Example Response
{
"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"
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
7c9738e6ad6dc56f23507703696GBExample Request
{
"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
Example Response
{
"number": "235077036",
"country": "GB",
"from": "7c9738e6",
"to": "ad6dc56f"
}Errors
The following is a non-exhaustive list of error codes that may occur while using this API.
These codes are in addition to any of our generic error codes.
| Code | Information |
|---|---|
| validation | Description The request failed due to validation errors Resolution See the |
| invalid-transfers | Description Invalid transfer Resolution See the |
| provisioning | Description Maximum number of sub-accounts reached Resolution If you need more subaccounts, contact Vonage Support. |
| internal-error | Description An error has occurred in the platform while processing this request Resolution If the error persists, contact Vonage Support. |
| invalid-number-transfer | Description Failed to perform transfer number from source account to destination account Resolution See the |
| missing-number-transfer | Description Could not transfer number from source account to destination account - ShortCode not found Resolution See the |
| transfer-conflict | Description Could not transfer number from source account to destination account - ShortCode is already owned by requesting account Resolution See the |