Moolre Documentation

Use Cases

Reconciliation and accounting

A daily reconciliation job using statements, status endpoints, webhooks and request IDs, and what each mismatch means.

The playbook in one page

Reconciliation is how you prove that what Moolre says happened is what you believe happened. Do it every day, automatically, and make a human look at every difference. This playbook uses the statement, the webhooks, the status endpoints and request IDs to find and fix every kind of mismatch.

Source of truthUsed for
Your database (orders, payouts, invoices)What you expected: the externalref, amount and status of each
Moolre statement (List Transactions)What actually moved: each row with transactionid, externalref, amount, status and time
Payment Status and Transfer StatusThe final word on one externalref
Webhook deliveriesWhich events Moolre sent and which your endpoint missed
meta.requestidTracing one call with Moolre support

Step by step: the daily job

  1. Choose the window: yesterday, midnight to midnight UTC (created_at is UTC with a Z). Using one fixed rule every day means no gaps.
  2. Download the statement with List Transactions (from, to, limit 100) and walk every page with starting_after until has_more is false. Store the rows.
  3. Index your own records for the same window by externalref.
  4. Match each statement row to your record by externalref. Compare amount and txstatus. Mark matches done.
  5. Collect three lists: rows in the statement you have no record for (unexpected money), records with no statement row (missing money), and rows where the amount or status differs.
  6. For each of your records still pending, ask Payment Status or Transfer Status by externalref and update it. A pending record with txstatus 1 means you missed a webhook: apply it now, once.
  7. Check Webhook deliveries for dead events in the window and use Resend webhook; because you dedupe on event_id, resending is safe.
  8. Compare your computed balance (opening plus collections minus payouts and fees) with Account Status. Any difference is a missing or extra row.
  9. Report the three lists to a person. Close the day only when they are empty or explained.
const rows = new Map();for await (const row of statement('2026-11-14', '2026-11-14')) rows.set(row.externalref, row);   // see Statements​const problems = { unexpected: [], missing: [], different: [] };for (const [ref, row] of rows) {  const mine = await db.findByExternalref(ref);  if (!mine) problems.unexpected.push(row);  else if (Number(mine.amount) !== Number(row.amount) || mine.status !== statusOf(row.txstatus)) problems.different.push({ mine, row });}for (const mine of await db.findForDay('2026-11-14')) if (!rows.has(mine.externalref)) problems.missing.push(mine);​await report(problems);   // humans look at every item

What each mismatch usually means

MismatchLikely causeWhat to do
Statement row, no recordA customer paid twice, a payment link used by someone else, or a record you failed to saveFind the payer from payer and thirdpartyref; decide whether to credit or return
Record paid, no statement rowYou applied an event you should not have (a failed callback) or fulfilled from the redirectInvestigate immediately: goods may have been released unpaid
Record pending, statement says successfulYou missed a webhookApply the result once and fix your endpoint
Record pending, no statement rowThe payment never happened, or is still pending at the networkAsk Payment Status; keep pending until final
Amount differsA partial payment, a fee, or a wrong order amountCompare amount, value and fee on the row
Payout record sent, statement missingOutcome unknown (PY02, APY16)Ask Transfer Status by externalref; never resend
Balance differsA missing row, or a fee you did not modelWalk the statement again; check value, fee and networkfee

Using request IDs in reconciliation

  1. Log meta.requestid (and your own X-Request-Id) with every request, next to the externalref.
  2. When a mismatch needs Moolre support, send the meta.requestid, externalref, time and environment.
  3. Keep the logs long enough to cover your reconciliation window and your dispute window.

Checklist

  • A job runs every day over a fixed window and walks every page of the statement.
  • Records are matched by externalref and compared on amount and status.
  • Unexpected money, missing money and differences each have an owner and a deadline.
  • Pending records are re-checked with the status endpoints; missed webhooks are resent.
  • The wallet balance equals your computed balance.
  • meta.requestid and externalref are in your logs for every call.