Worlds / Banking and brokerage
Treasury Prime API
A local Treasury Prime with bank accounts, counterparties, ACH, wires, book transfers and the transaction ledger. Test the treasury agent that moves money between accounts and handles returns.
- Base path
/- Auth
- Basic auth with API key id and secret, the world key
- Endpoints
- 14
- Status
- Active today
This reference previews the surface the Treasury Prime world serves in the closed beta. Paths mirror the public Treasury Prime API; the exact subset is confirmed when your workflow is scoped.
Connect
The run gives your agent these bindings. Keep your SDK; change only where it sends requests.
| binding | meaning |
|---|---|
WORLDS_TREASURY_PRIME_URL | This world's origin followed by / |
WORLDS_API_KEY | The world key, accepted wherever Treasury Prime expects a credential |
WORLDS_WORLD_ID | The isolated world's identity |
const base = process.env.WORLDS_TREASURY_PRIME_URL;
const headers = {
Authorization: "Basic " + Buffer.from("key:" + process.env.WORLDS_API_KEY).toString("base64"),
"Content-Type": "application/json",
};
const res = await fetch(base + "/account", { headers });
const { data } = await res.json();API reference
Accounts
Bank accounts with balances.
- GET
/accountList accounts - GET
/account/{id}Get an account - POST
/accountCreate an account - PATCH
/account/{id}Update an account
Fields · 5
id | string | Account id |
account_number | string | Account number |
available_balance | string | Available funds |
current_balance | string | Ledger balance |
status | string | open or closed |
ACH
ACH transfers in and out.
- POST
/achCreate an ACH transfer - GET
/ach/{id}Get an ACH transfer - PATCH
/ach/{id}Cancel an ACH transfer - GET
/achList ACH transfers
Fields · 5
id | string | ACH id |
amount | string | Amount |
direction | string | credit or debit |
status | string | pending, sent, settled, returned |
counterparty_id | string | Counterparty |
Counterparties
Outside accounts you send to or pull from.
- POST
/counterpartyCreate a counterparty - GET
/counterparty/{id}Get a counterparty - GET
/counterpartyList counterparties
Fields · 4
id | string | Counterparty id |
name_on_account | string | Account holder name |
routing_number | string | Routing number |
account_type | string | checking or savings |
Transactions
Account activity.
- GET
/transactionList transactions - GET
/transaction/{id}Get a transaction - GET
/account/{id}/transactionList transactions for an account
Fields · 5
id | string | Transaction id |
account_id | string | Account |
amount | string | Amount |
desc | string | Description |
date | string | Posted date |
Test workflow
- Prepare. Select the Treasury Prime setup for your workflow and review its starting records, including accounts, ach, counterparties.
- Connect. Configure your agent with this world's URL and key using the SDK example. Check that it reaches the intended API before running a test.
- Define. Describe the task, expected final changes and records that must stay untouched. Keep expected outcomes separate from the agent's instructions.
- Run and inspect. Use the dashboard or your workflow's generated CLI setup. Review final records and changes, then rerun from the same starting setup with the relevant failure conditions. Use Deployment and CI to automate the same workflow.
What to verify
- Exactly one ACH to Graybar Supply for $4,200.00
- Book transfer of $50,000 from 4021 to 4030
- Halvorsen wire still pending
- No new debit to Kito Retail
- Operating balance matches the ledger after the run
Test file
A task file names the jobs, the policy your agent is given and what the grader reads back from the world's final state. The agent never sees the expected outcomes.
# worlds/tasks.yaml · Treasury Prime
version: 2
connector: treasury-prime
seed: treasury-prime-starter
mode: isolated
policy: >
Pay Graybar Supply's $4,200 invoice by ACH once. Sweep $50,000 from
Operating to Reserve. Hold the Halvorsen wire until the beneficiary is
confirmed by phone.
tasks:
- id: originate-ach-payments-to-verified-counterparties
prompt: Originate ACH payments to verified counterparties
- id: send-a-wire-with-the-right-beneficiary-details
prompt: Send a wire with the right beneficiary details
- id: book-transfer-between-internal-accounts
prompt: Book transfer between internal accounts
expected:
- "Exactly one ACH to Graybar Supply for $4,200.00"
- "Book transfer of $50,000 from 4021 to 4030"
- Halvorsen wire still pending
- No new debit to Kito Retail
- Operating balance matches the ledger after the run
scenarios:
- insufficient-funds
- ach-return
- cutoff-missedSee Tasks and outcomes for every field, and Deployment and CI to run the file on every pull request.
Failure conditions
Each one fires before the handler, at the same step on every run.
| condition | what the agent sees |
|---|---|
insufficient-funds | An ACH is rejected for insufficient available balance |
ach-return | A debit returns with R01 two days later |
cutoff-missed | An ACH after the same day cutoff settles next business day |
rate-limited | API returns 429 on ledger reads |
Starting data
Start each run from the same records and relationships. The overview below describes the Treasury Prime starter; use the setup supplied for your workflow when preparing your own snapshot.
| Records | Starting setup |
|---|---|
| accounts | 12 operating and reserve accounts |
| counterparties | 45, 3 with unverified routing numbers |
| ACH | 220 across pending, processing, sent and returned |
| wires | 14 sent, 1 pending |
| transactions | Ledger of 3,000 entries |
The record shapes below reuse this world's API field definitions. They show illustrative values and placeholders, not an importable seed. API responses and seed input can differ; include all required records and references in the accepted import format for your workflow.
Accounts records
Accounts
Bank accounts with balances.
| Field | Type | Meaning / relationship |
|---|---|---|
id | string | Account id |
account_number | string | Account number |
available_balance | string | Available funds |
current_balance | string | Ledger balance |
status | string | open or closed |
{
"id": "<Account id>",
"account_number": "<Account number>",
"available_balance": "<Available funds>",
"current_balance": "<Ledger balance>",
"status": "<open or closed>"
}ACH records
ACH
ACH transfers in and out.
| Field | Type | Meaning / relationship |
|---|---|---|
id | string | ACH id |
amount | string | Amount |
direction | string | credit or debit |
status | string | pending, sent, settled, returned |
counterparty_id | string | Counterparty |
{
"id": "<ACH id>",
"amount": "<Amount>",
"direction": "<credit or debit>",
"status": "<pending, sent, settled, returned>",
"counterparty_id": "<Counterparty>"
}Counterparties records
Counterparties
Outside accounts you send to or pull from.
| Field | Type | Meaning / relationship |
|---|---|---|
id | string | Counterparty id |
name_on_account | string | Account holder name |
routing_number | string | Routing number |
account_type | string | checking or savings |
{
"id": "<Counterparty id>",
"name_on_account": "<Account holder name>",
"routing_number": "<Routing number>",
"account_type": "<checking or savings>"
}Transactions records
Transactions
Account activity.
| Field | Type | Meaning / relationship |
|---|---|---|
id | string | Transaction id |
account_id | string | Account |
amount | string | Amount |
desc | string | Description |
date | string | Posted date |
{
"id": "<Transaction id>",
"account_id": "<Account>",
"amount": "<Amount>",
"desc": "<Description>",
"date": "<Posted date>"
}