Embat ReconcilingItems API
⚠️ Warning: This API section is in BETA. It might undergo significant changes and may not be stable. ReconcilingItem represents a single financial record — for example a POS sale, an order, or a settlement — that needs to be matched against a product `transaction`. `customId` is the unique identifier of a reconciling item: set your own value to use as your internal identifier. Every reconciling item belongs to a ReconcilingSource, referenced by `reconcilingSourceCustomId`, which identifies the origin system the item comes from (e.g. a POS, an internal system, or a CRM) and can define a `matchingMetadataKey`. When set, Embat uses the value stored under that key in the item's `metadata` to automatically associate the item with a transaction. `reconciled` and `isMatched` reflect the state of that process and are set by Embat — they cannot be updated through this API. **Typical flow:** 1. **Register a reconciling source** (see ReconcilingSources) if one does not already exist for the origin system. 2. **Notify Embat of records to reconcile.** Create a reconciling item for each record, including the metadata your reconciling source uses for matching: ```json POST /reconcilingitems/{companyId} { "customId": "stripe-order-4821", "reconcilingSourceCustomId": "stripe-orders", "amount": 199.90, "currency": "EUR", "date": "2024-01-15T00:00:00Z", "description": "Stripe order #4821", "metadata": { "orderId": "ORD-48213" } } ``` Calling this again with the same `customId` updates the existing item instead of creating a duplicate, unless it has already been matched to a transaction. 3. **Track reconciliation status.** Retrieve or list items with `GET /reconcilingitems/{companyId}/{customId}` or `GET /reconcilingitems/{companyId}` — filter by `reconcilingSourceCustomId` or `reconciled` and check `isMatched`/`reconciled` on each item to see whether Embat has matched and reconciled it. 4. **Correct or remove items** while they are still unmatched: use `PATCH`/`DELETE /reconcilingitems/{companyId}/{customId}` (or their bulk variants), or resend the item with `POST` — creation is an upsert, so an existing `customId` is updated instead of duplicated.