Confirm Line Match
POST/api/ledger/reconciliation/bank-statements/lines/:bankStatementLine/match
Confirm one or more ledger entries as the match for a line. Persists a denormalized snapshot of each match (so it survives ledger rebuilds) and marks the line matched. Idempotent — re-matching the same entry is a no-op.
Any valid API token can call this endpoint — no specific scope required. Manage tokens.
Body: entry_ids (required array of ledger_journal_entry ids).
Authentication: Requires Bearer token.
sync_block (on each line): pre-push sync verdict for the line's matched document(s) — null when every document will sync, otherwise { blocked: true, enableable: bool, reasons: string[], blocked_entry_ids: int[], enableable_entry_ids: int[] }. Surfaced so the UI can warn (and offer Enable sync) BEFORE a push that would otherwise silently not reach Xero.
Optional Amazon-settlement context (omit for a single-document match): match_kind ('entry' | 'settlement'), settlement_id (required when match_kind=settlement), settlement_reference, settlement_payout (the net payout the bank line matched on). When present, every persisted match row records the settlement so the UI labels it an 'Amazon Settlement · {payout}' regardless of how many SKU documents it touched.
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.