Mercury: Get all auto-transfer rules
Mercury autoTransferRules.getAutoTransferRules: arguments, response, policy and SDK examples.
← Auto transfer rules operations · Get started
Operation mercury.getautotransferrules
Provider route: GET /auto-transfer-rules. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/mercury with npm, or alter-sdk-mercury with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { MercuryIntegration } from "@alter-ai/mercury";
async function execute(input: Parameters<MercuryIntegration["autoTransferRules"]["getAutoTransferRules"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new MercuryIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.autoTransferRules.getAutoTransferRules(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_mercury import MercuryIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = MercuryIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.auto_transfer_rules.get_auto_transfer_rules(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | object | Optional | Additional keys: not allowed |
query.accountId | string | Optional | ID for a Mercury account. Format: uuid |
query.limit | integer | Optional | Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000 Default: 1000 Format: int64 Maximum: 1000 Minimum: 1 |
query.start_after | string | Optional | The ID of the auto-transfer rule to start the page after (exclusive). When provided, results will begin with the auto-transfer rule immediately following this ID. Use this for standard forward pagination to get the next page of results. Cannot be combined with end_before. Format: uuid |
query.end_before | string | Optional | The ID of the auto-transfer rule to end the page before (exclusive). When provided, results will end just before this ID and work backwards. Use this for reverse pagination or to retrieve previous pages. Cannot be combined with start_after. Format: uuid |
query.order | string | Optional | Sort order. Can be ‘asc’ or ‘desc’. Defaults to ‘asc’ Default: asc One of: asc, desc |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Get all auto-transfer rules — response body |
Referenced models: Get all auto-transfer rules — response body
Schemas
Section titled “Schemas”1 more schema is linked from the tables above, on the schema pages.
Get all auto-transfer rules — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A page of the organization's active auto-transfer rules. |
page | object | Required within parent | Cursors for navigating to the next and previous pages. |
page.nextPage | string | Optional | Format: uuid |
page.previousPage | string | Optional | Format: uuid |
rules | array | Required within parent | Rules in the current page. |
rules[] | Model | Each item | Expand Get all auto-transfer rules — response body — rules item |
Referenced models: Get all auto-transfer rules — response body — rules item
Get all auto-transfer rules — response body — rules item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | An active auto-transfer rule. |
controlledAccountId | JSON | Required within parent | |
controlledAccountId (allOf 1) | string | All variants apply | ID for a Mercury account. Format: uuid |
controlledAccountId (allOf 2) | JSON | All variants apply | The account whose balance the rule manages. |
description | string | Required within parent | A sentence describing what the rule does. |
details | JSON | Required within parent | |
details (allOf 1) | Model | All variants apply | Expand Get all auto-transfer rules — response body — rules item details value |
details (allOf 2) | JSON | All variants apply | The rule's kind and its kind-specific details. |
frequency | string | Required within parent | How often the rule runs, e.g. "Every business day". |
id | JSON | Required within parent | |
id (allOf 1) | string | All variants apply | Format: uuid |
id (allOf 2) | JSON | All variants apply | The rule's ID. Editing a rule replaces it with a new version that has a new ID. |
isPaused | boolean | Required within parent | Whether the rule is paused. |
name | string | Required within parent | The rule's name, as shown in the Mercury dashboard. |
nextTransferAt | JSON | Optional | |
nextTransferAt (anyOf 1) | JSON | Alternative | |
nextTransferAt (anyOf 1) (allOf 1) | string | All variants apply | Format: yyyy-mm-ddThh:MM:ssZ |
nextTransferAt (anyOf 1) (allOf 2) | JSON | All variants apply | When the rule next runs, if scheduled. |
nextTransferAt (anyOf 2) | null | Alternative | |
nickname | JSON | Optional | |
nickname (anyOf 1) | string | Alternative | A nickname the user gave the rule, if any. |
nickname (anyOf 2) | null | Alternative |
Referenced models: Get all auto-transfer rules — response body — rules item details value
Get all auto-transfer rules — response body — rules item details value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | object | Alternative | |
$ (anyOf 1).contents | Model | Required within parent | Expand Get all auto-transfer rules — response body — rules / item / details / value / kind: distribute Amount contents |
$ (anyOf 1).kind | string | Required within parent | Known values: distributeAmount |
$ (anyOf 2) | object | Alternative | |
$ (anyOf 2).contents | Model | Required within parent | Expand Get all auto-transfer rules — response body — rules / item / details / value / kind: distribute Percentage contents |
$ (anyOf 2).kind | string | Required within parent | Known values: distributePercentage |
$ (anyOf 3) | object | Alternative | |
$ (anyOf 3).contents | Model | Required within parent | Expand Get all auto-transfer rules — response body — rules / item / details / value / kind: maintain Target Balance contents |
$ (anyOf 3).kind | string | Required within parent | Known values: maintainTargetBalance |
Referenced models: Get all auto-transfer rules — response body — rules / item / details / value / kind: distribute Amount contents, Get all auto-transfer rules — response body — rules / item / details / value / kind: distribute Percentage contents, Get all auto-transfer rules — response body — rules / item / details / value / kind: maintain Target Balance contents
Get all auto-transfer rules — response body — rules / item / details / value / kind: distribute Amount contents
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Distributes fixed amounts from the controlled account to one or more reservoir accounts. |
reservoirAccounts | array | Required within parent | The reservoir accounts and the amount each receives. |
reservoirAccounts[] | Model | Each item | Expand Get all auto-transfer rules — response body — rules / item / details / value / kind: distribute Amount contents reservoir Accounts item |
Referenced models: Get all auto-transfer rules — response body — rules / item / details / value / kind: distribute Amount contents reservoir Accounts item
Get all auto-transfer rules — response body — rules / item / details / value / kind: distribute Percentage contents
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Distributes a percentage of the controlled account's balance to one or more reservoir accounts. |
reservoirAccounts | array | Required within parent | The reservoir accounts and the percentage each receives. |
reservoirAccounts[] | Model | Each item | Expand Get all auto-transfer rules — response body — rules / item / details / value / kind: distribute Percentage contents reservoir Accounts item |
Referenced models: Get all auto-transfer rules — response body — rules / item / details / value / kind: distribute Percentage contents reservoir Accounts item
Get all auto-transfer rules — response body — rules / item / details / value / kind: maintain Target Balance contents
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Keeps the controlled account's balance near a target by moving money between it and a reservoir account. When the balance moves outside the bounds, the rule moves exactly enough money to bring it back to targetBalance. A rule with both bounds equal to targetBalance moves money whenever the balance differs from the target. |
lowerBound | JSON | Optional | |
lowerBound (anyOf 1) | JSON | Alternative | |
lowerBound (anyOf 1) (allOf 1) | Model | All variants apply | Expand Create a product — response body — unit Price value |
lowerBound (anyOf 1) (allOf 2) | JSON | All variants apply | When the controlled account's balance falls below this, money moves in from the reservoir account. Omitted when the rule never moves money in. |
lowerBound (anyOf 2) | null | Alternative | |
reservoirAccountId | JSON | Required within parent | |
reservoirAccountId (allOf 1) | string | All variants apply | ID for a Mercury account. Format: uuid |
reservoirAccountId (allOf 2) | JSON | All variants apply | The reservoir account money is moved to or from. |
targetBalance | JSON | Required within parent | |
targetBalance (allOf 1) | Model | All variants apply | Expand Create a product — response body — unit Price value |
targetBalance (allOf 2) | JSON | All variants apply | The balance the rule brings the controlled account back to. Never below lowerBound or above upperBound. |
upperBound | JSON | Optional | |
upperBound (anyOf 1) | JSON | Alternative | |
upperBound (anyOf 1) (allOf 1) | Model | All variants apply | Expand Create a product — response body — unit Price value |
upperBound (anyOf 1) (allOf 2) | JSON | All variants apply | When the controlled account's balance rises above this, money moves out to the reservoir account. Omitted when the rule never moves money out. |
upperBound (anyOf 2) | null | Alternative |
Referenced models: Create a product — response body — unit Price value
Get all auto-transfer rules — response body — rules / item / details / value / kind: distribute Amount contents reservoir Accounts item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A reservoir account and the fixed amount a distribute rule moves to it. |
accountId | JSON | Required within parent | |
accountId (allOf 1) | string | All variants apply | ID for a Mercury account. Format: uuid |
accountId (allOf 2) | JSON | All variants apply | The reservoir account. |
amount | JSON | Required within parent | |
amount (allOf 1) | Model | All variants apply | Expand Create a product — response body — unit Price value |
amount (allOf 2) | JSON | All variants apply | The amount moved to this account each time the rule runs. |
Referenced models: Create a product — response body — unit Price value
Create a product — response body — unit Price value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | number | Alternative | A dollar amount Format: double |
$ (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: mercury.getautotransferrules. Catalog operation: mercury:getAutoTransferRules. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.