Creates a new bank link to initiate a bank enrollment. The response includes a hostedLink URL where the user can connect their bank account via Plaid. The hosted link expires after 4 hours. If the link expires before the user completes enrollment, retrieve the bank link via GET /bank-links/{bankLinkId} to get a refreshed URL. Creating a bank link with an ID that already exists for the account will return a 409 Conflict error, unless the existing link has expired. A refused create returns a JSON body with statusCode and message. These errors also carry a code, a stable name to branch on so that you never match on message text (the 409 above has no code): - 404 SUBACCOUNT_NOT_FOUND: subaccountId is not one of the account's subaccounts. Nothing is created. The message is Subaccount not found for this account. - 403 BANK_ENROLLMENT_DISABLED: a create is refused when the account has locked bank enrollment (enrollmentPolicy.bankEnrollmentLocked is true on the subaccount) and the subaccount's enrollmentPolicy.bankEnrollment value does not allow a bank link for this card. Otherwise the check does not refuse. Nothing is created. The message is Bank linking is not enabled for this card on this account. The body also has a reason: bank-enrollment-off when the setting is off, network-not-allowed when it does not allow the card's network, and network-unknown when it limits the networks and the request does not show the card's network. The card's network comes from the request: American Express when the link uses the amex_only customization, otherwise bin6 (a first digit of 4 is Visa, 2 or 5 is Mastercard, and any other digit, a 3 included, is unknown). Without bin6 it is unknown. - 403 MASTERCARD_CLIENT_NOT_PROVISIONED and PLAID_EC_NOT_PROVISIONED: the account is not set up for bank linking on that provider yet. The messages are This account is not set up for Mastercard bank linking yet and This account is not set up for Plaid bank linking yet. - 403 PLAID_CUSTOMIZATION_NOT_PROVISIONED: Plaid refused the Link customization this link asked for, because the account's Plaid client cannot use it, and no fallback applied. Nothing is created. The message is This account is not fully set up for Plaid bank linking yet. A customization other than amex_only (one set by the bank-linking policy's plaidLinkCustomizationName) answers this at once. When Plaid refuses amex_only, from filters.linkCustomizationName or from the policy, the create is retried once with the environment's pinned customization in its place, or with no customization when the environment pins none. If Plaid accepts the retry, the link is created as usual: its hosted session opens without the amex_only customization, and its completion is still held to American Express institutions. For amex_only, only a refused retry answers this error. Astrada fixes it in the account's Plaid setup, so sending the same request again does not help. - 400 INVALID_LINK_FILTERS: filters asks for more than the account's bank-linking policy allows, or for a customization that is not allowed. - 400 PROVIDER_NOT_ENABLED_FOR_ACCOUNT: provider is not enabled for the account. - 400 PROVIDER_NOT_SUPPORTED_FOR_COUNTRY: no provider supports countryCode for the chosen provider. - 503 BANK_FEED_OWNER_NOT_CONFIGURED: persona: cardholder in an environment where cardholder links are not set up yet. Nothing is created; a link without persona: cardholder still works. The message is Cardholder bank linking is not available yet. A body that breaks the field formats (for example an empty accountTypes or a lower-case countryCode) answers 400 with message Bad Request and an errors list naming each field, and no code.
Create bank link
OptionalinitOverrides: RequestInit | InitOverrideFunctionCreates a new bank link to initiate a bank enrollment. The response includes a hostedLink URL where the user can connect their bank account via Plaid. The hosted link expires after 4 hours. If the link expires before the user completes enrollment, retrieve the bank link via GET /bank-links/{bankLinkId} to get a refreshed URL. Creating a bank link with an ID that already exists for the account will return a 409 Conflict error, unless the existing link has expired. A refused create returns a JSON body with statusCode and message. These errors also carry a code, a stable name to branch on so that you never match on message text (the 409 above has no code): - 404 SUBACCOUNT_NOT_FOUND: subaccountId is not one of the account's subaccounts. Nothing is created. The message is Subaccount not found for this account. - 403 BANK_ENROLLMENT_DISABLED: a create is refused when the account has locked bank enrollment (enrollmentPolicy.bankEnrollmentLocked is true on the subaccount) and the subaccount's enrollmentPolicy.bankEnrollment value does not allow a bank link for this card. Otherwise the check does not refuse. Nothing is created. The message is Bank linking is not enabled for this card on this account. The body also has a reason: bank-enrollment-off when the setting is off, network-not-allowed when it does not allow the card's network, and network-unknown when it limits the networks and the request does not show the card's network. The card's network comes from the request: American Express when the link uses the amex_only customization, otherwise bin6 (a first digit of 4 is Visa, 2 or 5 is Mastercard, and any other digit, a 3 included, is unknown). Without bin6 it is unknown. - 403 MASTERCARD_CLIENT_NOT_PROVISIONED and PLAID_EC_NOT_PROVISIONED: the account is not set up for bank linking on that provider yet. The messages are This account is not set up for Mastercard bank linking yet and This account is not set up for Plaid bank linking yet. - 403 PLAID_CUSTOMIZATION_NOT_PROVISIONED: Plaid refused the Link customization this link asked for, because the account's Plaid client cannot use it, and no fallback applied. Nothing is created. The message is This account is not fully set up for Plaid bank linking yet. A customization other than amex_only (one set by the bank-linking policy's plaidLinkCustomizationName) answers this at once. When Plaid refuses amex_only, from filters.linkCustomizationName or from the policy, the create is retried once with the environment's pinned customization in its place, or with no customization when the environment pins none. If Plaid accepts the retry, the link is created as usual: its hosted session opens without the amex_only customization, and its completion is still held to American Express institutions. For amex_only, only a refused retry answers this error. Astrada fixes it in the account's Plaid setup, so sending the same request again does not help. - 400 INVALID_LINK_FILTERS: filters asks for more than the account's bank-linking policy allows, or for a customization that is not allowed. - 400 PROVIDER_NOT_ENABLED_FOR_ACCOUNT: provider is not enabled for the account. - 400 PROVIDER_NOT_SUPPORTED_FOR_COUNTRY: no provider supports countryCode for the chosen provider. - 503 BANK_FEED_OWNER_NOT_CONFIGURED: persona: cardholder in an environment where cardholder links are not set up yet. Nothing is created; a link without persona: cardholder still works. The message is Cardholder bank linking is not available yet. A body that breaks the field formats (for example an empty accountTypes or a lower-case countryCode) answers 400 with message Bad Request and an errors list naming each field, and no code.
Create bank link
OptionalinitOverrides: RequestInit | InitOverrideFunctionNeeds banking:admin. If your API client does not have the banking:admin scope, the API answers 403
and this method throws ScopeRequiredError; ask Astrada to enable it if you need this operation.
Needs the banking:admin scope. If your API client does not have it, the API answers 403 Forbidden; ask Astrada to enable it if you need this operation. Deletes a bank link and all associated resources, including the bank subscription, bank accounts, and bank transactions. Cards are not deleted. A bank-feed subscription created at completion is deactivated; a card enrolled by its number only loses its bank account. Each still-active account sends bankaccount.state_changed, and each changed subscription sends cardsubscription.updated. Note: This action is irreversible and will revoke access to the connected financial institution.
Delete bank link
OptionalinitOverrides: RequestInit | InitOverrideFunctionNeeds banking:admin. If your API client does not have the banking:admin scope, the API answers 403
and this method throws ScopeRequiredError; ask Astrada to enable it if you need this operation.
Needs the banking:admin scope. If your API client does not have it, the API answers 403 Forbidden; ask Astrada to enable it if you need this operation. Deletes a bank link and all associated resources, including the bank subscription, bank accounts, and bank transactions. Cards are not deleted. A bank-feed subscription created at completion is deactivated; a card enrolled by its number only loses its bank account. Each still-active account sends bankaccount.state_changed, and each changed subscription sends cardsubscription.updated. Note: This action is irreversible and will revoke access to the connected financial institution.
Delete bank link
OptionalinitOverrides: RequestInit | InitOverrideFunctionReturns detailed information about a specific bank link by its identifier. If the bank link is in pending state and the hosted link URL has expired, this endpoint will automatically refresh the URL and return the updated link. Once the user has finished the hosted flow, a read of the link answers completed: the link completes without a PATCH from you.
Retrieve bank link
OptionalinitOverrides: RequestInit | InitOverrideFunctionReturns detailed information about a specific bank link by its identifier. If the bank link is in pending state and the hosted link URL has expired, this endpoint will automatically refresh the URL and return the updated link. Once the user has finished the hosted flow, a read of the link answers completed: the link completes without a PATCH from you.
Retrieve bank link
OptionalinitOverrides: RequestInit | InitOverrideFunctionProtectedisCheck if the given MIME is a JSON MIME. JSON MIME examples: application/json application/json; charset=UTF8 APPLICATION/JSON application/vnd.company+json
MIME (Multipurpose Internet Mail Extensions)
True if the given MIME is JSON, false otherwise.
Returns a list of bank links under the account. By default, GET /bank-links returns bank links ordered by the latest createdAt. This endpoint supports cursor-based pagination.
List bank links
OptionalinitOverrides: RequestInit | InitOverrideFunctionReturns a list of bank links under the account. By default, GET /bank-links returns bank links ordered by the latest createdAt. This endpoint supports cursor-based pagination.
List bank links
OptionalinitOverrides: RequestInit | InitOverrideFunctionProtectedrequestSends 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.
OptionalinitOverrides: RequestInit | InitOverrideFunctionNeeds banking:admin. If your API client does not have the banking:admin scope, the API answers 403
and this method throws ScopeRequiredError; ask Astrada to enable it if you need this operation.
Needs the banking:admin scope. If your API client does not have it, the API answers 403 Forbidden; ask Astrada to enable it if you need this operation. Triggers a manual sync of transactions for the bank link's associated subscription. This fetches the latest transactions from the financial institution. Transaction syncs also occur automatically via provider webhooks and scheduled jobs. Use this endpoint to force an immediate sync when needed. While another sync of the same connection is running, this call answers 200 and syncs nothing; send it again shortly. When the bank is temporarily unavailable it answers 503.
Sync bank link
OptionalinitOverrides: RequestInit | InitOverrideFunctionNeeds banking:admin. If your API client does not have the banking:admin scope, the API answers 403
and this method throws ScopeRequiredError; ask Astrada to enable it if you need this operation.
Needs the banking:admin scope. If your API client does not have it, the API answers 403 Forbidden; ask Astrada to enable it if you need this operation. Triggers a manual sync of transactions for the bank link's associated subscription. This fetches the latest transactions from the financial institution. Transaction syncs also occur automatically via provider webhooks and scheduled jobs. Use this endpoint to force an immediate sync when needed. While another sync of the same connection is running, this call answers 200 and syncs nothing; send it again shortly. When the bank is temporarily unavailable it answers 503.
Sync bank link
OptionalinitOverrides: RequestInit | InitOverrideFunctionCompletes a bank link enrollment, transitioning it from pending to completed state. The request body must contain state: \"completed\". When a bank link is completed, the system exchanges the enrollment credentials with the provider, creates a bank subscription (connection), and discovers the associated bank accounts. A link that is no longer pending answers 409; read it with GET /bank-links/{bankLinkId}. The PATCH response echoes the bank link record only. The discovered bankAccounts (with each account's cardIds and any minted cards) are returned by GET /bank-links/{bankLinkId}, not by this PATCH.
Complete bank link
OptionalinitOverrides: RequestInit | InitOverrideFunctionCompletes a bank link enrollment, transitioning it from pending to completed state. The request body must contain state: \"completed\". When a bank link is completed, the system exchanges the enrollment credentials with the provider, creates a bank subscription (connection), and discovers the associated bank accounts. A link that is no longer pending answers 409; read it with GET /bank-links/{bankLinkId}. The PATCH response echoes the bank link record only. The discovered bankAccounts (with each account's cardIds and any minted cards) are returned by GET /bank-links/{bankLinkId}, not by this PATCH.
Complete bank link
OptionalinitOverrides: RequestInit | InitOverrideFunction
The middleware of this instance; protected so hand-written subclasses can pass it on.