Embat ReconcilingSources API
⚠️ Warning: This API section is in BETA. It might undergo significant changes and may not be stable. ReconcilingSource represents the origin of financial records that need to be matched against product transactions — for example a point-of-sale system, an internal financial system, or a CRM. customId is the unique identifier of a reconciling source: set your own value to use as your internal source ID. A reconciling source is the parent of one or more ReconcilingItems: each item references its source through reconcilingSourceCustomId. The source's matchingMetadataKey names the field within its items' metadata that Embat uses to associate each item with a product transaction. A reconciling source does not carry financial data itself — amounts, currencies and dates live on its ReconcilingItems. **Typical flow:** 1. **Register a reconciling source.** Create one for each origin system you want to reconcile from, defining the metadata key used to match its items to transactions: ```json POST /reconcilingsources/{companyId} { "customId": "stripe-orders", "name": "Stripe orders feed", "matchingMetadataKey": "orderId" } ``` Calling this again with the same `customId` updates the existing source instead of creating a duplicate. 2. **Create the reconciling items** for that source (see ReconcilingItems), each carrying the metadata value that will later be matched against product transactions. 3. **Retrieve or list sources** with `GET /reconcilingsources/{companyId}/{customId}` or `GET /reconcilingsources/{companyId}`. 4. **Update or delete a source** as your origin systems change: use `PATCH`/`DELETE /reconcilingsources/{companyId}/{customId}`, or resend the source with `POST` — creation is an upsert, so an existing `customId` is updated instead of duplicated.