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.
Verfügbare Operationen
Authentifizierung
| Schlüssel | Beschreibung | Wo | Beispiel |
|---|---|---|---|
| Authorization | Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt. | 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.
Beispiel Antwort
{
"_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
}
]
}
}Authentifizierung
| Schlüssel | Beschreibung | Wo | Beispiel |
|---|---|---|---|
| Authorization | Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt. | Headers | Basic <base64> |
80Subaccount department APassword123trueBeispiel Anfrage
{
"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.
Beispiel Antwort
{
"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
}Authentifizierung
| Schlüssel | Beschreibung | Wo | Beispiel |
|---|---|---|---|
| Authorization | Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt. | 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.
Beispiel Antwort
{
"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
}Authentifizierung
| Schlüssel | Beschreibung | Wo | Beispiel |
|---|---|---|---|
| Authorization | Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt. | Headers | Basic <base64> |
trueSubaccount department BBeispiel Anfrage
{
"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.
Beispiel Antwort
{
"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
}Authentifizierung
| Schlüssel | Beschreibung | Wo | Beispiel |
|---|---|---|---|
| Authorization | Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt. | 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
Beispiel Antwort
{
"_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"
}
]
}
}Authentifizierung
| Schlüssel | Beschreibung | Wo | Beispiel |
|---|---|---|---|
| Authorization | Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt. | Headers | Basic <base64> |
7c9738e6ad6dc56f123.45This gets added to the audit logBeispiel Anfrage
{
"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
Beispiel Antwort
{
"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"
}Authentifizierung
| Schlüssel | Beschreibung | Wo | Beispiel |
|---|---|---|---|
| Authorization | Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt. | 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
Beispiel Antwort
{
"_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"
}
]
}
}Authentifizierung
| Schlüssel | Beschreibung | Wo | Beispiel |
|---|---|---|---|
| Authorization | Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt. | Headers | Basic <base64> |
7c9738e6ad6dc56f123.45This gets added to the audit logBeispiel Anfrage
{
"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
Beispiel Antwort
{
"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"
}Authentifizierung
| Schlüssel | Beschreibung | Wo | Beispiel |
|---|---|---|---|
| Authorization | Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt. | Headers | Basic <base64> |
7c9738e6ad6dc56f23507703696GBBeispiel Anfrage
{
"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
Beispiel Antwort
{
"number": "235077036",
"country": "GB",
"from": "7c9738e6",
"to": "ad6dc56f"
}Fehler
Im Folgenden finden Sie eine nicht erschöpfende Liste von Fehlercodes, die bei der Verwendung dieser API auftreten können.
Diese Codes gelten zusätzlich zu unseren generische Fehlercodes.
| Code | Informationen |
|---|---|
| validation | Beschreibung The request failed due to validation errors Auflösung See the |
| invalid-transfers | Beschreibung Invalid transfer Auflösung See the |
| provisioning | Beschreibung Maximum number of sub-accounts reached Auflösung If you need more subaccounts, contact Vonage Support. |
| internal-error | Beschreibung An error has occurred in the platform while processing this request Auflösung If the error persists, contact Vonage Support. |
| invalid-number-transfer | Beschreibung Failed to perform transfer number from source account to destination account Auflösung See the |
| missing-number-transfer | Beschreibung Could not transfer number from source account to destination account - ShortCode not found Auflösung See the |
| transfer-conflict | Beschreibung Could not transfer number from source account to destination account - ShortCode is already owned by requesting account Auflösung See the |