Introduction
This document is a guide to help your team evaluate and implement the ach_debit transfer type. It covers what the ach_debit functionalities are, how to get set up, and the key steps to go from initial testing to production. Use it as a reference while you integrate. When makingPOST requests Brale requires an Idempotency-Key header to be included and used on retries. Read more about idempotency keys in Brale. Using ach-debits required your business to be fully onboarded, and branded ach_debits are a premium feature.
- Testnet Environment
- If users wants to first test the below endpoints on testnet, they will need to create API credentials that are scoped to testnet - please follow the below link for more information:
- Production Environment
- Partners can leverage mainnet APIs by using their mainnet API keys generated in the Brale Portal.
End Customer Account Creation
-
Here is an example of how to get your account_id - Managed account model: where Partner’s end users can create an account under Partner account, where Partner will have access to those accounts. This will allow end users to view their account and transaction history for all onramp operations executed. The Partner will be able to execute onramp operations on behalf of the end users as well.
Create Plaid link token
-
The following request is an example of how to create a Plaid Token that you will need to use next section when setting up addresses for funding your transactions. Specifically, you will want to store the
link_tokenas this is the plaid token you will need to use in subsequent requests. -
Native mobile app considerations (Plaid Link):
Because Brale manages the Plaid client configuration, mobile Plaid OAuth is not fully self-serve. You must submit your platform-specific values to Brale so they can be whitelisted before mobile Plaid OAuth will work.
Your backend should create the
link_token. Your mobile app uses thelink_tokento initialize Plaid Link. iOS:- Provide Brale with your iOS redirect URI. This must be an HTTPS universal link (e.g.,
https://example.com/plaid-redirect). Custom URL schemes are not supported for Plaid OAuth on iOS. - Your app must be configured for Universal Links so the redirect returns the user to your app after they complete the bank login.
- Provide Brale with your Android package name (
android_package_name, i.e., theapplicationIdfrom your app’s build configuration). - The package name you submit must exactly match your app’s configuration. A mismatch will prevent Plaid from redirecting back to your app.
- Brale whitelist not completed — confirm Brale has approved your redirect URI or package name.
- iOS Universal Link misconfigured — verify your app’s Associated Domains entitlement and
apple-app-site-associationfile are set up correctly. - Android package name mismatch — ensure the
android_package_namesubmitted to Brale matches your app’sapplicationId. - App configuration does not match the submitted value — double-check that the value registered with Brale exactly matches what your app is using at runtime.
- Provide Brale with your iOS redirect URI. This must be an HTTPS universal link (e.g.,
- Your backend should call the endpoint indicated by
callback_url(which is the Brale “register account” step) and pass thepublic_token(and your webhook URL, if applicable). This registers the bank account inside Brale and returns anaddress_idfor subsequent transfers.
Setup addresses (Funding)
- If the user wants to connect a financial institution to fund their stablecoin with, they will need to create an external address for it. The same goes for funding stablecoins with existing digital assets from an external wallet. When transferring to an external address (on-chain wallet or off-chain bank account), use:
-
POST /accounts/{account_id}/addresses/external -
Include an
Idempotency-Keyheader and a JSON body. Examples: On-chain wallet (e.g., Solana) request body example:Off-chain bank account request example:- Partner will need to create a form that requests this information from end users to provide the below data
- Once the below data has been recorded, Brale will generate a “Address ID” that corresponds to the financial institution OR the external wallet, and for any future debit operations we will reference the “Address ID”. Create off-chain external address:
Requesting Mint/On-ramping
- At this stage your end users’ accounts should already be connected, where Brale will execute debits and mint to desired stablecoins from the process below:
-
You will need to call the following below endpoints with the relevant data to be able to execute a
swapor atransfer.- Transfer - Fiat to Stablecoin Transfer scenarios:
Transfer scenarios: understanding value_type and transfer_type
https://api.brale.xyz/accounts/account_id/transfersUSDCtoSBCrequest body example: