Skip to main content
A rule-based account is an additional account number for an account holder, with a routing rule attached. Every payment that settles into it is attributed to that account and then swept to the rule’s destination. Issue one account per payer, invoice, or use case, and you can reconcile incoming payments by the account they arrived at instead of matching on remittance text. Rule-based accounts never hold a balance. Funds that land in one are always moved on, either to the rule’s destination or, if the sweep can’t complete, to the account holder’s own internal account in the same currency.

Supported currencies

Prerequisites

  • The account holder already has an internal account in the same currency. Funds go there when a sweep can’t be completed.
  • The account holder is verified. For a platform-owned account, your platform’s own customer record must be verified.
  • The sweep destination exists. It can be an external account or another internal account, but not another rule-based account.

Create a rule-based account

Call POST /internal-accounts with type: RULE_BASED, the currency, and a sweepRule. Omit customerId to create an account owned by your platform.
Always send an Idempotency-Key. Each request issues a new account number or address that can’t be reversed, so the key is what keeps a retry from creating a second one.
Sweep every incoming dollar payment to the customer’s external bank account over ACH:
The response is the new internal account. Share its fundingPaymentInstructions with the payer: a bank account number for USD, or one wallet address per network for USDC and USDT. If the account’s status is PENDING, wait for ACTIVE before sharing them.

Configure the sweep rule

When you read the account, sweepRule.minimumAmount and sweepRule.maximumAmount show the range the route to the destination can carry, in the rule-based account’s currency.

Track sweeps

Each sweep appears as a transaction with ruleBasedAccountId set to the rule-based account that received the deposit. Its source describes the depositor when it’s known. A sweep that can’t be completed fails with one of these reasons, and the funds move to the account holder’s own internal account in the same currency:
  • SWEEP_AMOUNT_OUT_OF_RANGE: The amount is below minimumAmount or above maximumAmount.
  • SWEEP_QUOTE_FAILED: Grid couldn’t price the sweep.
A sweep that was priced and then failed on the way to settlement reports QUOTE_EXECUTION_FAILED, the same as any other payment. Include it alongside the SWEEP_* reasons when you monitor for failed sweeps. To list an account holder’s rule-based accounts, filter internal accounts with type=RULE_BASED.

Test in sandbox

In sandbox, account numbers and addresses are generated locally. Call POST /sandbox/internal-accounts/{accountId}/fund on a rule-based account to simulate a settled deposit. It triggers the sweep exactly as a real deposit would. Fund a very small amount to test the SWEEP_AMOUNT_OUT_OF_RANGE path.

Next steps