Skip to content

Accounts Synchronous Endpoints

This Accounts endpoint provides methods to interact with the accounts of the authenticated user.

Example usage of the Accounts endpoint object:

from pyrevolut.client import Client

CREDS_JSON_LOC = "path/to/creds.json"

client = Client(
    creds_loc=CREDS_JSON_LOC,
    sandbox=True,
)

with client:
    accounts = client.Accounts.get_all_accounts()
    print(accounts)

EndpointAccountsSync

Bases: BaseEndpointSync

The Accounts API Get the balances, full banking details, and other details of your business accounts.

Source code in pyrevolut/api/accounts/endpoint/synchronous.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
class EndpointAccountsSync(BaseEndpointSync):
    """The Accounts API
    Get the balances, full banking details, and other details of your business accounts.
    """

    def get_all_accounts(
        self,
        **kwargs,
    ) -> list[dict] | list[RetrieveAllAccounts.Response]:
        """
        Get a list of all your accounts.

        Parameters
        ----------
        None

        Returns
        -------
        list[dict] | list[RetrieveAllAccounts.Response]
            The list of all your accounts
        """
        endpoint = RetrieveAllAccounts
        path = endpoint.ROUTE
        params = endpoint.Params()

        return self.client.get(
            path=path,
            response_model=endpoint.Response,
            params=params,
            **kwargs,
        )

    def get_account(
        self,
        account_id: UUID,
        **kwargs,
    ) -> dict | RetrieveAnAccount.Response:
        """
        Get the information about one of your accounts. Specify the account by its ID.

        Parameters
        ----------
        account_id : UUID
            The account ID.

        Returns
        -------
        dict | RetrieveAnAccount.Response
            The information about the account
        """
        endpoint = RetrieveAnAccount
        path = endpoint.ROUTE.format(account_id=account_id)
        params = endpoint.Params()

        return self.client.get(
            path=path,
            response_model=endpoint.Response,
            params=params,
            **kwargs,
        )

    def get_full_bank_details(
        self,
        account_id: UUID,
        **kwargs,
    ) -> dict | RetrieveFullBankDetails.Response:
        """
        Get all the bank details of one of your accounts. Specify the account by its ID.

        Parameters
        ----------
        account_id : UUID
            The account ID.

        Returns
        -------
        dict | RetrieveFullBankDetails.Response
            The bank details of the account
        """
        endpoint = RetrieveFullBankDetails
        path = endpoint.ROUTE.format(account_id=account_id)
        params = endpoint.Params()

        return self.client.get(
            path=path,
            response_model=endpoint.Response,
            params=params,
            **kwargs,
        )

get_account(account_id, **kwargs)

Get the information about one of your accounts. Specify the account by its ID.

Parameters:

Name Type Description Default
account_id UUID

The account ID.

required

Returns:

Type Description
dict | Response

The information about the account

Source code in pyrevolut/api/accounts/endpoint/synchronous.py
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
def get_account(
    self,
    account_id: UUID,
    **kwargs,
) -> dict | RetrieveAnAccount.Response:
    """
    Get the information about one of your accounts. Specify the account by its ID.

    Parameters
    ----------
    account_id : UUID
        The account ID.

    Returns
    -------
    dict | RetrieveAnAccount.Response
        The information about the account
    """
    endpoint = RetrieveAnAccount
    path = endpoint.ROUTE.format(account_id=account_id)
    params = endpoint.Params()

    return self.client.get(
        path=path,
        response_model=endpoint.Response,
        params=params,
        **kwargs,
    )

get_all_accounts(**kwargs)

Get a list of all your accounts.

Parameters:

Name Type Description Default
None
required

Returns:

Type Description
list[dict] | list[Response]

The list of all your accounts

Source code in pyrevolut/api/accounts/endpoint/synchronous.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
def get_all_accounts(
    self,
    **kwargs,
) -> list[dict] | list[RetrieveAllAccounts.Response]:
    """
    Get a list of all your accounts.

    Parameters
    ----------
    None

    Returns
    -------
    list[dict] | list[RetrieveAllAccounts.Response]
        The list of all your accounts
    """
    endpoint = RetrieveAllAccounts
    path = endpoint.ROUTE
    params = endpoint.Params()

    return self.client.get(
        path=path,
        response_model=endpoint.Response,
        params=params,
        **kwargs,
    )

get_full_bank_details(account_id, **kwargs)

Get all the bank details of one of your accounts. Specify the account by its ID.

Parameters:

Name Type Description Default
account_id UUID

The account ID.

required

Returns:

Type Description
dict | Response

The bank details of the account

Source code in pyrevolut/api/accounts/endpoint/synchronous.py
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
def get_full_bank_details(
    self,
    account_id: UUID,
    **kwargs,
) -> dict | RetrieveFullBankDetails.Response:
    """
    Get all the bank details of one of your accounts. Specify the account by its ID.

    Parameters
    ----------
    account_id : UUID
        The account ID.

    Returns
    -------
    dict | RetrieveFullBankDetails.Response
        The bank details of the account
    """
    endpoint = RetrieveFullBankDetails
    path = endpoint.ROUTE.format(account_id=account_id)
    params = endpoint.Params()

    return self.client.get(
        path=path,
        response_model=endpoint.Response,
        params=params,
        **kwargs,
    )