Situation #
A driver is leaving and the advance ledger shows a balance: money given to them that has not been accounted for. The Fleet screens arrive with the web console, so the steps use the API.
What keeps working #
- Reading the ledger and every other Fleet record.
- Expenses the driver already paid, and the rest of the team's advances.
- Nothing in Pop Dispatch pays or collects money. The ledger records what happened. You move money in your own banking or payroll.
Steps in order #
- Call
GET /fleet/advances?person_id={id}. The answer holdsbalancesper currency,needs_settlement(true while any balance is open),warningswith a line such as "Ravi still holds an open advance of 150.00 EUR. Settle it before they leave.", and everyentriesrow, newest first. - Read the entries. Each has a
kind:advance,expense_charge,repayment,adjustmentorsettlement. Expense receipts the driver brought back are charged to the advance when the expense is recorded as paid by the driver. - Record what came back with
POST /fleet/advancesand{"person_id": 7, "kind": "repayment", "amount_cents": 4000}. A repayment always reduces the balance. - Fix a wrong entry with
kind: "adjustment"and a signedamount_cents(negative reduces the balance). Entries are never edited or deleted, so an adjustment is the correction. - Use
currencywhen the amount is in a currency other than the tenant's. Each currency has its own balance. - Settle with
POST /fleet/advances/settleand{"person_id": 7}. Onesettlemententry per currency brings each balance to zero. The answer lists what was settled.
How to confirm it worked #
GET /fleet/advances?person_id={id}showsneeds_settlement: false, emptybalancesand no warning.- The ledger has a
settlemententry dated today. - An
advance.settledevent is queued for your webhooks and connectors with the person, the date and the settled amounts. See "Fleet API and events".
What to do afterwards #
- Settling brings the ledger to zero. It does not collect the balance, so take any shortfall from final pay or invoice it in your own books.
- Keep the person's record for your files. Export the ledger with
GET /fleet/export/advances. - Send the
advance.settledevent to your accounting connector if you use one.
Technical details
- Amounts are integer minor units (
amount_cents) with a currency code. - Settling when there is no open balance returns
conflict(409): "There is no open balance to settle." - Needs the
dispatch_fleetlicence flag for writes. Reads stay open when the licence is read-only.