Virtual Accounts
This documentation provides details on the API endpoints available for Whirlprivacy.io, focusing on virtual accounts operations.
POST /virtual/virtual-account
- Create Batch Virtual Accounts
/virtual/virtual-account
- Create Batch Virtual AccountsDescription: Creates multiple virtual accounts with provided labels. Each label must be unique and not exceed the maximum number of accounts allowed per user.
Parameters:
labels
array of strings
List of labels for the new virtual accounts.
Response:
Error Handling:
E_INVALID_PARAMS
The labels array is not provided or is not valid.
E_INVALID_LABEL
One or more labels are invalid according to the validation rules.
E_MAX_VIRTUAL_ACCOUNTS
The number of accounts exceeds the limit allowed.
E_CREATING_VIRTUAL_ACCOUNT
An error occurred during the creation of accounts, possibly due to duplicate labels.
Example Code:
POST /virtual/virtual-account/unnamed
- Create Unnamed Virtual Accounts
/virtual/virtual-account/unnamed
- Create Unnamed Virtual AccountsDescription: Allows the creation of a specific number of unnamed virtual accounts, limited by the maximum allowed accounts configuration.
Parameters:
amount
integer
The number of unnamed accounts to create.
Response:
Error Handling:
E_INVALID_PARAMS
The amount is not provided or is not a valid integer.
E_MAX_VIRTUAL_ACCOUNTS
The number of accounts exceeds the limit allowed.
E_CREATING_VIRTUAL_ACCOUNT
An error occurred during the account creation process.
Example Code:
PUT /virtual/virtual-account
- Updates Virtual Account
/virtual/virtual-account
- Updates Virtual AccountDescription:
Updates the label of an existing virtual account.
Parameters:
uuid
string
The unique identifier of the virtual account. Required if label
is not provided.
label
string
Current label of the virtual account. Required if uuid
is not provided.
newValue
string
New label for the virtual account.
Response:
Error Handling:
E_INVALID_PARAMS
Missing or invalid parameters provided.
E_UPDATING_VIRTUAL_ACCOUNT_LABEL
Error occurred while updating the virtual account label.
Example Code:
PUT /virtual/virtual-account/disable
- Disables Virtual Account
/virtual/virtual-account/disable
- Disables Virtual AccountDescription:
Disables an existing virtual account. Main accounts cannot be disabled.
Parameters:
uuid
string
The unique identifier of the virtual account. Required if label
is not provided.
label
string
The label of the virtual account to disable. Required if uuid
is not provided.
Response:
Error Handling:
E_INVALID_PARAMS
Missing or invalid parameters provided.
E_DISABLING_VIRTUAL_ACCOUNT
Error occurred while disabling the account.
Example Code:
Here's a detailed Markdown documentation based on the provided code, suitable for copying and pasting into a GitBook. Each function's description aligns with the corresponding HTTP request, detailing expected parameters, behaviors, responses, error management, and sample code for execution.
Error Handling
E_INVALID_PARAMS
Parameters provided are invalid.
Example Code
GET /virtual/virtual-account/count
- Count User Virtual Accounts
/virtual/virtual-account/count
- Count User Virtual AccountsThis endpoint counts the virtual accounts associated with a logged-in user.
Parameters
None.
Successful Response
Error Handling
E_INVALID_PARAMS
Parameters provided are invalid.
Example Code
GET /virtual/virtual-account
- Get Specific Virtual Account
/virtual/virtual-account
- Get Specific Virtual AccountDescription: This endpoint retrieves a specific virtual account by either label or UUID for a logged-in user.
Parameters:
label
string
Optional. The label of the virtual account.
uuid
string
Optional. The UUID of the virtual account.
Response:
Error Handling:
E_INVALID_PARAMS
Parameters provided are invalid.
E_VIRTUAL_ACCOUNT_NOT_FOUND
The requested virtual account could not be found.
Example Code:
GET /virtual/virtual-account/search
- Search User Virtual Accounts
/virtual/virtual-account/search
- Search User Virtual AccountsDescription: This endpoint searches for virtual accounts based on a label for a logged-in user.
Parameters:
label
string
The label to search for among virtual accounts.
Response:
Error Handling:
E_INVALID_PARAMS
Parameters provided are invalid.
Example Code:
GET /virtual/virtual-accounts
- List User Virtual Accounts
/virtual/virtual-accounts
- List User Virtual AccountsDescription: Retrieves a list of all virtual accounts associated with the logged-in user. This includes the ability to filter accounts based on their active status and whether to include balance information.
Parameters:
active
boolean
No
Filters the accounts based on their active status. Defaults to true.
balances
boolean
No
Determines if the balances should be included in the response.
Response:
Error Handling:
E_INVALID_PARAMS
The provided parameters are invalid or missing.
E_VIRTUAL_ACCOUNT_NOT_FOUND
No virtual account matching the criteria found.
Example Code:
Below is a markdown documentation for the API request described in the code you provided, specifically for retrieving the asset balance of a virtual account. This description is tailored to be integrated into a GitBook for project documentation.
GET /virtual/virtual-account/balance
- Retrieve Asset Balance of a Virtual Account
/virtual/virtual-account/balance
- Retrieve Asset Balance of a Virtual AccountDescription: Retrieves the balance of the specified asset in a virtual account identified by either UUID or label. If the account is the user's main account or matches the given UUID or label, the balance of the asset is fetched. This endpoint is useful for financial tracking and management within the virtual account ecosystem.
Parameters:
ticker
string
The ticker symbol of the asset
Yes
uuid
string
The UUID of the virtual account (optional if label used)
No
label
string
The label of the virtual account (optional if UUID used)
No
Response:
Error Handling:
E_INVALID_PARAMS
Missing or invalid parameter(s)
E_INVALID_TICKER
The specified ticker does not exist
Example Code:
Last updated