use_case · payout_settlement
Marketplace settlement lines to the order ledger
A marketplace pays a net settlement: orders minus commissions, refunds, and reserves. The seller's order ledger still has to explain which orders are inside that settlement.
What breaks in practice
The bank shows one ACH. The settlement report shows order nets plus a fee line that has no order. An order that shipped this week may belong to next week's payout. Comparing the bank ACH to gross order totals never ties, and a fee line matched to a nearby order hides the commission.
Match settlement lines to order-ledger lines on the order reference and the net amount. Do not ask Unira to collapse hundreds of orders into one bank deposit: confirmed splits are 2 to 5 parts that share a reference and sum exactly. When the question is whether the payout hit the bank, pair that one deposit with the payout total using the Stripe payout recipe.
What Unira reconciles
- Dataset A, settlement lines already net of commission:
settlement_line_id,date,amount,reference(order id, or a fee id),currency. - Dataset B, order ledger nets:
order_line_id,posting_date,amount,reference,currency. use_caseispayout_settlement. Amount tolerance stays0so a commission is not absorbed into an order. The date window is 2 days.
Outputs and exceptions
ORD-100andORD-102match. The feeFEE-100ismissing_books(dataset A only).ORD-101ismissing_bank(dataset B only: in the ledger, not in this settlement).GET /api/v1/reconciliations/{id}/exceptionsreturns those leftovers.GET /api/v1/reconciliations/{id}/export?format=csvis the completed download.suggested_groupsare low-confidence splits and are not counted inmatched_records.
Sample payload
POST /api/v1/datasets (settlement)
{
"name": "Marketplace settlement — week of 2 October",
"id_field": "settlement_line_id",
"idempotency_key": "marketplace-settlement-v1",
"records": [
{"settlement_line_id": "STL-1", "date": "2026-10-02", "amount": "100.00", "reference": "ORD-100", "currency": "USD"},
{"settlement_line_id": "STL-2", "date": "2026-10-02", "amount": "-3.20", "reference": "FEE-100", "currency": "USD"},
{"settlement_line_id": "STL-3", "date": "2026-10-04", "amount": "40.00", "reference": "ORD-102", "currency": "USD"}
]
}
POST /api/v1/datasets (orders)
{
"name": "Order ledger nets",
"id_field": "order_line_id",
"idempotency_key": "marketplace-orders-v1",
"records": [
{"order_line_id": "ORD-100", "posting_date": "2026-10-02", "amount": "100.00", "reference": "ORD-100", "currency": "USD"},
{"order_line_id": "ORD-101", "posting_date": "2026-10-03", "amount": "55.00", "reference": "ORD-101", "currency": "USD"},
{"order_line_id": "ORD-102", "posting_date": "2026-10-04", "amount": "40.00", "reference": "ORD-102", "currency": "USD"}
]
}
POST /api/v1/rulesets
{
"name": "Settlement line to order net",
"rules": [
{
"id": "settlement-exact",
"name": "Same order reference, currency, and net; date within 2 days",
"priority": 1,
"conditions": [
{"field_a": "currency", "field_b": "currency", "operator": "exact"},
{"field_a": "reference", "field_b": "reference", "operator": "exact", "trim": true, "ignore_case": true},
{"field_a": "amount", "field_b": "amount", "operator": "amount", "tolerance": "0"},
{"field_a": "date", "field_b": "posting_date", "operator": "date", "tolerance": "2"}
]
}
]
}
POST /api/v1/reconciliations
{
"name": "Week of 2 October settlement",
"use_case": "payout_settlement",
"dataset_a_id": "ds_settlement",
"dataset_b_id": "ds_orders",
"ruleset_id": "rules_example",
"ruleset_version": 1,
"idempotency_key": "marketplace-settlement-2026-10-02"
}
curl
curl --fail-with-body -sS https://unira.dev/api/v1/datasets \
-H "Authorization: Bearer $UNIRA_API_KEY" \
-H "Content-Type: application/json" \
--data '{"name":"Marketplace settlement — week of 2 October","id_field":"settlement_line_id","idempotency_key":"marketplace-settlement-v1","records":[{"settlement_line_id":"STL-1","date":"2026-10-02","amount":"100.00","reference":"ORD-100","currency":"USD"},{"settlement_line_id":"STL-2","date":"2026-10-02","amount":"-3.20","reference":"FEE-100","currency":"USD"},{"settlement_line_id":"STL-3","date":"2026-10-04","amount":"40.00","reference":"ORD-102","currency":"USD"}]}'
curl --fail-with-body -sS https://unira.dev/api/v1/datasets \
-H "Authorization: Bearer $UNIRA_API_KEY" \
-H "Content-Type: application/json" \
--data '{"name":"Order ledger nets","id_field":"order_line_id","idempotency_key":"marketplace-orders-v1","records":[{"order_line_id":"ORD-100","posting_date":"2026-10-02","amount":"100.00","reference":"ORD-100","currency":"USD"},{"order_line_id":"ORD-101","posting_date":"2026-10-03","amount":"55.00","reference":"ORD-101","currency":"USD"},{"order_line_id":"ORD-102","posting_date":"2026-10-04","amount":"40.00","reference":"ORD-102","currency":"USD"}]}'
curl --fail-with-body -sS https://unira.dev/api/v1/rulesets \
-H "Authorization: Bearer $UNIRA_API_KEY" \
-H "Content-Type: application/json" \
--data '{"name":"Settlement line to order net","rules":[{"id":"settlement-exact","name":"Same order reference, currency, and net; date within 2 days","priority":1,"conditions":[{"field_a":"currency","field_b":"currency","operator":"exact"},{"field_a":"reference","field_b":"reference","operator":"exact","trim":true,"ignore_case":true},{"field_a":"amount","field_b":"amount","operator":"amount","tolerance":"0"},{"field_a":"date","field_b":"posting_date","operator":"date","tolerance":"2"}]}]}'
curl --fail-with-body -sS https://unira.dev/api/v1/reconciliations \
-H "Authorization: Bearer $UNIRA_API_KEY" \
-H "Content-Type: application/json" \
--data '{"name":"Week of 2 October settlement","use_case":"payout_settlement","dataset_a_id":"'"$A"'","dataset_b_id":"'"$B"'","ruleset_id":"'"$RULESET"'","ruleset_version":1,"idempotency_key":"marketplace-settlement-2026-10-02"}'
curl --fail-with-body -sS "https://unira.dev/api/v1/reconciliations/$JOB/exceptions" \
-H "Authorization: Bearer $UNIRA_API_KEY"
curl --fail-with-body -sS "https://unira.dev/api/v1/reconciliations/$JOB/export?format=csv" \
-H "Authorization: Bearer $UNIRA_API_KEY" --output settlement.csv
MCP: reconcile_files
The CSVs include the headers reconcile_files reads. preset is bank-books and use_case is payout_settlement. Pass ruleset_id instead of preset when the job must use the 2-day ruleset above. Do not send both.
curl --fail-with-body -sS https://unira.dev/api/mcp \
-H "Authorization: Bearer $UNIRA_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
--data '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"reconcile_files","arguments":{"side_a_csv":"settlement_line_id,date,amount,reference,currency\nSTL-1,2026-10-02,100.00,ORD-100,USD\nSTL-2,2026-10-02,-3.20,FEE-100,USD\nSTL-3,2026-10-04,40.00,ORD-102,USD\n","side_b_csv":"order_line_id,posting_date,amount,reference,currency\nORD-100,2026-10-02,100.00,ORD-100,USD\nORD-101,2026-10-03,55.00,ORD-101,USD\nORD-102,2026-10-04,40.00,ORD-102,USD\n","side_a_name":"Marketplace settlement","side_b_name":"Order ledger","preset":"bank-books","use_case":"payout_settlement","idempotency_key":"marketplace-settlement-mcp-v1"}}}'