Embat Contacts API
`Contact` represents a client or supplier your company transacts with. `customId` is the unique identifier of a contact: set your own value to use as your ERP contact ID, or let Embat auto-generate one. A contact is referenced from other entities to identify who is involved in a transaction: `Operations` (invoices/bills) are billed to or from a contact, `Payments` can record a collection or payment made to a contact, and `AccountingEntries` can be linked to a contact for reconciliation. A contact also carries the bank account details (`accounts`, `paymentsAccounts`) Embat uses to execute payments to it. **Typical flow:** contacts are usually kept in sync from your ERP, since they are the master data referenced when creating operations and payments. 1. **Create or update a contact from your ERP.** Whenever a client or supplier is created or edited in your ERP, upsert it in Embat with its identification and, if relevant, bank account details: ```json POST /contacts/{companyId} { "customId": "erp-contact-001", "legalName": "Acme Supplies S.L.", "taxId": "B12345678", "type": "supplier", "paymentsAccounts": [ { "currency": "EUR", "default": true, "details": { "iban": "ES9121000418450200051332" } } ] } ``` 2. **Reference the contact by `customId`.** Use the same `customId` in `Operations` and `Payments` to link them to this contact. 3. **Keep it up to date.** Sending `POST /contacts/{companyId}` again with the same `customId` updates the existing contact instead of creating a duplicate; use `PATCH /contacts/{companyId}/{customId}` (or the bulk variant) to update specific fields only.