Skip to main content

Vonage Subaccount Package

This package contains the code to use Vonage's Subaccount API in Python.

It includes methods for creating and modifying Vonage subaccounts and transferring credit, balances and numbers between subaccounts.

Usage

It is recommended to use this as part of the main vonage package. The examples below assume you've created an instance of the vonage.Vonage class called vonage_client.

List Subaccounts

response = vonage_client.subaccounts.list_subaccounts()
print(response.model_dump)

Create Subaccount

from vonage_subaccounts import SubaccountOptions

response = vonage_client.subaccounts.create_subaccount(
    SubaccountOptions(
        name='test_subaccount', secret='1234asdfA', use_primary_account_balance=False
    )
)
print(response)

Modify a Subaccount

from vonage_subaccounts import ModifySubaccountOptions

response = vonage_client.subaccounts.modify_subaccount(
    'test_subaccount',
    ModifySubaccountOptions(
        suspended=True,
        name='modified_test_subaccount',
    ),
)
print(response)

List Balance Transfers

from vonage_subaccounts import ListTransfersFilter

filter = {'start_date': '2023-08-07T10:50:44Z'}
response = vonage_client.subaccounts.list_balance_transfers(ListTransfersFilter(**filter))
for item in response:
    print(item.model_dump())

Transfer Balance Between Subaccounts

from vonage_subaccounts import TransferRequest

request = TransferRequest(
    from_='test_api_key', to='test_subaccount', amount=0.02, reference='A reference'
)
response = vonage_client.subaccounts.transfer_balance(request)
print(response)

List Credit Transfers

from vonage_subaccounts import ListTransfersFilter

filter = {'start_date': '2023-08-07T10:50:44Z'}
response = vonage_client.subaccounts.list_credit_transfers(ListTransfersFilter(**filter))
for item in response:
    print(item.model_dump())

Transfer Credit Between Subaccounts

from vonage_subaccounts import TransferRequest

request = TransferRequest(
    from_='test_api_key', to='test_subaccount', amount=0.02, reference='A reference'
)
response = vonage_client.subaccounts.transfer_balance(request)
print(response)

Transfer a Phone Number Between Subaccounts

from vonage_subaccounts import TransferNumberRequest

request = TransferNumberRequest(
    from_='test_api_key', to='test_subaccount', number='447700900000', country='GB'
)
response = vonage_client.subaccounts.transfer_number(request)
print(response)

Metadata

Release files for vonage-subaccounts 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vonage-subaccounts 1.0.4
File Size Uploaded Provenance Actions
vonage_subaccounts-1.0.4.tar.gz 6.4 kB Without provenance Details for vonage_subaccounts-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vonage-subaccounts 1.0.4
File Interpreter ABI Platform Actions
vonage_subaccounts-1.0.4-py3-none-any.whl Python 3 none any Details for vonage_subaccounts-1.0.4-py3-none-any.whl

Total release size: 13.3 kB

Release files / vonage_subaccounts-1.0.4.tar.gz

Download URL vonage_subaccounts-1.0.4.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2fe5af046765224783e26c110702adaf79fd3e4c7d4388e98fdf840cff898479
BLAKE2b-256 checksum
How to use checksums
f0f7ae476f7a9a01f925f0c58838833253b1b954a848c65c5c5f2a54b1f22735
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.4

Release files / vonage_subaccounts-1.0.4-py3-none-any.whl

Download URL vonage_subaccounts-1.0.4-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8ec1b78e9e975ae29939e426412f4e4eb662dbdef799de60dc1ff5da007cea9
BLAKE2b-256 checksum
How to use checksums
d62dd79bedb13aea4132a1c6efeba8ceaad8e01928429314cfc7cff0127e6426
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.4

Security for vonage-subaccounts 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page