Astrada TypeScript SDK
    Preparing search index...

    Class SubaccountsApi

    Hierarchy (View Summary)

    Index
    configuration: Configuration
    middleware: Middleware[]

    The middleware of this instance; protected so hand-written subclasses can pass it on.

    • Creates a new subaccount, allowing you to set network and regional configurations. Each network's countries can be set to either an array of specific ISO 3166 alpha-3 country codes, or the string \"*\" to inherit all countries from the parent account's capabilities for that network. When using \"*\", the subaccount will automatically reflect the parent account's current country list. If the parent account's capabilities change, subaccounts configured with \"*\" will inherit the updated countries. The single and bulk enrollment configurations are optional. Countries are set per network: each one's country list is the network's countries, limited to the countries the account allows for that way of enrolling. The supported card types for single and bulk enrollment is CONSUMER, while the supported funding card types is DEBIT. If not provided, the block rules for both card types will default to the parent account's default block rule for that network and enrollment level. A list you send is combined with the account's defaults, so it can add blocks but never remove one of the account's defaults. Visa consumer debit and prepaid cards are blocked at the network level regardless of these settings; see networkBlockedCards on the subaccount. To set the default rule on the parent account, please reach out to your account manager or support. Create subaccount

      Parameters

      Returns Promise<Subaccount>

    • Creates a new subaccount, allowing you to set network and regional configurations. Each network's countries can be set to either an array of specific ISO 3166 alpha-3 country codes, or the string \"*\" to inherit all countries from the parent account's capabilities for that network. When using \"*\", the subaccount will automatically reflect the parent account's current country list. If the parent account's capabilities change, subaccounts configured with \"*\" will inherit the updated countries. The single and bulk enrollment configurations are optional. Countries are set per network: each one's country list is the network's countries, limited to the countries the account allows for that way of enrolling. The supported card types for single and bulk enrollment is CONSUMER, while the supported funding card types is DEBIT. If not provided, the block rules for both card types will default to the parent account's default block rule for that network and enrollment level. A list you send is combined with the account's defaults, so it can add blocks but never remove one of the account's defaults. Visa consumer debit and prepaid cards are blocked at the network level regardless of these settings; see networkBlockedCards on the subaccount. To set the default rule on the parent account, please reach out to your account manager or support. Create subaccount

      Parameters

      Returns Promise<ApiResponse<Subaccount>>

    • Returns detailed information about a specific subaccount by its identifier, including configuration details and associated data. _links.team-link appears when enrollment links are enabled for the account, the token holds card-subscriptions:write or subaccounts:write, and the subaccount's card enrollment is on (its enrollmentPolicy.cardEnrollment is not false). It points to POST /subaccounts/{subaccountId}/team-link, which creates a team link for the subaccount. An enrollment link session's token never gets it. Retrieve subaccount

      Parameters

      Returns Promise<Subaccount>

    • Returns detailed information about a specific subaccount by its identifier, including configuration details and associated data. _links.team-link appears when enrollment links are enabled for the account, the token holds card-subscriptions:write or subaccounts:write, and the subaccount's card enrollment is on (its enrollmentPolicy.cardEnrollment is not false). It points to POST /subaccounts/{subaccountId}/team-link, which creates a team link for the subaccount. An enrollment link session's token never gets it. Retrieve subaccount

      Parameters

      Returns Promise<ApiResponse<Subaccount>>

    • Check if the given MIME is a JSON MIME. JSON MIME examples: application/json application/json; charset=UTF8 APPLICATION/JSON application/vnd.company+json

      Parameters

      • mime: string

        MIME (Multipurpose Internet Mail Extensions)

      Returns boolean

      True if the given MIME is JSON, false otherwise.

    • Sends the request. Network errors and timeouts (while waiting for the answer or reading its body), 408, 429 and 5xx are retried for idempotent methods (see ConfigurationParameters.maxRetries). A 401 is retried once with a new token. Any other status outside 200 to 299 throws a ResponseError subclass. The body is read here, whole.

      Parameters

      Returns Promise<Response>

    • Update a subaccount name and configurations. All updated configurations are validated against the capabilities of the main account to ensure compliance. It is possible to add new networks and/or regions but it is not possible to remove any configurations that were previously set. configurations replaces the whole object: send every network the subaccount has (a network left out is refused with Delete a configuration is not supported.), and every block list you want to keep (a block list left out goes back to the account's default). Each network's countries can be set to either an array of specific ISO 3166 alpha-3 country codes, or the string \"*\" to inherit all countries from the parent account's capabilities for that network. When using \"*\", the subaccount will automatically reflect the parent account's current country list. If the parent account's capabilities change, subaccounts configured with \"*\" will inherit the updated countries. The single and bulk enrollment configurations are optional. Countries are set per network: each one's country list is the network's countries, limited to the countries the account allows for that way of enrolling. The supported card types for single and bulk enrollment is CONSUMER, while the supported funding card types is DEBIT. If not provided, the block rules for both card types will default to the parent account's default block rule for that network and enrollment level. A list you send is combined with the account's defaults, so it can add blocks but never remove one of the account's defaults. Visa consumer debit and prepaid cards are blocked at the network level regardless of these settings; see networkBlockedCards on the subaccount. To set the default rule on the parent account, please reach out to your account manager or support. Update subaccount configurations

      Parameters

      Returns Promise<SubaccountUpdateResult>

    • Update a subaccount name and configurations. All updated configurations are validated against the capabilities of the main account to ensure compliance. It is possible to add new networks and/or regions but it is not possible to remove any configurations that were previously set. configurations replaces the whole object: send every network the subaccount has (a network left out is refused with Delete a configuration is not supported.), and every block list you want to keep (a block list left out goes back to the account's default). Each network's countries can be set to either an array of specific ISO 3166 alpha-3 country codes, or the string \"*\" to inherit all countries from the parent account's capabilities for that network. When using \"*\", the subaccount will automatically reflect the parent account's current country list. If the parent account's capabilities change, subaccounts configured with \"*\" will inherit the updated countries. The single and bulk enrollment configurations are optional. Countries are set per network: each one's country list is the network's countries, limited to the countries the account allows for that way of enrolling. The supported card types for single and bulk enrollment is CONSUMER, while the supported funding card types is DEBIT. If not provided, the block rules for both card types will default to the parent account's default block rule for that network and enrollment level. A list you send is combined with the account's defaults, so it can add blocks but never remove one of the account's defaults. Visa consumer debit and prepaid cards are blocked at the network level regardless of these settings; see networkBlockedCards on the subaccount. To set the default rule on the parent account, please reach out to your account manager or support. Update subaccount configurations

      Parameters

      Returns Promise<ApiResponse<SubaccountUpdateResult>>