openapi: 3.1.0 info: title: Embat AccountingAccounts Operations API description: Embat API enables connections between any third party application and Embat. Is organized around REST principles, using HTTP responses code and returning data in JSON format. While testing the API, you have to request **sandbox credentials**. contact: name: API Support url: https://embat.io/ email: tech@embat.io version: 2.120.3 x-logo: url: https://storage.googleapis.com/embat-production.appspot.com/assets/embat_dark.svg tags: - name: Operations description: "`Operation` represents an accounting operation with a pending amount to settle — typically an invoice or bill due from or to a `Contact` (client or supplier). An invoice with several due dates is modeled as several operations, one per due date. `customId` is the unique identifier of an operation: set your own value to use as your ERP operation ID, or let Embat auto-generate one.\n\nOperations are the counterpart of `Payment`s: each payment created against an operation reduces its `pendingAmount`, and once the full amount is settled the operation's `status` automatically becomes `paid`. Operations can also be grouped into an invoice group or remittance (see `operationsCustomIds`), reference a `Contact`, be classified with a `Category`, and carry custom `attributes`.\n\n**Typical flow:**\n\n1. **Notify Embat of invoices/bills issued in your ERP.** Create the operation with its due date and amount:\n\n```json\nPOST /operations/{companyId}\n{\n \"customId\": \"invoice-2024-001\",\n \"issuanceDate\": \"2024-01-01T00:00:00Z\",\n \"dueDate\": \"2024-01-31T00:00:00Z\",\n \"currency\": \"EUR\",\n \"concept\": \"Consulting services January\",\n \"amount\": 1250.50\n}\n```\n\n2. **Track settlement.** As payments are recorded against the operation (see `Payments`), its `pendingAmount` decreases and `status` moves from `pending`/`overdue` to `paid`. Once an operation already has a payment recorded against it in Embat, most of its fields can no longer be updated — see the create/update endpoint descriptions for the exact rules.\n3. **Keep dates and status in sync.** Use `PATCH /operations/{companyId}/{customId}` (or the bulk variant) to correct `dueDate`/`paymentDate`, update `status`, or attach `attributes` — or resend the full operation with `POST`, since sending a `customId` that already exists updates the operation instead of duplicating it.\n4. **Group operations into a remittance (invoice group).** Create the individual operations as usual. When your ERP later groups and pays them together, send one more operation representing the remittance — `documentType: invoiceGroup`, the grouped total as `amount`, and the grouped operations' IDs in `operationsCustomIds`:\n\n```json\nPOST /operations/{companyId}\n{\n \"customId\": \"remittance-2024-07\",\n \"documentType\": \"invoiceGroup\",\n \"amount\": 3750.0,\n \"issuanceDate\": \"2024-07-01T00:00:00Z\",\n \"dueDate\": \"2024-07-31T00:00:00Z\",\n \"paymentDate\": \"2024-07-31T00:00:00Z\",\n \"operationsCustomIds\": [\"invoice-2024-001\", \"invoice-2024-002\", \"invoice-2024-003\"]\n}\n```\n\nEmbat marks every grouped operation as `paid` with `pendingAmount: 0` and links it to the remittance. From then on, the grouped operations' lifecycle is managed through the remittance: updating them directly has no effect, and resending the remittance without some of them releases those operations back to `pending` with their full pending amount. Use `DELETE /operations/{companyId}/{customId}` to cancel an operation that no longer applies.\n" paths: /operations/{companyId}: get: tags: - Operations summary: List operations description: 'Returns the operations created through this API for a company (`POST /operations/{companyId}` or its bulk variant) — operations created directly in Embat or synchronized from other sources are not returned here. Results are paginated: use `limit` to control page size and pass the returned `nextPageToken` to fetch the next page. `startIssuanceDate`/`endIssuanceDate` filter by issuance date and are inclusive on the start bound and exclusive on the end bound; the range cannot exceed 90 days.' operationId: list_operations_operations__companyId__get security: - HTTPBearer: [] parameters: - name: companyId in: path required: true schema: type: string title: Companyid - name: status in: query required: false schema: $ref: '#/components/schemas/OperationStatusEnum' description: Filter operations by their current status. description: Filter operations by their current status. - name: sync in: query required: false schema: type: boolean description: Filter by your own synchronization flag. `false` also matches operations where the value is not set. title: Sync description: Filter by your own synchronization flag. `false` also matches operations where the value is not set. - name: startIssuanceDate in: query required: false schema: type: string format: date description: 'Only return operations issued on or after this date (inclusive). The range cannot exceed 90 days: if `endIssuanceDate` is also given, the span between the two cannot exceed 90 days; if `endIssuanceDate` is omitted, `startIssuanceDate` cannot be more than 90 days in the past.' title: Startissuancedate description: 'Only return operations issued on or after this date (inclusive). The range cannot exceed 90 days: if `endIssuanceDate` is also given, the span between the two cannot exceed 90 days; if `endIssuanceDate` is omitted, `startIssuanceDate` cannot be more than 90 days in the past.' - name: endIssuanceDate in: query required: false schema: type: string format: date description: Only return operations issued before this date (exclusive). Combined with `startIssuanceDate`, the range cannot exceed 90 days. If used without `startIssuanceDate`, results start 90 days before this date. title: Endissuancedate description: Only return operations issued before this date (exclusive). Combined with `startIssuanceDate`, the range cannot exceed 90 days. If used without `startIssuanceDate`, results start 90 days before this date. - name: limit in: query required: false schema: type: integer maximum: 2000 title: Response length of objects limit description: Maximum number of objects to return in the response. Default 500, maximum 2000. default: 500 description: Maximum number of objects to return in the response. Default 500, maximum 2000. - name: nextPageToken in: query required: false schema: type: string title: Pagination token description: Token to fetch the next page of results, taken from the `nextPageToken` returned by the previous request with the same filters. Omit it to fetch the first page. An invalid or malformed token is rejected with `404`. description: Token to fetch the next page of results, taken from the `nextPageToken` returned by the previous request with the same filters. Omit it to fetch the first page. An invalid or malformed token is rejected with `404`. responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListOperationsResponseSchema' '400': description: 'Invalid date range: when only `startIssuanceDate` is given, it must not be in the future and cannot be more than 90 days in the past.' content: application/json: example: detail: startDate is a date after endDate schema: $ref: '#/components/schemas/ErrorResponse' '401': description: Unauthorized. The bearer token is missing, invalid or expired. content: application/json: example: detail: user not authorized schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Company not found, invalid `nextPageToken`, or an invalid date range when both `startIssuanceDate` and `endIssuanceDate` are given (start after end, or a span of more than 90 days). content: application/json: example: detail: 0021 companyId not found schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' post: tags: - Operations summary: Create operation description: 'Creates an operation (invoice/bill) with an optional `customId`; if omitted, Embat auto-generates one. Sending an operation whose `customId` already exists updates it, except when the existing operation already has a payment recorded against it in Embat: in that case the request has **no effect** on most fields — only `dueDate` and/or `paymentDate` are applied, and only when the operation''s current status is `pending` or `overdue`; any other field in the payload is silently discarded. An operation with `amount` equal to `0` is silently discarded and not created. While an operation belongs to an invoice group (remittance), resending it through this endpoint leaves it unchanged (`200` is still returned): its status is managed by the remittance that groups it — see the tag description for the remittance flow.' operationId: create_operation_operations__companyId__post security: - HTTPBearer: [] parameters: - name: companyId in: path required: true schema: type: string title: Companyid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PostOperationsRequestSchema' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/UpsertOperationsResponseSchema' '401': description: Unauthorized. The bearer token is missing, invalid or expired. content: application/json: example: detail: user not authorized schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Not found. The requested resource or `companyId` does not exist. content: application/json: example: detail: 0021 companyId not found schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Unexpected error. Contact support if it persists. content: application/json: example: detail: Internal server error schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' patch: tags: - Operations summary: Update operations in bulk description: Updates several operations in a single call, identified by `customId`. Entries whose `customId` does not match any existing operation are silently skipped — the call returns `200` for the whole batch. The same rules as the single update endpoint apply to operations that already have a payment recorded against them. operationId: update_operations_bulk_operations__companyId__patch security: - HTTPBearer: [] parameters: - name: companyId in: path required: true schema: type: string title: Companyid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BulkPatchOperationsRequestSchema' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BulkUpsertOperationsResponseSchema' '401': description: Unauthorized. The bearer token is missing, invalid or expired. content: application/json: example: detail: user not authorized schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Not found. The requested resource or `companyId` does not exist. content: application/json: example: detail: 0021 companyId not found schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Unexpected error. Contact support if it persists. content: application/json: example: detail: Internal server error schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' delete: tags: - Operations summary: Delete operations in bulk description: Cancels several operations in a single call, identified by `customId`, following the same rules as the single delete endpoint. Only the operations that exist and are in a deletable state are cancelled; the rest are silently skipped. operationId: delete_operations_bulk_operations__companyId__delete security: - HTTPBearer: [] parameters: - name: companyId in: path required: true schema: type: string title: Companyid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BulkDeleteOperationsRequestSchema' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BulkModifyOperationsResponseSchema' '401': description: Unauthorized. The bearer token is missing, invalid or expired. content: application/json: example: detail: user not authorized schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Company not found, or none of the given `customId` values match a deletable operation. content: application/json: example: detail: 0021 companyId not found schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Unexpected error. Contact support if it persists. content: application/json: example: detail: Internal server error schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /operations/{companyId}/{customId}: get: tags: - Operations summary: Retrieve operation description: Returns a single operation by `customId`. operationId: read_operation_operations__companyId___customId__get security: - HTTPBearer: [] parameters: - name: customId in: path required: true schema: type: string title: Customid - name: companyId in: path required: true schema: type: string title: Companyid responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/GetOperationsResponseSchema' '401': description: Unauthorized. The bearer token is missing, invalid or expired. content: application/json: example: detail: user not authorized schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Company not found, or no operation matches the given `customId`. content: application/json: example: detail: 0021 companyId not found schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' patch: tags: - Operations summary: Update operation description: 'Updates an operation identified by `customId`. If the operation already has a payment recorded against it in Embat, the request has **no effect** on most fields — only `dueDate` and/or `paymentDate` are applied, and only when the operation''s current status is `pending` or `overdue`; any other field in the payload is silently discarded. Updates to an operation that belongs to an invoice group (remittance) are silently ignored (`200` is still returned): its status is managed by the remittance that groups it — see the tag description for the remittance flow.' operationId: update_operation_operations__companyId___customId__patch security: - HTTPBearer: [] parameters: - name: customId in: path required: true schema: type: string title: Customid - name: companyId in: path required: true schema: type: string title: Companyid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PatchOperationsRequestSchema' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/UpsertOperationsResponseSchema' '401': description: Unauthorized. The bearer token is missing, invalid or expired. content: application/json: example: detail: user not authorized schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Company not found, or no operation matches the given `customId`. content: application/json: example: detail: 0021 companyId not found schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Unexpected error. Contact support if it persists. content: application/json: example: detail: Internal server error schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' delete: tags: - Operations summary: Delete operation description: 'Cancels an operation by `customId`: its `status` is set to `cancel` and its pending amounts to 0. Only operations whose current status is not `paid`, `cancel` or `payment_in_progress` can be deleted.' operationId: delete_operation_operations__companyId___customId__delete security: - HTTPBearer: [] parameters: - name: customId in: path required: true schema: type: string title: Customid - name: companyId in: path required: true schema: type: string title: Companyid responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ModifyOperationsResponseSchema' '401': description: Unauthorized. The bearer token is missing, invalid or expired. content: application/json: example: detail: user not authorized schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Company not found, no operation matches the given `customId`, or the operation's status is `paid`, `cancel` or `payment_in_progress`. content: application/json: example: detail: 0021 companyId not found schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Unexpected error. Contact support if it persists. content: application/json: example: detail: Internal server error schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /operations/{companyId}/bulk: post: tags: - Operations summary: Create operations in bulk description: Creates several operations in a single call, following the same rules as the single operation creation endpoint. Operations sharing the same `customId` within the request are deduplicated and only the first occurrence is processed; operations with `amount` equal to `0` are silently discarded. If none of the submitted operations are eligible, the call still returns `200` with an empty `data` list. operationId: create_operations_bulk_operations__companyId__bulk_post security: - HTTPBearer: [] parameters: - name: companyId in: path required: true schema: type: string title: Companyid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BulkPostOperationsRequestSchema' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BulkUpsertOperationsResponseSchema' '401': description: Unauthorized. The bearer token is missing, invalid or expired. content: application/json: example: detail: user not authorized schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Not found. The requested resource or `companyId` does not exist. content: application/json: example: detail: 0021 companyId not found schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Unexpected error. Contact support if it persists. content: application/json: example: detail: Internal server error schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /operations/{companyId}/attributes/bulk: post: tags: - Operations summary: Add internal attributes to operations in bulk description: Attaches internal attribute values to operations, identified by `customId`. These attributes are for internal use only and are not shared back with the ERP through the regular operation fields. operationId: add_attribute_values_operations__companyId__attributes_bulk_post security: - HTTPBearer: [] parameters: - name: companyId in: path required: true schema: type: string title: Companyid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BulkPostOperationsAttributesRequestSchema' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BulkUpsertOperationsResponseSchema' '401': description: Unauthorized. The bearer token is missing, invalid or expired. content: application/json: example: detail: user not authorized schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Not found. The requested resource or `companyId` does not exist. content: application/json: example: detail: 0021 companyId not found schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Unexpected error. Contact support if it persists. content: application/json: example: detail: Internal server error schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' delete: tags: - Operations summary: Remove internal attributes from operations in bulk description: Removes internal attribute values from operations, identified by `customId`. operationId: delete_contacts_bulk_operations__companyId__attributes_bulk_delete security: - HTTPBearer: [] parameters: - name: companyId in: path required: true schema: type: string title: Companyid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BulkDeleteOperationsAttributesRequestSchema' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BulkUpsertOperationsResponseSchema' '401': description: Unauthorized. The bearer token is missing, invalid or expired. content: application/json: example: detail: user not authorized schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Not found. The requested resource or `companyId` does not exist. content: application/json: example: detail: 0021 companyId not found schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Unexpected error. Contact support if it persists. content: application/json: example: detail: Internal server error schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: BulkDeleteOperationsAttributesRequestSchema: properties: data: items: $ref: '#/components/schemas/DeleteOperationsAttributesRequestSchema' type: array title: Data description: Internal attributes to remove, grouped by operation. type: object required: - data title: BulkDeleteOperationsAttributesRequestSchema ContactTypeEnum: type: string enum: - supplier - client-supplier - client title: ContactTypeEnum ContactContactTypeEnum: type: string enum: - freelance - company title: ContactContactTypeEnum CurrencyEnum: type: string enum: - AED - AFN - ALL - AMD - ANG - AOA - ARS - AUD - AWG - AZN - BAM - BBD - BDT - BGN - BHD - BIF - BMD - BND - BOB - BOV - BRL - BSD - BTC - BTN - BWP - BYN - BZD - CAD - CDF - CHE - CHF - CHW - CLF - CLP - CNH - CNY - COP - COU - CRC - CUP - CVE - CZK - DJF - DKK - DOP - DZD - EEK - EGP - ERN - ETB - ETH - EUR - FJD - FKP - GBP - GEL - GHS - GIP - GMD - GNF - GTQ - GYD - HKD - HNL - HRK - HTG - HUF - IDR - ILS - INR - IQD - IRR - ISK - JMD - JOD - JPY - KES - KGS - KHR - KMF - KPW - KRW - KWD - KYD - KZT - LAK - LBP - LKR - LRD - LSL - LTC - LTL - LVL - LYD - MAD - MDL - MGA - MKD - MMK - MNT - MOP - MRU - MUR - MVR - MWK - MXN - MXV - MYR - MZN - NAD - NGN - NIO - NOK - NPR - NZD - OMR - PAB - PEN - PGK - PHP - PKR - PLN - PYG - QAR - RON - RSD - RUB - RWF - SAR - SBD - SCR - SDG - SEK - SGD - SHP - SLE - SOS - SRD - SSP - STN - SVC - SYP - SZL - THB - TJS - TMT - TND - TOP - TRY - TTD - TWD - TZS - UAH - UGX - USD - USN - UYI - UYU - UYW - UZS - VED - VEF - VES - VND - VUV - WST - XAF - XAG - XAU - XBA - XBB - XBC - XBD - XCD - XDR - XOF - XPD - XPF - XPT - XSU - XTS - XUA - XXX - YER - ZAR - ZMK - ZMW - ZWG - ZWL title: CurrencyEnum ContactNewAccount: properties: default: type: boolean title: Default description: Marks this account as the default one for its `currency`. default: false currency: anyOf: - $ref: '#/components/schemas/CurrencyEnum' - type: 'null' description: ISO currency code this account is used for. An empty string is treated the same as omitting this field. examples: - EUR details: anyOf: - $ref: '#/components/schemas/ContactNewAccountDetails' - type: 'null' description: 'Bank account identifiers. Which fields are required depends on the `currency` and the destination country: IBAN-based currencies expect `iban`, others expect `accountNumber` plus the identifiers of the applicable payment rail (e.g. `routingNumber` for US accounts, `sortCode` for UK accounts).' type: object title: ContactNewAccount BaseContactSchema-Output: properties: tradeName: anyOf: - type: string - type: 'null' title: Tradename description: Commercial/trade name of the contact. Defaults to `legalName` when omitted or blank. examples: - Acme Supplies legalName: anyOf: - type: string - type: 'null' title: Legalname description: Legal (registered) name of the contact. examples: - Acme Supplies S.L. taxId: anyOf: - type: string - type: 'null' title: Taxid description: Tax identification number (CIF/NIF/VAT) of the contact. Spaces are removed before storage. examples: - B12345678 contact: anyOf: - $ref: '#/components/schemas/app__schemas__contacts__ContactSchema' - type: 'null' description: Contact person details (name, phone, email) for this contact. address: anyOf: - $ref: '#/components/schemas/ContactAddressSchema' - type: 'null' description: Postal address of the contact. contactType: $ref: '#/components/schemas/ContactContactTypeEnum' description: Whether the contact is a `company` or a `freelance` individual. Defaults to `company`. default: company type: anyOf: - $ref: '#/components/schemas/ContactTypeEnum' - type: 'null' description: 'Commercial relationship with the contact: `client`, `supplier` or `client-supplier`.' accounts: anyOf: - items: $ref: '#/components/schemas/ContactAccounts' type: array - type: 'null' title: Accounts description: 'Bank accounts of the contact. When omitted (or empty) and `paymentsAccounts` is provided, Embat derives one entry per payment account automatically: the derived `iban` holds the payment identifier resolved for the account''s currency (an IBAN for IBAN-based currencies, otherwise the local account number), `swift` takes the account''s `bic`, and `default` its `default` flag.' paymentsAccounts: anyOf: - items: $ref: '#/components/schemas/ContactNewAccount' type: array - type: 'null' title: Paymentsaccounts description: Bank accounts of the contact, one per currency/payment rail, with the identifiers required to pay it (IBAN, account number, routing number...). Each entry is validated independently and **silently discarded** when it has no usable account identifier for its `currency` (neither `iban` nor `accountNumber` set); format validity of the identifiers themselves is not enforced. Entries that resolve to the same account identifier are deduplicated, keeping only the first one. additionalInfo: anyOf: - additionalProperties: true type: object - type: 'null' title: Additionalinfo description: Free-form key/value metadata to attach to the contact. accountingCode: anyOf: - type: string - type: 'null' title: Accountingcode description: Accounting account code this contact is linked to. examples: - '4300001' paymentMethod: anyOf: - type: string - type: 'null' title: Paymentmethod description: Preferred payment method for this contact. examples: - bank-transaction paymentTerms: anyOf: - type: integer - type: 'null' title: Paymentterms description: Payment terms granted to the contact, in days. examples: - 30 attributes: anyOf: - items: $ref: '#/components/schemas/AttributeValueRequestSchema' type: array - type: 'null' title: Attributes description: Custom attribute values to attach to the contact. customId: anyOf: - type: string - type: 'null' title: Customid description: Your own unique ID for the contact. If omitted, Embat auto-generates one. examples: - erp-contact-001 type: object title: BaseContactSchema BulkModifyOperationsResponseSchema: properties: data: items: $ref: '#/components/schemas/ModifyOperationsResponseSchema' type: array title: Data description: Result of the bulk operation, one entry per operation. type: object required: - data title: BulkModifyOperationsResponseSchema ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context type: object required: - loc - msg - type title: ValidationError PostOperationsRequestSchema: properties: status: anyOf: - $ref: '#/components/schemas/OperationStatusEnum' - type: 'null' description: 'Status of the operation. On creation, only `paid`, `cancel` and `payment_in_progress` are respected as sent (`paid`/`cancel` also reset `pendingAmount` and `pendingAccountingAmount` to 0). Any other value — including `paymentOrder` and `shipped` (legacy values, avoid using them in new integrations) — is **silently discarded** and recomputed from `dueDate`: `pending` if `dueDate` is today or later, `overdue` otherwise. The same recomputation applies when this field is omitted.' examples: - pending paymentDate: anyOf: - type: string format: date-time - type: 'null' title: Paymentdate description: Date the operation is expected to be (or was) paid. Only the calendar date is meaningful; the time component is not preserved as sent. chargeAccount: anyOf: - type: string - type: 'null' title: Chargeaccount description: IBAN of your own bank account the operation is charged to. contactAccount: anyOf: - type: string - type: 'null' title: Contactaccount description: IBAN of the counterparty's (contact's) bank account. issuanceDate: type: string format: date-time title: Issuancedate description: Issuance date of the operation's source document. Only the calendar date is meaningful; the time component is not preserved as sent. If `dueDate` is omitted, it defaults to this date, and `paymentDate` in turn defaults to `dueDate`. dueDate: type: string format: date-time title: Duedate description: 'Due date of the operation. Only the calendar date is meaningful; the time component is not preserved as sent. On creation, unless `status` is explicitly set to `paid`, `cancel` or `payment_in_progress`, the operation''s status is computed from this date: `pending` if it is today or later, `overdue` otherwise.' accountingCode: anyOf: - type: string - type: 'null' title: Accountingcode description: Accounting account code the operation is posted to. accountingName: anyOf: - type: string - type: 'null' title: Accountingname description: Accounting account name the operation is posted to. operationsCustomIds: anyOf: - items: type: string type: array - type: 'null' title: Operationscustomids description: 'Custom IDs of other operations grouped under this one, to represent an invoice group or remittance (typically combined with `documentType` set to `invoiceGroup`). Takes effect on `POST` (create or upsert): each referenced operation is marked `paid`, its `pendingAmount`/`pendingAccountingAmount` set to 0 and its payment date set to this operation''s `paymentDate`. Resending the remittance without some previously grouped operations releases them: they return to `pending` with their full pending amount. Sending this field on a `PATCH` update has no effect.' concept: type: string title: Concept description: Free-text description of the operation. examples: - 'Invoice #2024-001' amount: type: number title: Amount description: Total amount of the operation, in `currency`. examples: - 1250.5 accountingAmount: anyOf: - type: number - type: 'null' title: Accountingamount description: 'Amount of the operation expressed in the company accounting currency. If omitted, it defaults to `amount` (and `accountingCurrency` is reset to `currency`). Note: whenever the resulting `accountingCurrency` equals `currency`, this value is **forced to `amount`**, even if you explicitly sent a different value.' examples: - 1250.5 pendingAmount: anyOf: - type: number - type: 'null' title: Pendingamount description: Amount still pending settlement, in `currency`. Defaults to `amount` when omitted. examples: - 1250.5 pendingAccountingAmount: anyOf: - type: number - type: 'null' title: Pendingaccountingamount description: Amount still pending settlement, expressed in the accounting currency. If omitted, it is derived proportionally from `pendingAmount` and `accountingAmount`; it is 0 when `amount` or `accountingAmount` is 0. examples: - 1250.5 currency: $ref: '#/components/schemas/CurrencyEnum' description: ISO currency code of `amount`. examples: - EUR accountingCurrency: anyOf: - $ref: '#/components/schemas/CurrencyEnum' - type: 'null' description: 'ISO currency code of `accountingAmount`. Defaults to `currency` when omitted. Note: when `accountingAmount` is omitted, this field is also **reset to `currency`**, even if you explicitly sent a different value.' examples: - EUR exchangeRate: anyOf: - type: number - type: 'null' title: Exchangerate description: 'Exchange rate applied between `currency` and `accountingCurrency`. If omitted, it is derived from `amount`/`accountingAmount` (1.0 when `accountingAmount` is 0). Note: whenever `amount` equals `accountingAmount`, the value is **forced to 1.0**, even if you explicitly sent a different one; out-of-range or non-finite values are also silently reset to 1.0.' examples: - 1.0 paymentMethod: anyOf: - type: string - type: 'null' title: Paymentmethod description: Payment method associated with the operation (e.g. `bank-transaction`, `promissory-note`). examples: - bank-transaction contact: anyOf: - $ref: '#/components/schemas/BaseContactSchema-Input' - type: 'null' description: Contact (client/supplier) the operation is due from or to. additionalInfo: anyOf: - additionalProperties: true type: object - type: 'null' title: Additionalinfo description: Free-form key/value metadata to attach to the operation. invoiceGroupDocumentId: anyOf: - type: string - type: 'null' title: Invoicegroupdocumentid description: Identifier of the invoice group this operation belongs to, if any. sync: type: boolean title: Sync description: Marks the operation as synchronized on your side. default: false documentId: anyOf: - type: string - type: 'null' title: Documentid description: Identifier of the source document (e.g. invoice number). attributes: anyOf: - items: $ref: '#/components/schemas/AttributeValueRequestSchema' type: array - type: 'null' title: Attributes description: Custom attribute values to attach to the operation. externalReference: anyOf: - type: string - type: 'null' title: Externalreference description: Free-form reference to this operation in an external system. customId: anyOf: - type: string - type: 'null' title: Customid description: Your own unique ID for the operation. If omitted, Embat auto-generates one. examples: - invoice-2024-001 documentType: anyOf: - $ref: '#/components/schemas/OperationDocumentTypeEnum' - type: 'null' description: Type of the source document. Defaults to `invoice` when omitted. examples: - invoice type: object required: - issuanceDate - dueDate - concept - amount - currency title: PostOperationsRequestSchema ModifyOperationsResponseSchema: properties: id: type: string title: Id description: Embat resource ID type: object required: - id title: ModifyOperationsResponseSchema ContactAccounts: properties: swift: anyOf: - type: string - type: 'null' title: Swift description: SWIFT/BIC code of the account. examples: - BBVAESMMXXX iban: anyOf: - type: string - type: 'null' title: Iban description: Account identifier. Usually an IBAN, but for entries derived from `paymentsAccounts` in currencies that do not use IBAN (e.g. USD, CAD, JPY) it holds the resolved payment identifier for that currency, such as a local account number. Spaces are stripped before storage. An account with an empty `iban` is silently dropped when the contact is saved. examples: - ES9121000418450200051332 default: anyOf: - type: boolean - type: 'null' title: Default description: Marks this account as the contact's default one. type: object title: ContactAccounts app__schemas__contacts__ContactSchema: properties: phone: anyOf: - type: string - type: 'null' title: Phone description: Phone number of the contact person. examples: - '+34600000000' email: anyOf: - type: string - type: 'null' title: Email description: Email address of the contact person. Required to pay this contact by Interac e-Transfer in CAD. examples: - billing@acme-supplies.com name: anyOf: - type: string - type: 'null' title: Name description: First name of the contact person. examples: - John surname: anyOf: - type: string - type: 'null' title: Surname description: Last name of the contact person. examples: - Doe type: object title: ContactSchema OperationStatusEnum: type: string enum: - paymentOrder - cancel - paid - payment_in_progress - overdue - pending - shipped title: OperationStatusEnum PostOperationsAttributesRequestSchema: properties: customId: type: string title: Customid description: Custom ID of the operation to attach attributes to. attributes: items: $ref: '#/components/schemas/AttributeValueRequestSchema' type: array title: Attributes description: Internal attribute values to attach to the operation. type: object required: - customId - attributes title: PostOperationsAttributesRequestSchema GetOperationsResponseSchema: properties: status: anyOf: - $ref: '#/components/schemas/OperationStatusEnum' - type: 'null' description: 'Status of the operation: `pending`, `overdue`, `paymentOrder`, `payment_in_progress`, `paid`, `cancel` or `shipped` (legacy value).' paymentDate: anyOf: - type: string format: date-time - type: 'null' title: Paymentdate description: Date the operation is expected to be (or was) paid. Only the calendar date is meaningful; the time component is not preserved as sent. chargeAccount: anyOf: - type: string - type: 'null' title: Chargeaccount description: IBAN of your own bank account the operation is charged to. contactAccount: anyOf: - type: string - type: 'null' title: Contactaccount description: IBAN of the counterparty's (contact's) bank account. issuanceDate: type: string format: date-time title: Issuancedate description: Issuance date of the operation's source document. Only the calendar date is meaningful; the time component is not preserved as sent. If `dueDate` is omitted, it defaults to this date, and `paymentDate` in turn defaults to `dueDate`. dueDate: type: string format: date-time title: Duedate description: 'Due date of the operation. Only the calendar date is meaningful; the time component is not preserved as sent. On creation, unless `status` is explicitly set to `paid`, `cancel` or `payment_in_progress`, the operation''s status is computed from this date: `pending` if it is today or later, `overdue` otherwise.' accountingCode: anyOf: - type: string - type: 'null' title: Accountingcode description: Accounting account code the operation is posted to. accountingName: anyOf: - type: string - type: 'null' title: Accountingname description: Accounting account name the operation is posted to. operationsCustomIds: anyOf: - items: type: string type: array - type: 'null' title: Operationscustomids description: 'Custom IDs of other operations grouped under this one, to represent an invoice group or remittance (typically combined with `documentType` set to `invoiceGroup`). Takes effect on `POST` (create or upsert): each referenced operation is marked `paid`, its `pendingAmount`/`pendingAccountingAmount` set to 0 and its payment date set to this operation''s `paymentDate`. Resending the remittance without some previously grouped operations releases them: they return to `pending` with their full pending amount. Sending this field on a `PATCH` update has no effect.' concept: type: string title: Concept description: Free-text description of the operation. examples: - 'Invoice #2024-001' amount: type: number title: Amount description: Total amount of the operation, in `currency`. examples: - 1250.5 accountingAmount: anyOf: - type: number - type: 'null' title: Accountingamount description: 'Amount of the operation expressed in the company accounting currency. If omitted, it defaults to `amount` (and `accountingCurrency` is reset to `currency`). Note: whenever the resulting `accountingCurrency` equals `currency`, this value is **forced to `amount`**, even if you explicitly sent a different value.' examples: - 1250.5 pendingAmount: anyOf: - type: number - type: 'null' title: Pendingamount description: Amount still pending settlement, in `currency`. Defaults to `amount` when not set. examples: - 1250.5 pendingAccountingAmount: anyOf: - type: number - type: 'null' title: Pendingaccountingamount description: Amount still pending settlement, expressed in the accounting currency. If omitted, it is derived proportionally from `pendingAmount` and `accountingAmount`; it is 0 when `amount` or `accountingAmount` is 0. examples: - 1250.5 currency: anyOf: - $ref: '#/components/schemas/CurrencyEnum' - type: 'null' description: ISO currency code of `amount`. examples: - EUR accountingCurrency: anyOf: - $ref: '#/components/schemas/CurrencyEnum' - type: 'null' description: 'ISO currency code of `accountingAmount`. Defaults to `currency` when omitted. Note: when `accountingAmount` is omitted, this field is also **reset to `currency`**, even if you explicitly sent a different value.' examples: - EUR exchangeRate: anyOf: - type: number - type: 'null' title: Exchangerate description: 'Exchange rate applied between `currency` and `accountingCurrency`. If omitted, it is derived from `amount`/`accountingAmount` (1.0 when `accountingAmount` is 0). Note: whenever `amount` equals `accountingAmount`, the value is **forced to 1.0**, even if you explicitly sent a different one; out-of-range or non-finite values are also silently reset to 1.0.' examples: - 1.0 paymentMethod: anyOf: - type: string - type: 'null' title: Paymentmethod description: Payment method associated with the operation (e.g. `bank-transaction`, `promissory-note`). examples: - bank-transaction contact: anyOf: - $ref: '#/components/schemas/BaseContactSchema-Output' - type: 'null' description: Contact (client/supplier) the operation is due from or to. additionalInfo: anyOf: - additionalProperties: true type: object - type: 'null' title: Additionalinfo description: Free-form key/value metadata to attach to the operation. invoiceGroupDocumentId: anyOf: - type: string - type: 'null' title: Invoicegroupdocumentid description: Identifier of the invoice group this operation belongs to, if any. sync: type: boolean title: Sync description: Marks the operation as synchronized on your side. default: false documentId: anyOf: - type: string - type: 'null' title: Documentid description: Identifier of the source document (e.g. invoice number). attributes: anyOf: - items: $ref: '#/components/schemas/AttributeValueRequestSchema' type: array - type: 'null' title: Attributes description: Custom attribute values to attach to the operation. externalReference: anyOf: - type: string - type: 'null' title: Externalreference description: Free-form reference to this operation in an external system. customId: anyOf: - type: string - type: 'null' title: Customid description: Your own unique ID for the operation. If omitted, Embat auto-generates one. examples: - invoice-2024-001 documentType: anyOf: - $ref: '#/components/schemas/OperationDocumentTypeEnum' - type: 'null' description: Type of the source document. Defaults to `invoice` when omitted. examples: - invoice id: type: string title: Id description: Embat operation ID. companyId: type: string title: Companyid description: Embat company ID. You can get them from "companies" endpoints updatedAt: anyOf: - type: string format: date-time - type: 'null' title: Updatedat description: Last updated date of the entity in the database createdAt: anyOf: - type: string format: date-time - type: 'null' title: Createdat description: Created date of the entity in the database tags: anyOf: - items: {} type: array - type: 'null' title: Tags description: Tags attached to the operation. categoryId: anyOf: - type: string - type: 'null' title: Categoryid description: Embat category ID used for reporting. Defaults to `998` when not set. examples: - '998' generatedFrom: anyOf: - type: string - type: 'null' title: Generatedfrom description: Origin the operation was generated from. Operations created through this API are always `api`. examples: - api comments: anyOf: - items: {} type: array - type: string - type: 'null' title: Comments description: Comments recorded on the operation. uploadedFiles: anyOf: - items: {} type: array - type: 'null' title: Uploadedfiles description: Files attached to the operation. secondary: anyOf: - type: boolean - type: 'null' title: Secondary description: Whether the operation is flagged as secondary. type: object required: - issuanceDate - dueDate - concept - amount - id - companyId title: GetOperationsResponseSchema AuxBulkPatchOperationsRequestSchema: properties: status: anyOf: - $ref: '#/components/schemas/OperationStatusEnum' - type: 'null' description: 'Status of the operation: `pending`, `overdue`, `payment_in_progress`, `paid`, `cancel`, or the legacy values `paymentOrder` and `shipped` (avoid using them in new integrations). Setting `paid` also resets `pendingAmount` and `pendingAccountingAmount` to 0.' examples: - pending paymentDate: anyOf: - type: string format: date-time - type: 'null' title: Paymentdate description: Date the operation is expected to be (or was) paid. Only the calendar date is meaningful; the time component is not preserved as sent. chargeAccount: anyOf: - type: string - type: 'null' title: Chargeaccount description: IBAN of your own bank account the operation is charged to. contactAccount: anyOf: - type: string - type: 'null' title: Contactaccount description: IBAN of the counterparty's (contact's) bank account. issuanceDate: anyOf: - type: string format: date-time - type: 'null' title: Issuancedate description: Issuance date of the operation's source document. Only the calendar date is meaningful; the time component is not preserved as sent. dueDate: anyOf: - type: string format: date-time - type: 'null' title: Duedate description: Due date of the operation. Only the calendar date is meaningful; the time component is not preserved as sent. accountingCode: anyOf: - type: string - type: 'null' title: Accountingcode description: Accounting account code the operation is posted to. accountingName: anyOf: - type: string - type: 'null' title: Accountingname description: Accounting account name the operation is posted to. operationsCustomIds: anyOf: - items: type: string type: array - type: 'null' title: Operationscustomids description: 'Custom IDs of other operations grouped under this one, to represent an invoice group or remittance (typically combined with `documentType` set to `invoiceGroup`). Takes effect on `POST` (create or upsert): each referenced operation is marked `paid`, its `pendingAmount`/`pendingAccountingAmount` set to 0 and its payment date set to this operation''s `paymentDate`. Resending the remittance without some previously grouped operations releases them: they return to `pending` with their full pending amount. Sending this field on a `PATCH` update has no effect.' concept: anyOf: - type: string - type: 'null' title: Concept description: Free-text description of the operation. examples: - 'Invoice #2024-001' amount: anyOf: - type: number - type: 'null' title: Amount description: Total amount of the operation, in `currency`. examples: - 1250.5 accountingAmount: anyOf: - type: number - type: 'null' title: Accountingamount description: Amount of the operation expressed in the company accounting currency. examples: - 1250.5 pendingAmount: anyOf: - type: number - type: 'null' title: Pendingamount description: Amount still pending settlement, in `currency`. examples: - 1250.5 pendingAccountingAmount: anyOf: - type: number - type: 'null' title: Pendingaccountingamount description: Amount still pending settlement, expressed in the accounting currency. examples: - 1250.5 currency: anyOf: - $ref: '#/components/schemas/CurrencyEnum' - type: 'null' description: ISO currency code of `amount`. examples: - EUR accountingCurrency: anyOf: - $ref: '#/components/schemas/CurrencyEnum' - type: 'null' description: ISO currency code of `accountingAmount`. examples: - EUR exchangeRate: anyOf: - type: number - type: 'null' title: Exchangerate description: Exchange rate applied between `currency` and `accountingCurrency`. examples: - 1.0 paymentMethod: anyOf: - type: string - type: 'null' title: Paymentmethod description: Payment method associated with the operation (e.g. `bank-transaction`, `promissory-note`). examples: - bank-transaction contact: anyOf: - $ref: '#/components/schemas/BaseContactSchema-Input' - type: 'null' description: Contact (client/supplier) the operation is due from or to. additionalInfo: anyOf: - additionalProperties: true type: object - type: 'null' title: Additionalinfo description: Free-form key/value metadata to attach to the operation. invoiceGroupDocumentId: anyOf: - type: string - type: 'null' title: Invoicegroupdocumentid description: Identifier of the invoice group this operation belongs to, if any. sync: type: boolean title: Sync description: Marks the operation as synchronized on your side. default: false documentId: anyOf: - type: string - type: 'null' title: Documentid description: Identifier of the source document (e.g. invoice number). attributes: anyOf: - items: $ref: '#/components/schemas/AttributeValueRequestSchema' type: array - type: 'null' title: Attributes description: Custom attribute values to attach to the operation. externalReference: anyOf: - type: string - type: 'null' title: Externalreference description: Free-form reference to this operation in an external system. customId: type: string title: Customid description: Embat custom/auto-generated unique operation ID. You can use it as your own custom ERP operation ID. type: object required: - customId title: AuxBulkPatchOperationsRequestSchema ContactAddressSchema: properties: postalCode: anyOf: - type: string - type: 'null' title: Postalcode description: Postal/ZIP code. Required by some payment rails (e.g. SEPA, SWIFT, ACH, Fedwire, BACS, CHAPS, Faster Payments, EFT) depending on the destination country and currency. examples: - '28001' address: anyOf: - type: string - type: 'null' title: Address description: Complete street address (street type, name, number, floor/flat...). Required by some payment rails depending on the destination country and currency. examples: - Calle Mayor 10, 3B province: anyOf: - type: string - type: 'null' title: Province description: Province, state or region. Required by some payment rails depending on the destination country and currency. examples: - Madrid city: anyOf: - type: string - type: 'null' title: City description: City. Required by some payment rails depending on the destination country and currency. examples: - Madrid country: anyOf: - type: string - type: 'null' title: Country description: Country name. Required by some payment rails depending on the destination country and currency. examples: - Spain type: object title: ContactAddressSchema ISOCountryCodes: type: string enum: - AF - AX - AL - DZ - AS - AD - AO - AI - AQ - AG - AR - AM - AW - AU - AT - AZ - BS - BH - BD - BB - BY - BE - BZ - BJ - BM - BT - BO - BQ - BA - BW - BV - BR - IO - BN - BG - BF - BI - CV - KH - CM - CA - KY - CF - TD - CL - CN - CX - CC - CO - KM - CG - CD - CK - CR - CI - HR - CU - CW - CY - CZ - DK - DJ - DM - DO - EC - EG - SV - GQ - ER - EE - SZ - ET - FK - FO - FJ - FI - FR - GF - PF - TF - GA - GM - GE - DE - GH - GI - GR - GL - GD - GP - GU - GT - GG - GN - GW - GY - HT - HM - VA - HN - HK - HU - IS - IN - ID - IR - IQ - IE - IM - IL - IT - JM - JP - JE - JO - KZ - KE - KI - KP - KR - KW - KG - LA - LV - LB - LS - LR - LY - LI - LT - LU - MO - MG - MW - MY - MV - ML - MT - MH - MQ - MR - MU - YT - MX - FM - MD - MC - MN - ME - MS - MA - MZ - MM - NA - NR - NP - NL - NC - NZ - NI - NE - NG - NU - NF - MK - MP - 'NO' - OM - PK - PW - PS - PA - PG - PY - PE - PH - PN - PL - PT - PR - QA - RE - RO - RU - RW - BL - SH - KN - LC - MF - PM - VC - WS - SM - ST - SA - SN - RS - SC - SL - SG - SX - SK - SI - SB - SO - ZA - GS - SS - ES - LK - SD - SR - SJ - SE - CH - SY - TW - TJ - TZ - TH - TL - TG - TK - TO - TT - TN - TR - TM - TC - TV - UG - UA - AE - GB - US - UM - UY - UZ - VU - VE - VN - VG - VI - WF - EH - XK - YE - ZM - ZW title: ISOCountryCodes OperationDocumentTypeEnum: type: string enum: - invoice - other - note - invoiceGroup - confirming - deposit - factoring - tax - amortizationQuote - amortizationInterest - amortizationTax - refund - paymentDocument - cheque - deliveryNote - purchaseOrder - employeeExpense title: OperationDocumentTypeEnum ContactNewAccountDetails: properties: iban: anyOf: - type: string - type: 'null' title: Iban description: International Bank Account Number. Used to identify accounts in IBAN-based rails (e.g. SEPA). Spaces are removed and the value is upper-cased before storage. examples: - ES9121000418450200051332 bic: anyOf: - type: string - type: 'null' title: Bic description: Bank Identifier Code (BIC/SWIFT) of the account. Spaces are removed and the value is upper-cased before storage. examples: - BBVAESMMXXX swift: anyOf: - type: string - type: 'null' title: Swift description: 'Deprecated alias of `bic` kept for backward compatibility: when sent, its value overrides `bic`. Spaces are removed and the value is upper-cased before storage.' examples: - BBVAESMMXXX accountNumber: anyOf: - type: string - type: 'null' title: Accountnumber description: Local account number, used by non-IBAN rails (e.g. accounts in ARS, AUD, BRL, CAD, JPY...). Spaces are removed and the value is upper-cased before storage. examples: - '123456789' accountType: anyOf: - $ref: '#/components/schemas/AccountTypeEnum' - type: 'null' description: Type of the local account (`CHECKING` or `SAVINGS`). An empty string is treated the same as omitting this field. routingNumber: anyOf: - type: string - type: 'null' title: Routingnumber description: 9-digit ABA routing number identifying the bank, used by US ACH/Fedwire transfers. Spaces are removed and the value is upper-cased before storage. examples: - '021000021' sortCode: anyOf: - type: string - type: 'null' title: Sortcode description: 6-digit sort code identifying the bank branch, used by UK BACS/CHAPS/Faster Payments transfers. Spaces are removed and the value is upper-cased before storage. examples: - '040004' institutionNumber: anyOf: - type: string - type: 'null' title: Institutionnumber description: 3-digit institution number identifying the bank, used together with `transitNumber` by Canadian EFT transfers. Spaces are removed and the value is upper-cased before storage. examples: - '001' transitNumber: anyOf: - type: string - type: 'null' title: Transitnumber description: 5-digit transit number identifying the bank branch, used together with `institutionNumber` by Canadian EFT transfers. Spaces are removed and the value is upper-cased before storage. examples: - '12345' bankCode: anyOf: - type: string - type: 'null' title: Bankcode description: Local bank identifier code, used by rails not covered by the other fields. branchCode: anyOf: - type: string - type: 'null' title: Branchcode description: Local bank branch code, used by rails not covered by the other fields. bsb: anyOf: - type: string - type: 'null' title: Bsb description: 6-digit BSB code identifying the bank and branch, used by Australian bank transfers. examples: - 062-000 bankCountryCode: anyOf: - $ref: '#/components/schemas/ISOCountryCodes' - type: 'null' description: ISO 3166-1 alpha-2 country code of the bank holding this account. An empty string is treated the same as omitting this field. examples: - ES type: object title: ContactNewAccountDetails BulkPatchOperationsRequestSchema: properties: data: items: $ref: '#/components/schemas/AuxBulkPatchOperationsRequestSchema' type: array title: Data description: Operations to update, identified by `customId`. type: object required: - data title: BulkPatchOperationsRequestSchema AttributeValueRequestSchema: properties: customId: type: string title: Customid description: Custom ID of the attribute (see the Attributes endpoints) being set. examples: - cost-center value: type: string title: Value description: Display text of the value being set on this entity. examples: - Marketing valueCustomId: anyOf: - type: string - type: 'null' title: Valuecustomid description: Custom ID of one of the attribute's predefined `values`, when the attribute is of type `list`. Leave unset for free-form `string`/`number` attributes. examples: - marketing parentCustomId: anyOf: - type: string - type: 'null' title: Parentcustomid description: Not used when attaching an attribute value to an entity. type: object required: - customId - value title: AttributeValueRequestSchema description: 'Attaches an attribute value to another entity (payment, contact, operation, transaction, accounting entry...).' DeleteOperationsAttributesRequestSchema: properties: customId: type: string title: Customid description: Custom ID of the operation to remove attributes from. attributesCustomIds: items: type: string type: array title: Attributescustomids description: Custom IDs of the internal attributes to remove from the operation. type: object required: - customId - attributesCustomIds title: DeleteOperationsAttributesRequestSchema ListOperationsResponseSchema: properties: data: items: $ref: '#/components/schemas/GetOperationsResponseSchema' type: array title: Data description: Operations matching the query. nextPageToken: anyOf: - type: string - type: 'null' title: Nextpagetoken description: Token to fetch the next page of results. `null` when there are no more pages. type: object required: - data title: ListOperationsResponseSchema DeleteOperationsRequestSchema: properties: customId: type: string title: Customid description: Custom ID of the operation to delete. type: object required: - customId title: DeleteOperationsRequestSchema AccountTypeEnum: type: string enum: - CHECKING - SAVINGS title: AccountTypeEnum ContactSchema-Input: properties: phone: anyOf: - type: string - type: 'null' title: Phone description: Phone number of the contact person. examples: - '+34600000000' email: anyOf: - type: string - type: 'null' title: Email description: Email address of the contact person. Required to pay this contact by Interac e-Transfer in CAD. examples: - billing@acme-supplies.com name: anyOf: - type: string - type: 'null' title: Name description: First name of the contact person. examples: - John surname: anyOf: - type: string - type: 'null' title: Surname description: Last name of the contact person. examples: - Doe type: object title: ContactSchema BulkPostOperationsAttributesRequestSchema: properties: data: items: $ref: '#/components/schemas/PostOperationsAttributesRequestSchema' type: array title: Data description: Attribute values to add, grouped by operation. type: object required: - data title: BulkPostOperationsAttributesRequestSchema BulkPostOperationsRequestSchema: properties: data: items: $ref: '#/components/schemas/PostOperationsRequestSchema' type: array title: Data description: Operations to create. type: object required: - data title: BulkPostOperationsRequestSchema ErrorResponse: properties: detail: type: string title: Detail description: Human-readable explanation of the error. examples: - user not authorized type: object required: - detail title: ErrorResponse description: Error payload returned by the API (FastAPI `detail` convention). HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError BulkUpsertOperationsResponseSchema: properties: data: items: $ref: '#/components/schemas/UpsertOperationsResponseSchema' type: array title: Data description: Result of the bulk operation, one entry per operation. type: object required: - data title: BulkUpsertOperationsResponseSchema BulkDeleteOperationsRequestSchema: properties: data: items: $ref: '#/components/schemas/DeleteOperationsRequestSchema' type: array title: Data description: Operations to delete, identified by `customId`. type: object required: - data title: BulkDeleteOperationsRequestSchema BaseContactSchema-Input: properties: tradeName: anyOf: - type: string - type: 'null' title: Tradename description: Commercial/trade name of the contact. Defaults to `legalName` when omitted or blank. examples: - Acme Supplies legalName: anyOf: - type: string - type: 'null' title: Legalname description: Legal (registered) name of the contact. examples: - Acme Supplies S.L. taxId: anyOf: - type: string - type: 'null' title: Taxid description: Tax identification number (CIF/NIF/VAT) of the contact. Spaces are removed before storage. examples: - B12345678 contact: anyOf: - $ref: '#/components/schemas/ContactSchema-Input' - type: 'null' description: Contact person details (name, phone, email) for this contact. address: anyOf: - $ref: '#/components/schemas/ContactAddressSchema' - type: 'null' description: Postal address of the contact. contactType: $ref: '#/components/schemas/ContactContactTypeEnum' description: Whether the contact is a `company` or a `freelance` individual. Defaults to `company`. default: company type: anyOf: - $ref: '#/components/schemas/ContactTypeEnum' - type: 'null' description: 'Commercial relationship with the contact: `client`, `supplier` or `client-supplier`.' accounts: anyOf: - items: $ref: '#/components/schemas/ContactAccounts' type: array - type: 'null' title: Accounts description: 'Bank accounts of the contact. When omitted (or empty) and `paymentsAccounts` is provided, Embat derives one entry per payment account automatically: the derived `iban` holds the payment identifier resolved for the account''s currency (an IBAN for IBAN-based currencies, otherwise the local account number), `swift` takes the account''s `bic`, and `default` its `default` flag.' paymentsAccounts: anyOf: - items: $ref: '#/components/schemas/ContactNewAccount' type: array - type: 'null' title: Paymentsaccounts description: Bank accounts of the contact, one per currency/payment rail, with the identifiers required to pay it (IBAN, account number, routing number...). Each entry is validated independently and **silently discarded** when it has no usable account identifier for its `currency` (neither `iban` nor `accountNumber` set); format validity of the identifiers themselves is not enforced. Entries that resolve to the same account identifier are deduplicated, keeping only the first one. additionalInfo: anyOf: - additionalProperties: true type: object - type: 'null' title: Additionalinfo description: Free-form key/value metadata to attach to the contact. accountingCode: anyOf: - type: string - type: 'null' title: Accountingcode description: Accounting account code this contact is linked to. examples: - '4300001' paymentMethod: anyOf: - type: string - type: 'null' title: Paymentmethod description: Preferred payment method for this contact. examples: - bank-transaction paymentTerms: anyOf: - type: integer - type: 'null' title: Paymentterms description: Payment terms granted to the contact, in days. examples: - 30 attributes: anyOf: - items: $ref: '#/components/schemas/AttributeValueRequestSchema' type: array - type: 'null' title: Attributes description: Custom attribute values to attach to the contact. customId: anyOf: - type: string - type: 'null' title: Customid description: Your own unique ID for the contact. If omitted, Embat auto-generates one. examples: - erp-contact-001 type: object title: BaseContactSchema PatchOperationsRequestSchema: properties: status: anyOf: - $ref: '#/components/schemas/OperationStatusEnum' - type: 'null' description: 'Status of the operation: `pending`, `overdue`, `payment_in_progress`, `paid`, `cancel`, or the legacy values `paymentOrder` and `shipped` (avoid using them in new integrations). Setting `paid` also resets `pendingAmount` and `pendingAccountingAmount` to 0.' examples: - pending paymentDate: anyOf: - type: string format: date-time - type: 'null' title: Paymentdate description: Date the operation is expected to be (or was) paid. Only the calendar date is meaningful; the time component is not preserved as sent. chargeAccount: anyOf: - type: string - type: 'null' title: Chargeaccount description: IBAN of your own bank account the operation is charged to. contactAccount: anyOf: - type: string - type: 'null' title: Contactaccount description: IBAN of the counterparty's (contact's) bank account. issuanceDate: anyOf: - type: string format: date-time - type: 'null' title: Issuancedate description: Issuance date of the operation's source document. Only the calendar date is meaningful; the time component is not preserved as sent. dueDate: anyOf: - type: string format: date-time - type: 'null' title: Duedate description: Due date of the operation. Only the calendar date is meaningful; the time component is not preserved as sent. accountingCode: anyOf: - type: string - type: 'null' title: Accountingcode description: Accounting account code the operation is posted to. accountingName: anyOf: - type: string - type: 'null' title: Accountingname description: Accounting account name the operation is posted to. operationsCustomIds: anyOf: - items: type: string type: array - type: 'null' title: Operationscustomids description: 'Custom IDs of other operations grouped under this one, to represent an invoice group or remittance (typically combined with `documentType` set to `invoiceGroup`). Takes effect on `POST` (create or upsert): each referenced operation is marked `paid`, its `pendingAmount`/`pendingAccountingAmount` set to 0 and its payment date set to this operation''s `paymentDate`. Resending the remittance without some previously grouped operations releases them: they return to `pending` with their full pending amount. Sending this field on a `PATCH` update has no effect.' concept: anyOf: - type: string - type: 'null' title: Concept description: Free-text description of the operation. examples: - 'Invoice #2024-001' amount: anyOf: - type: number - type: 'null' title: Amount description: Total amount of the operation, in `currency`. examples: - 1250.5 accountingAmount: anyOf: - type: number - type: 'null' title: Accountingamount description: Amount of the operation expressed in the company accounting currency. examples: - 1250.5 pendingAmount: anyOf: - type: number - type: 'null' title: Pendingamount description: Amount still pending settlement, in `currency`. examples: - 1250.5 pendingAccountingAmount: anyOf: - type: number - type: 'null' title: Pendingaccountingamount description: Amount still pending settlement, expressed in the accounting currency. examples: - 1250.5 currency: anyOf: - $ref: '#/components/schemas/CurrencyEnum' - type: 'null' description: ISO currency code of `amount`. examples: - EUR accountingCurrency: anyOf: - $ref: '#/components/schemas/CurrencyEnum' - type: 'null' description: ISO currency code of `accountingAmount`. examples: - EUR exchangeRate: anyOf: - type: number - type: 'null' title: Exchangerate description: Exchange rate applied between `currency` and `accountingCurrency`. examples: - 1.0 paymentMethod: anyOf: - type: string - type: 'null' title: Paymentmethod description: Payment method associated with the operation (e.g. `bank-transaction`, `promissory-note`). examples: - bank-transaction contact: anyOf: - $ref: '#/components/schemas/BaseContactSchema-Input' - type: 'null' description: Contact (client/supplier) the operation is due from or to. additionalInfo: anyOf: - additionalProperties: true type: object - type: 'null' title: Additionalinfo description: Free-form key/value metadata to attach to the operation. invoiceGroupDocumentId: anyOf: - type: string - type: 'null' title: Invoicegroupdocumentid description: Identifier of the invoice group this operation belongs to, if any. sync: type: boolean title: Sync description: Marks the operation as synchronized on your side. default: false documentId: anyOf: - type: string - type: 'null' title: Documentid description: Identifier of the source document (e.g. invoice number). attributes: anyOf: - items: $ref: '#/components/schemas/AttributeValueRequestSchema' type: array - type: 'null' title: Attributes description: Custom attribute values to attach to the operation. externalReference: anyOf: - type: string - type: 'null' title: Externalreference description: Free-form reference to this operation in an external system. type: object title: PatchOperationsRequestSchema UpsertOperationsResponseSchema: properties: id: type: string title: Id description: Embat resource ID customId: type: string title: Customid description: Client-provided custom ID type: object required: - id - customId title: UpsertOperationsResponseSchema securitySchemes: HTTPBearer: type: http scheme: bearer