Marketplace finance

Marketplace reconciliation, with an AI analyst that never leaves your server

Selling on a marketplace means being paid in pieces, months later, minus deductions you have to derive yourself. This reconciles what was ordered against what was settled against what was written off as lost — and answers questions about it in plain English, using language models running on the company’s own hardware.

3 sources

reconciled — orders, forward and return settlements, lost claims

833 lines

of approved schema and business rules grounding the model

On-premise

both models run on the company’s own hardware

SELECT only

no other statement type can reach the database

ORVELA

Settle

Marketplace reconciliation

Models running on-premise

How much is Myntra still holding for FY27 Q1?

Generated query

Read-only, checked before it ran

SELECT only
SELECT month,
       SUM(oms_qty)            AS ordered,
       SUM(fwd_settled_amt)    AS settled,
       SUM(spf_lost_amt)       AS lost_claims,
       SUM(net_outstanding)    AS outstanding
FROM   mp_settlement_journey
WHERE  channel = 'MYNTRA_PPMP'
  AND  month BETWEEN '2026-04' AND '2026-06'
GROUP  BY month
ORDER  BY month
LIMIT  500;

Myntra is still holding ₹64.2 L across FY27 Q1. June accounts for ₹31.8 L of it, which is expected — settlements run on a 45-day cycle, so most of June has not fallen due yet. The figure worth chasing is May at ₹18.7 L, which is past due, and ₹4.1 L of that sits in lost-claim disputes

MonthOrderedSettledLost claimsOutstanding
Apr-2648,210₹1.71 Cr₹2.4 L₹13.7 L
May-2652,884₹1.88 Cr₹4.1 L₹18.7 L
Jun-2661,032₹1.94 Cr₹3.6 L₹31.8 L

Where this runs

  • Query modelqwen2.5-coder · self-hosted
  • Explanation modelllama3.1 · self-hosted
  • Grounded on833-line approved schema
  • Left your networkNothing
  • Retries on error3, then it stops

Blocked by the guard

INSERT / UPDATE / DELETE

Semicolons and comments

pg_sleep, pg_read_file, dblink

Tables outside the approved list

Swipe to see the full screen

A finance question answered in plain language — with the query it ran and the rows it used, both visible.

The situation

The order management system says you sold 100 units. The marketplace’s forward settlement file says it has paid for some of them. The return settlement file takes some back. The lost-claims file says a few never arrived at all.

Nobody’s total agrees with anybody else’s, the finance team is stitching it together in Excel every month, and the question everyone actually wants answered — how much are they still holding — takes a week to produce and five minutes to dispute.

What I built

Two things in one system: the reconciliation, and a question box over it.

  • Orders matched against forward and return settlement data and against lost-claims, producing net outstanding quantity and amount by month.
  • A journey summary that produces every breakdown and the grand-total row from a single pass over one snapshot, so subtotals and total cannot disagree.
  • Rotating audit logs recording what was computed and when, with results cached so the second person to ask this month’s question gets it immediately.
  • Virtualised tables, so a month with tens of thousands of lines scrolls like a spreadsheet instead of freezing a browser.
  • A question box that writes the query, runs it, and explains the result in business language as it streams onto the screen.
Reconciliation overview comparing order-system and marketplace quantities for delivered, returned and settled orders, with the net outstanding quantity.

Swipe to see the full screen

Both systems’ count of the same orders side by side — what was delivered, returned and settled, and what is still outstanding.
ORVELA

Settle

Marketplace reconciliation

482 open

Orders with no settlement

482

Value at risk

₹18.7 L

Claimable now

₹14.2 L

76%

Past claim window

₹4.5 L

Orders shipped but never settled

Sorted by days outstanding

OrderChannelShippedDays outValueStatus
ORD-26740021MYNTRA_PPMP02 Apr 2689₹4,280Past window
ORD-26740588AJIO_VMS11 Apr 2680₹2,940Claim now
ORD-26741204MYNTRA_PPMP26 Apr 2665₹6,110Claim now
ORD-26742930FLIPKART_FA08 May 2653₹1,890Claim now
ORD-26744117NYKAA_FASHION21 May 2640₹3,450Within terms
ORD-26745882TATACLIQ_LUX03 Jun 2627₹8,720Within terms

Swipe to see the full screen

The orders nobody has paid for yet, isolated so they can be claimed.

Decisions worth explaining

The choice, why it was made, and what it means for you. Skip the middle part if you like — the point still lands.

01

Local models, because finance data does not leave the building

The choice

Two self-hosted models: one writes the query, a separate one explains the result. No question, no schema and no row of data goes to an external service.

Why

“Our numbers cannot go outside” is the most common and most reasonable reason a finance team refuses AI. Self-hosting removes the question entirely — and removes per-query cost, which starts to matter the moment a team gets into the habit of asking.

What it means for you

Your data-protection answer is “it never left our server”, not “the vendor says it is fine”.

02

An allow-list, not a blocklist

The choice

Every generated query passes a guard that permits only read-only statements. It rejects semicolons and comments — the two classic ways to smuggle in a second statement — rejects anything that creates, alters, inserts, updates or deletes, rejects functions whose main use is exhausting a server or reading its file system, checks every table named against an approved list, and appends a row limit before it runs.

Why

A blocklist tries to enumerate every dangerous thing a query could do, and fails the first time someone thinks of something you did not.

What it means for you

It fails closed. Something unexpected does not get through by default; it is refused by default.

03

It corrects itself, then stops

The choice

If the database rejects the query, the error is fed back and the model tries again — up to three times. After that it stops.

Why

A self-correcting loop without a bound is just a slower way to fail, and an expensive one.

What it means for you

You get an answer or an honest failure, never an endless spinner.

04

Two prompts, two jobs

The choice

One model is asked to write a query and nothing else, returning a single structured field. A different model is asked to explain rows, and is given no database access at all — and is explicitly instructed never to state a number that is not in the rows it was handed.

Why

Separating fetching from narrating means the component that writes persuasive English cannot reach the database, and the component that reaches the database is not trying to be persuasive.

What it means for you

The failure modes stay separate, and each can be audited on its own.

For the technical readerUnder the hood
  • Express 5 + TypeScript backend, PostgreSQL, Redis, rotating Winston audit logs.
  • Next.js and React front end with virtualised tables and Recharts.
  • Self-hosted inference via Ollama: a code-specialised model writes SQL, a general model writes the explanation, both grounded on an approved 833-line schema and business-rules document rather than left to guess what a column means from its name.
  • The explanation streams token by token over a server-sent event channel.

What it changed

  • The monthly “what is the marketplace still holding” question stopped being a week of spreadsheet work and became a page.
  • A finance team that had ruled out AI on data-protection grounds got to use it, because nothing left their server.

Where this applies to you

If you sell on Myntra, Flipkart, Ajio, Amazon or Nykaa, you have settlement files you cannot fully tie back to orders, and you are almost certainly writing off the difference. The reconciliation rules are marketplace-specific; the shape of the system is not. And if your objection to AI has been that your numbers cannot go outside, this is the direct answer to it.

Screenshots show the real interface with sample figures. The streamed answer shown is a representative response, not a recorded session with client data.

Tell me what’s slow, manual, or unreliable.

Twenty minutes on a call is usually enough for me to tell you whether software is the answer and roughly what it would cost. If it isn’t, I’ll say so.

Available for freelance builds alongside senior engineering work. One or two projects at a time.