# Daily Processes and Reconciliation

> Run a repeatable daily control process for cash, securities, unsettled trades, fees, dividends, corporate actions, and custody positions.

The reconciliation pack is the durable operational record for your integration. Run it after the relevant market close and again after settlement windows or correction events.

## Daily sequence

1. Fetch `GET /report/reconciliation?asOf=YYYY-MM-DD`.
2. Persist the JSON response, `X-Request-ID`, and retrieval timestamp.
3. Compare the cash section with MyStocks wallet balances and your internal ledger.
4. Compare securities with sub-account holdings and custody positions.
5. Classify every unsettled trade by order, execution, expected settlement date, and status.
6. Reconcile fees, dividends, and corporate-action distributions.
7. Record exceptions with an owner, expected resolution date, and supporting event IDs.
8. Export CSV sections for operations or audit retention.

## Available sections

Use `format=csv` with one of `cash`, `securities`, `unsettled`, `fees`, `dividends`, `corporate_actions`, `custody_positions`, or `summary`. The JSON response is better for automated ingestion; CSV is useful for review and data-warehouse loads.

```bash
curl 'https://mystocks.africa/api/v1/partner/report/reconciliation?asOf=2026-06-30' \
  -H 'Authorization: Bearer pk_live_<your_key>'
```

## Exception handling

The JSON response includes `proof.status`:

- `BALANCED` — beneficial units match pooled custody units within tolerance;
- `EXCEPTIONS` — inspect `proof.custody.exceptions` for the exact instrument and unit difference;
- `INCOMPLETE` — no pooled custody records were available, so custody equality has not been proven.

`proof.cashRollForward` states completed credits, completed debits, net movement, the derived opening
balance, and the equation used to reach the reported closing balance. This is an internal ledger
roll-forward; partners should still compare it with their own opening balance and external bank records.

Do not infer a missing record as a zero balance. Investigate stale data, unsettled trades, rejected orders, corporate-action adjustments, and custody differences. Use `/client-activity`, order executions, signed events, and the [Statements and Confirms](/partners/docs/statements-confirms) workflow to resolve mismatches.

The reconciliation endpoint is read-only. It is safe to retry, but persist the request ID and source period so repeated exports do not create duplicate internal records.
