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.

    • Works in the sandbox only (https://api.sandbox.astrada.co), for clearing test data between runs. Production has no delete call: there you deactivate card subscriptions with PATCH. Deletes a subaccount and everything under it, and cannot be undone. Its bank links (with their bank accounts, bank transactions and matches) go first, then every card subscription, card, cardholder, stored token, transaction, network bulk feed and webhook of the subaccount. The call returns when the delete has finished: 204 when it is done, 502 when a step failed. Retrying a failed delete is always safe: completed steps are skipped on replay. Delete subaccount (sandbox only)

      Parameters

      Returns Promise<void>

    • Works in the sandbox only (https://api.sandbox.astrada.co), for clearing test data between runs. Production has no delete call: there you deactivate card subscriptions with PATCH. Deletes a subaccount and everything under it, and cannot be undone. Its bank links (with their bank accounts, bank transactions and matches) go first, then every card subscription, card, cardholder, stored token, transaction, network bulk feed and webhook of the subaccount. The call returns when the delete has finished: 204 when it is done, 502 when a step failed. Retrying a failed delete is always safe: completed steps are skipped on replay. Delete subaccount (sandbox only)

      Parameters

      Returns Promise<ApiResponse<void>>

    • 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>