Moolre Documentation

Step-by-step guides

Wallet balances, statements and pagination

Read the balance, walk a statement with cursor pagination, and reconcile a day, with code in Node.js and Python.

Wallets, balances and statements

A wallet is where your money sits. Collections credit it, payouts debit it, and every movement is a transaction with an id, an externalref and a time. You read the balance with Account Status and the history with List Transactions, which uses cursor pagination so you can read as much as you need without missing or repeating a row.

Statements are the basis of reconciliation: you compare them with your own records, row by row.

I want toUseCredential
See the balanceAccount Status (type 1)Private key
See the historyList Transactions (Account Status type 2)Private key
See one payment or payoutPayment Status or Transfer StatusPublic or private key
See payments to a Payment ID or bank accountList Payment ID Transactions, List Bank Account TransactionsPublic key

Step by step: read the balance

  1. Call Account Status with type 1 and your accountnumber.
  2. Read data: it holds the wallet details and the balance.
  3. Compare the balance with what you expect: the starting balance plus collections minus payouts and fees. Treat a surprise as something to investigate, not to ignore.
curl https://api.moolre.com/open/account/status \  -H "Content-Type: application/json" \  -H "X-API-USER: $MOOLRE_USER" \  -H "X-API-KEY: $MOOLRE_KEY" \  -d '{    "type": 1,    "accountnumber": "1000000000001"  }'

Step by step: read a statement

  1. Call List Transactions (Account Status with type 2) with your accountnumber and a date range. from and to take YYYY-MM-DD or an ISO 8601 UTC time; a from date without a time starts at the beginning of that day, a to date without a time ends at the end of it. The older startdate and enddate still work and win if you send both.
  2. Add status to filter: 0 pending, 1 successful, 2 failed.
  3. Set limit. With a cursor the maximum is 100 rows per page.
  4. Read data.transactions. Each row has txstatus, txtype, payer, payee, amount, value, fee, networkfee, transactionid, externalref, thirdpartyref, the older ts and an ISO 8601 created_at.
  5. If data.has_more is true, call again with starting_after set to data.next_cursor. Repeat until has_more is false.
  6. Store the last next_cursor and the time you ran, so tomorrow's run starts where today's ended.
curl https://api.moolre.com/open/account/status \  -H "Content-Type: application/json" \  -H "X-API-USER: $MOOLRE_USER" \  -H "X-API-KEY: $MOOLRE_KEY" \  -d '{    "type": 2,    "accountnumber": "1000000000001",    "from": "2026-11-01",    "to": "2026-11-15",    "status": 1,    "limit": 100  }'

Walk every page in code

async function* statement(from, to) {  let cursor = null;  do {    const res = await moolre('/open/account/status', {      type: 2, accountnumber: process.env.MOOLRE_ACCOUNT, from, to, limit: 100,      ...(cursor ? { starting_after: cursor } : {}),    });    if (res.status !== 1) throw new Error(res.code + ' ' + (res.error?.message ?? res.message));    for (const row of res.data.transactions) yield row;    cursor = res.data.has_more ? res.data.next_cursor : null;  } while (cursor);}​for await (const row of statement('2026-11-01', '2026-11-15')) console.log(row.created_at, row.externalref, row.amount);

Step by step: reconcile a day

  1. Pull yesterday's statement with the walk above.
  2. Match each row to your own record by externalref. Rows that match and agree on amount are done.
  3. List the rows you do not have (money you did not expect) and the records you have that are not in the statement (money you expected). Both need a human look.
  4. For each of your records still pending, ask Payment Status or Transfer Status by externalref and update it.
  5. Compare your computed balance with Account Status. Any difference is a missing row.

Common errors and fixes

CodeMeaningFix
PG01starting_after is not a cursor from a previous responseSend exactly the next_cursor you were given
PG02Invalid limitUse a number from 1 to 100 with a cursor
PG03Invalid from or toUse YYYY-MM-DD or ISO 8601, after 2023-12-30
ST01, ST02Invalid startdate or enddateUse YYYY-MM-DD HH:MM:SS
ST07Invalid statusUse 0, 1 or 2
SW06Wallet not foundCheck accountnumber
  • You read statements with a cursor and never assume a single page holds everything.
  • You compare by externalref and amount, not by time alone.
  • You run the reconciliation every day and alert on any difference.