Class SubaccountsClient

java.lang.Object
com.vonage.client.subaccounts.SubaccountsClient

public class SubaccountsClient extends Object
  • Constructor Details

    • SubaccountsClient

      public SubaccountsClient(HttpWrapper wrapper)
      Constructor.
      Parameters:
      wrapper - (REQUIRED) shared HTTP wrapper object used for making REST calls.
  • Method Details

    • createSubaccount

      Create a new subaccount under this API primary account.
      Parameters:
      request - Properties for the new subaccount.
      Returns:
      Details of the created subaccount.
      Throws:
      SubaccountsResponseException - If the request was unsuccessful. This could be for the following reasons:
      • 401: Credential is missing or invalid.
      • 403: Action is forbidden.
      • 404: The account ID provided does not exist in our system or you do not have access.
      • 422: Validation error.
    • updateSubaccount

      Change one or more properties of a subaccount.
      Parameters:
      request - Properties of the subaccount to update.
      Returns:
      Details of the updated subaccount.
      Throws:
      SubaccountsResponseException - If the request was unsuccessful. This could be for the following reasons:
      • 401: Credential is missing or invalid.
      • 403: Action is forbidden.
      • 404: The account ID provided does not exist in our system or you do not have access.
      • 422: Validation error.
    • listSubaccounts

      Retrieve all subaccounts owned by the primary account.
      Returns:
      The primary account details and list of subaccounts associated with it.
      Throws:
      SubaccountsResponseException - If the request was unsuccessful. This could be for the following reasons:
      • 401: Credential is missing or invalid.
      • 403: Action is forbidden.
      • 404: The account ID provided does not exist in our system or you do not have access.
    • getSubaccount

      public Account getSubaccount(String subaccountApiKey)
      Get information about a specific subaccount.
      Parameters:
      subaccountApiKey - Unique ID of the subaccount to retrieve.
      Returns:
      Details of the requested subaccount.
      Throws:
      SubaccountsResponseException - If the request was unsuccessful. This could be for the following reasons:
      • 401: Credential is missing or invalid.
      • 403: Action is forbidden.
      • 404: The account ID provided does not exist in our system or you do not have access.
    • listCreditTransfers

      Retrieve a list of credit transfers that have taken place for the primary account within a specified time period.
      Returns:
      The list of credit transfers.
      Throws:
      SubaccountsResponseException - If the request was unsuccessful. This could be for the following reasons:
      • 401: Credential is missing or invalid.
      • 403: Action is forbidden.
      • 404: The account ID provided does not exist in our system or you do not have access.
      See Also:
    • listCreditTransfers

      Retrieve a list of credit transfers that have taken place for the primary account within a specified time period.
      Parameters:
      filter - Additional parameters to narrow down the returned list by.
      Returns:
      The list of credit transfers.
      Throws:
      SubaccountsResponseException - If the request was unsuccessful. This could be for the following reasons:
      • 401: Credential is missing or invalid.
      • 403: Action is forbidden.
      • 404: The account ID provided does not exist in our system or you do not have access.
      See Also:
    • listBalanceTransfers

      Retrieve a list of balance transfers that have taken place for the primary account within a specified time period.
      Returns:
      The list of balance transfers.
      Throws:
      SubaccountsResponseException - If the request was unsuccessful. This could be for the following reasons:
      • 401: Credential is missing or invalid.
      • 403: Action is forbidden.
      • 404: The account ID provided does not exist in our system or you do not have access.
      See Also:
    • listBalanceTransfers

      Retrieve a list of balance transfers that have taken place for the primary account within a specified time period.
      Parameters:
      filter - Additional parameters to narrow down the returned list by.
      Returns:
      The list of balance transfers.
      Throws:
      SubaccountsResponseException - If the request was unsuccessful. This could be for the following reasons:
      • 401: Credential is missing or invalid.
      • 403: Action is forbidden.
      • 404: The account ID provided does not exist in our system or you do not have access.
      See Also:
    • transferCredit

      Transfer credit limit between the primary account and one of its subaccounts.
      Parameters:
      request - Properties of the credit transfer.
      Returns:
      Details of the transfer if successful.
      Throws:
      SubaccountsResponseException - If the request was unsuccessful. This could be for the following reasons:
      • 401: Credential is missing or invalid.
      • 403: Action is forbidden.
      • 404: The account ID provided does not exist in our system or you do not have access.
      • 422: Validation error.
    • transferBalance

      Transfer balance between the primary account and one of its subaccounts.
      Parameters:
      request - Properties of the balance transfer.
      Returns:
      Details of the transfer if successful.
      Throws:
      SubaccountsResponseException - If the request was unsuccessful. This could be for the following reasons:
      • 401: Credential is missing or invalid.
      • 403: Action is forbidden.
      • 404: The account ID provided does not exist in our system or you do not have access.
      • 422: Validation error.
    • transferNumber

      Transfer a number between subaccounts.
      Parameters:
      request - Properties of the number transfer.
      Returns:
      Details of the transfer if successful.
      Throws:
      SubaccountsResponseException - If the request was unsuccessful. This could be for the following reasons:
      • 401: Credential is missing or invalid.
      • 403: Action is forbidden.
      • 404: The account ID provided does not exist in our system or you do not have access.
      • 409: Transfer conflict.
      • 422: Validation error.