{"openapi":"3.0.3","info":{"title":"Reconcilia Integration API","description":"Partner-facing contract for tenant-scoped ERP, bank, TMS, FP&A, and integration-service connections.\n\n## Introduction\nUse this API to load reference data, submit bank statement activity, submit ERP/accounting source data, publish expected Cash Position rows, provide Forecast manual inputs, and inspect reconciliation visibility. The API is separate from the authenticated Reconcilia application API.\n\n## Agents and the Reconcilia MCP\nUse the separately configured Reconcilia MCP server for versioned architecture, lifecycle, dataflow, guardrail, and API-access guidance. The MCP server is information-only: it exposes no tenant-data tools, does not proxy Integration API requests, and never receives an Integration API key.\n\nConfigure an Integration API connector independently when an agent needs tenant data or permitted CRUD. Store its tenant-scoped key in the connector's approved secret store and send it directly to this API. This API remains authoritative for tenant selection, authentication, validation, idempotency, lifecycle outcomes, and audit.\nA credential classified as an Agent connection still uses the same Access Scope contract. Agent classification provides independent visibility and Disconnect behavior; it never forces read-only access. Use one dedicated key per agent connection, and explicitly confirm `full_access` when an implementation agent requires the complete API surface.\n\n## Authentication\nSend the integration key in `x-api-key: <key>` or `Authorization: ApiKey <key>`. `Authorization: Bearer` is reserved for user-session authentication and is not accepted for integration keys.\n\n## Scopes\n- `full_access`: complete Integration API access, including supported master/setup and source-data writes.\n- `read_only`: read reference and visibility data.\n- `transactions`: submit statement, file, ERP, Cash Position, and Forecast source data.\n- `reconciliation`: read reconciliation suggestions and match groups.\n- `reports`: read report-oriented reference and visibility data.\n\n## Current Coverage\n- Master/setup data: entities, bank accounts, GL accounts, counterparties, category definitions, category hierarchies, and category nodes.\n- Bank ingestion: direct JSON statements, single files, multi-file packages, jobs, retries, and logs.\n- Accounting source data: ERP documents, AP/AR open items, open-item settlement links, bank auxiliary entries, generated journal-entry pull, ERP lifecycle callbacks, and payment journals.\n- Planning data: expected Cash Position entries and Forecast manual inputs.\n- Reconciliation visibility: suggestions and match groups are read-only in this public phase.\n- Counterparty identity: `counterpartyId` is the Reconcilia internal UUID. For writes that reference a party, callers may instead send `externalSystem`/`counterpartyExternalSystem` plus `externalCounterpartyId`; Reconcilia resolves and returns the internal id.\n- ERP document identity: `docNo` is the caller/source document number and is part of the write idempotency key. `externalSystem` + `externalDocumentId` can also be stored for ERP-side mapping and can be updated through document transmission callbacks.\n- ERP document party model: header `counterpartyId` represents the primary document party for AP/AR invoices; line `counterpartyId` represents party-specific allocations, payment rows, or mixed journals.\n- Bank account identity: bank statement and bank auxiliary writes resolve accounts by `bankAccountId`, `accountCode`, `statementAccountNumber`, or `accountNumber`. Account names are not used as integration identifiers.\n\n## Boundaries\nThis API does not move money, approve payments, approve reconciliation decisions, or post directly into an ERP. Generated ERP documents can be pulled by an ERP connector, then status can be reported back through lifecycle endpoints.\n\nUse the Schemas section for reusable field definitions, enum values, and payload shapes. Use `VALIDATE_ONLY` before `AUTO` when loading a new source feed.","version":"1.0.0"},"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"Tenant-scoped integration API key. Send `x-api-key: <key>` or `Authorization: ApiKey <key>`. Bearer tokens are reserved for user-session authentication."}},"schemas":{"ProcessingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"description":"AUTO writes or queues valid data. VALIDATE_ONLY validates without writing.","x-enumDescriptions":["Write or queue valid data.","Validate payloads and return row-level results without writes."]},"ConflictPolicy":{"type":"string","enum":["BLOCK","SUPERSEDE","ALLOW"],"description":"Duplicate/conflict behavior. Not every endpoint supports every value; endpoint schemas show the accepted subset.","x-enumDescriptions":["Reject duplicates or conflicting rows.","Replace or supersede existing records where correction flows explicitly allow it.","Allow repeated source rows where planning feeds intentionally accept repeated source facts."]},"CounterpartyType":{"type":"string","enum":["CUSTOMER","VENDOR","EMPLOYEE","BANK","OTHER"],"description":"Allowed counterparty classifications.","x-enumDescriptions":["Payer, debtor, or customer.","Supplier, payee, or vendor.","Payroll or employee-related counterparty.","Financial institution.","Fallback when the party does not fit a standard type."]},"GlAccountType":{"type":"string","enum":["ASSET","LIABILITY","EQUITY","REVENUE","EXPENSE","OTHER"],"description":"Allowed chart-of-account classifications.","x-enumDescriptions":["Cash, bank, receivable, and other asset accounts.","Payables, debt, and obligations.","Owner or shareholder equity.","Income accounts.","Costs, fees, and operating expenses.","Fallback when the source chart does not map cleanly."]},"ErpDocumentType":{"type":"string","enum":["JE","JOURNAL_ENTRY","AP_INVOICE","AR_INVOICE","PAYMENT","RECEIPT","CREDIT_NOTE","DEBIT_NOTE","OTHER"],"description":"ERP source-document type. PAYMENT and RECEIPT are source data only and do not move money.","x-enumDescriptions":["General ledger journal entry alias.","General ledger journal entry.","Vendor invoice.","Customer invoice.","Payment source data only.","Receipt source data only.","Credit memo.","Debit memo.","Fallback source document."]},"OpenItemType":{"type":"string","enum":["AP","AR"],"description":"AP is a vendor payable open item; AR is a customer receivable open item.","x-enumDescriptions":["Vendor invoice payable by the entity.","Customer invoice receivable by the entity."]},"OpenItemStatus":{"type":"string","enum":["OPEN","PARTIALLY_SETTLED","SETTLED","CLOSED","PAID","DISPUTED","ON_HOLD","CANCELLED","CANCELED","VOID","VOIDED","REVERSED"],"description":"Invoice receivable/payable lifecycle status. Terminal statuses plus openAmount=0 close an item.","x-enumDescriptions":["Unsettled item.","Partially paid or collected.","Settled against payment/receipt activity.","Closed by the source system.","Paid/collected by the source system.","Under dispute.","Temporarily held.","Canceled spelling variant.","US spelling variant.","Voided by the source system.","Voided spelling variant.","Reversed by the source system."]},"OpenItemSettlementSourceType":{"type":"string","enum":["BANK_AUXILIARY","ERP_DOCUMENT","ERP_DOCUMENT_LINE","PAYMENT_JOURNAL_LINE","BANK_TRANSACTION","CASH_POSITION_ENTRY","MANUAL"],"description":"Source row or object used as settlement evidence for an AP/AR open item.","x-enumDescriptions":["Reconcilia bank auxiliary expected entry.","ERP payment, receipt, or other settlement document header.","ERP document line.","Payment-journal line read model.","Bank transaction imported from statements or a bank integration.","Cash Position expected/confirmed entry.","Manual settlement evidence without a source row id."]},"OpenItemSettlementStatus":{"type":"string","enum":["PROPOSED","APPLIED","REVERSED","CANCELLED"],"description":"Settlement evidence status. This does not approve reconciliation by itself."},"OpenItemSettlementLinkSource":{"type":"string","enum":["ERP","MANUAL","IMPORT","INTEGRATION_API","RECONCILIA_MATCH","AI_REVIEW","SYSTEM"],"description":"Origin of the settlement link record."},"CashDirection":{"type":"string","enum":["INFLOW","OUTFLOW"],"description":"Cash movement direction. INFLOW increases cash; OUTFLOW decreases cash."},"CategoryNature":{"type":"string","enum":["INFLOW","OUTFLOW","UNDEFINED","OTHER"],"description":"Category cash-flow nature. UNDEFINED and OTHER are non-directional."},"AccountingDirection":{"type":"string","enum":["DEBIT","CREDIT","INFLOW","OUTFLOW"],"description":"Accounting or cash line direction accepted by ERP and payment source data."},"StatementType":{"type":"string","enum":["PRIOR_DAY","INTRADAY","TRANSACTION_BATCH"],"description":"PRIOR_DAY is official end-of-day balance/activity, INTRADAY is same-day activity, TRANSACTION_BATCH is review-first history/backfill."},"SourceFormat":{"type":"string","enum":["CSV","MT940","MT942","CAMT053","CAMT052","PDF"],"description":"Supported statement/file source formats."},"Metadata":{"type":"object","additionalProperties":true,"description":"Free-form source metadata. Do not send secrets or credentials."},"ErrorResponse":{"type":"object","required":["error","message"],"additionalProperties":false,"properties":{"error":{"type":"string","example":"bad_request"},"message":{"type":"string","example":"Invalid request payload."}}},"IdempotencyResult":{"type":"object","required":["key","replayed","requestBodyHash"],"additionalProperties":false,"properties":{"key":{"type":"string"},"replayed":{"type":"boolean"},"requestBodyHash":{"type":"string"}}},"PaginatedResponse":{"type":"object","required":["data","nextPageToken"],"additionalProperties":false,"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true}},"nextPageToken":{"type":"string","nullable":true}}},"BulkCreateRequest":{"type":"object","required":["rows"],"additionalProperties":false,"properties":{"processingMode":{"$ref":"#/components/schemas/ProcessingMode"},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK"},"requestReference":{"type":"string","nullable":true,"maxLength":255},"rows":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","required":["clientRef","data"],"additionalProperties":false,"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200},"data":{"type":"object","additionalProperties":true}}}}}},"BulkCreateResponse":{"type":"object","required":["processingMode","summary","rows","idMap"],"additionalProperties":false,"properties":{"processingMode":{"$ref":"#/components/schemas/ProcessingMode"},"requestReference":{"type":"string","nullable":true},"summary":{"type":"object","required":["received","valid","blocked","created"],"additionalProperties":false,"properties":{"received":{"type":"integer"},"valid":{"type":"integer"},"blocked":{"type":"integer"},"created":{"type":"integer"}}},"rows":{"type":"array","items":{"type":"object","required":["index","clientRef","status"],"additionalProperties":false,"properties":{"index":{"type":"integer"},"clientRef":{"type":"string"},"status":{"type":"string","enum":["VALID","BLOCKED","CREATED"]},"id":{"type":"string","nullable":true},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}},"idMap":{"type":"object","additionalProperties":{"type":"string"},"description":"Maps clientRef to created record id for AUTO requests."}}},"Entity":{"type":"object","required":["id","orgId","name","currency","isActive","createdAt","updatedAt"],"additionalProperties":false,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"taxIdType":{"type":"string","nullable":true},"taxId":{"type":"string","nullable":true},"activityDescription":{"type":"string","nullable":true},"currency":{"type":"string","minLength":3,"maxLength":3,"example":"USD"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"EntityCreateRequest":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"example":"US Operating Entity"},"taxIdType":{"type":"string","nullable":true,"example":"EIN"},"taxId":{"type":"string","nullable":true,"example":"12-3456789"},"activityDescription":{"type":"string","nullable":true},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD"},"isActive":{"type":"boolean","default":true}}},"BankAccount":{"type":"object","required":["id","orgId","entityId","name","currency","isActive","connectionStatus","createdAt","updatedAt"],"additionalProperties":false,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"name":{"type":"string"},"institution":{"type":"string","nullable":true},"accountCode":{"type":"string","nullable":true,"description":"User-facing Account ID/code. Distinct from the internal id, account number, and statement account number."},"officialName":{"type":"string","nullable":true},"accountNumber":{"type":"string","nullable":true},"statementAccountNumber":{"type":"string","nullable":true},"routingNumber":{"type":"string","nullable":true},"mask":{"type":"string","nullable":true},"type":{"type":"string","nullable":true,"example":"checking"},"currency":{"type":"string","minLength":3,"maxLength":3},"initialBalance":{"nullable":true,"oneOf":[{"type":"number"},{"type":"string"}]},"isActive":{"type":"boolean"},"connectionStatus":{"type":"string","enum":["connected","disconnected","inactive","syncing","synced","manual","error"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"BankAccountCreateRequest":{"type":"object","required":["entityId","name"],"additionalProperties":false,"properties":{"entityId":{"type":"string"},"name":{"type":"string","minLength":1},"institution":{"type":"string","nullable":true},"accountCode":{"type":"string","nullable":true,"description":"User-facing Account ID/code. If omitted, Reconcilia may derive an initial value from the account name."},"officialName":{"type":"string","nullable":true},"accountNumber":{"type":"string","nullable":true},"statementAccountNumber":{"type":"string","nullable":true},"routingNumber":{"type":"string","nullable":true},"mask":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD"},"initialBalance":{"nullable":true,"oneOf":[{"type":"number"},{"type":"string"}]},"connectionStatus":{"type":"string","enum":["connected","disconnected","inactive","syncing","synced","manual","error"],"default":"manual"},"isActive":{"type":"boolean","default":true}}},"GlAccount":{"type":"object","required":["id","orgId","entityId","accountCode","accountName","accountType","isActive","createdAt","updatedAt"],"additionalProperties":false,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"accountCode":{"type":"string","example":"1000"},"accountName":{"type":"string","example":"Operating Cash"},"accountType":{"$ref":"#/components/schemas/GlAccountType"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"GlAccountCreateRequest":{"type":"object","required":["entityId","accountCode","accountName","accountType"],"additionalProperties":false,"properties":{"entityId":{"type":"string"},"accountCode":{"type":"string"},"accountName":{"type":"string"},"accountType":{"$ref":"#/components/schemas/GlAccountType"},"isActive":{"type":"boolean","default":true}}},"Counterparty":{"type":"object","description":"Customer, vendor, employee, bank, or other party. The id is the stable Reconcilia internal UUID; externalSystem/externalCounterpartyId are the ERP-side mapping keys.","required":["id","orgId","entityId","type","name","createdAt","updatedAt"],"additionalProperties":false,"properties":{"id":{"type":"string","description":"Reconcilia internal counterparty UUID returned for ERP mapping."},"orgId":{"type":"string"},"entityId":{"type":"string"},"type":{"$ref":"#/components/schemas/CounterpartyType"},"name":{"type":"string"},"taxId":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"externalSystem":{"type":"string","nullable":true,"description":"Source ERP/integration system that owns externalCounterpartyId."},"externalCounterpartyId":{"type":"string","nullable":true,"description":"Source ERP vendor/customer/party id. Unique per entityId + externalSystem when supplied."},"defaultCategoryDefinitionId":{"type":"string","nullable":true,"description":"Default Reconcilia category definition UUID for this counterparty."},"defaultCategoryNodeId":{"type":"string","nullable":true,"description":"Default Reconcilia category node UUID for this counterparty."},"categorizationMetadata":{"$ref":"#/components/schemas/Metadata"},"metadata":{"allOf":[{"$ref":"#/components/schemas/Metadata"}],"description":"Free-form source metadata. Use first-class externalSystem/externalCounterpartyId for stable ERP identity mapping."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CounterpartyCreateRequest":{"type":"object","description":"Creates a Reconcilia counterparty. Send externalSystem + externalCounterpartyId when the ERP has a stable vendor/customer code; the response returns the Reconcilia id for future calls.","required":["entityId","type","name"],"additionalProperties":false,"properties":{"entityId":{"type":"string"},"type":{"$ref":"#/components/schemas/CounterpartyType"},"name":{"type":"string"},"taxId":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"externalSystem":{"type":"string","nullable":true,"description":"Source ERP/integration system that owns externalCounterpartyId."},"externalCounterpartyId":{"type":"string","nullable":true,"description":"Source ERP vendor/customer/party id. Unique per entityId + externalSystem when supplied."},"externalId":{"type":"string","nullable":true,"description":"Alias accepted for externalCounterpartyId."},"defaultCategoryDefinitionId":{"type":"string","nullable":true,"description":"Optional Reconcilia category definition UUID to use as this counterparty default."},"defaultCategoryNodeId":{"type":"string","nullable":true,"description":"Optional Reconcilia category node UUID to use as this counterparty default."},"categorizationMetadata":{"$ref":"#/components/schemas/Metadata"},"metadata":{"allOf":[{"$ref":"#/components/schemas/Metadata"}],"description":"Free-form source metadata for non-identity details."}}},"CategoryDefinition":{"type":"object","required":["id","orgId","code","name","categoryNature","isActive","createdAt","updatedAt"],"additionalProperties":false,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"createdByEntityId":{"type":"string","nullable":true},"createdByEntityName":{"type":"string","nullable":true},"code":{"type":"string","description":"Stable category definition code suitable for external mapping."},"name":{"type":"string"},"description":{"type":"string","nullable":true},"categoryNature":{"$ref":"#/components/schemas/CategoryNature"},"isSystem":{"type":"boolean"},"isActive":{"type":"boolean"},"approvalStatus":{"type":"string"},"approvedAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CategoryHierarchy":{"type":"object","required":["id","orgId","name","purpose","ownerType","isActive","createdAt","updatedAt"],"additionalProperties":false,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string","nullable":true},"entityName":{"type":"string","nullable":true},"entityGroupId":{"type":"string","nullable":true},"entityGroupName":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"purpose":{"type":"string"},"accessScope":{"type":"string"},"ownerType":{"type":"string","enum":["ORG_TEMPLATE","ENTITY_PRIVATE","GROUP_SHARED"]},"usages":{"type":"array","items":{"type":"object","additionalProperties":true}},"nodeCount":{"type":"integer"},"assignmentCount":{"type":"integer"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CategoryNode":{"type":"object","required":["id","orgId","hierarchyId","nodeType","name","sortOrder","isActive","createdAt","updatedAt"],"additionalProperties":false,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"hierarchyId":{"type":"string"},"parentId":{"type":"string","nullable":true},"parentName":{"type":"string","nullable":true},"nodeType":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"sortOrder":{"type":"integer"},"categoryDefinitionId":{"type":"string","nullable":true},"categoryDefinitionCode":{"type":"string","nullable":true},"categoryDefinitionName":{"type":"string","nullable":true},"categoryNature":{"anyOf":[{"$ref":"#/components/schemas/CategoryNature"},{"type":"null"}]},"globalMappingId":{"type":"string","nullable":true},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"ErpDocumentLine":{"type":"object","description":"ERP document line. Use either debit/credit or amount/direction. Line counterparty is optional and overrides the header party for party-specific matching.","additionalProperties":false,"properties":{"lineNo":{"type":"integer","nullable":true,"minimum":1},"accountId":{"type":"string","nullable":true},"accountCode":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"debit":{"oneOf":[{"type":"number"},{"type":"string"}],"nullable":true},"credit":{"oneOf":[{"type":"number"},{"type":"string"}],"nullable":true},"amount":{"oneOf":[{"type":"number"},{"type":"string"}]},"direction":{"$ref":"#/components/schemas/AccountingDirection"},"counterpartyId":{"type":"string","nullable":true,"description":"Reconcilia internal counterparty UUID for this allocation/payment line. Matching should prefer this value and fall back to the document header counterpartyId."},"counterpartyExternalSystem":{"type":"string","nullable":true,"description":"Source system for resolving this line externalCounterpartyId. Defaults to document externalSystem."},"externalCounterpartyId":{"type":"string","nullable":true,"description":"External vendor/customer/party id used to resolve this line counterparty."},"counterpartyExternalId":{"type":"string","nullable":true,"description":"Alias accepted for externalCounterpartyId."},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"ErpDocument":{"type":"object","description":"Accounting source document. docNo is the source document number; externalSystem/externalDocumentId are ERP-side mapping keys and id is the Reconcilia internal UUID.","required":["id","orgId","entityId","docType","docNo","currency","lifecycleStatus","origin","erpDocumentLines","createdAt","updatedAt"],"additionalProperties":false,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"docType":{"$ref":"#/components/schemas/ErpDocumentType"},"docNo":{"type":"string","description":"Caller/source document number. Used with entityId and docType as the natural write idempotency key."},"docDate":{"type":"string","format":"date","nullable":true},"postingDate":{"type":"string","format":"date","nullable":true},"currency":{"type":"string","minLength":3,"maxLength":3},"counterpartyId":{"type":"string","nullable":true,"description":"Reconcilia internal counterparty UUID for the document-level party."},"totalAmount":{"oneOf":[{"type":"number"},{"type":"string"}],"nullable":true},"lifecycleStatus":{"type":"string","enum":["DRAFT","READY_TO_SEND","SENT","ACKNOWLEDGED","POSTED","REJECTED","CANCELLED"]},"origin":{"type":"string","enum":["EXTERNAL_ERP","RECONCILIA_GENERATED","MANUAL"]},"externalSystem":{"type":"string","nullable":true},"externalDocumentId":{"type":"string","nullable":true,"description":"External ERP/source document id used with externalSystem for ERP-side mapping."},"erpDocumentLines":{"type":"array","items":{"$ref":"#/components/schemas/ErpDocumentLine"}},"metadata":{"$ref":"#/components/schemas/Metadata"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"ErpDocumentCreateRequest":{"type":"object","description":"Creates accounting source data only. AP/AR invoices should set a header party using counterpartyId or externalSystem + externalCounterpartyId; use /integration/v1/open-items to maintain the related payable/receivable state. Payment/receipt batches should set line counterparties and settlement references in metadata.","required":["entityId","docType","docNo","docDate","postingDate","lines"],"additionalProperties":false,"properties":{"entityId":{"type":"string"},"docType":{"$ref":"#/components/schemas/ErpDocumentType"},"docNo":{"type":"string","description":"Caller/source document number. Use ERP invoice/payment number here. This remains the natural idempotency key with entityId + docType."},"docDate":{"type":"string","format":"date"},"postingDate":{"type":"string","format":"date"},"currency":{"type":"string","minLength":3,"maxLength":3},"counterpartyId":{"type":"string","nullable":true,"description":"Reconcilia internal counterparty UUID for the document-level party."},"counterpartyExternalSystem":{"type":"string","nullable":true,"description":"Source system for resolving the document-level externalCounterpartyId. Defaults to externalSystem."},"externalCounterpartyId":{"type":"string","nullable":true,"description":"External vendor/customer/party id used to resolve the document-level counterparty."},"counterpartyExternalId":{"type":"string","nullable":true,"description":"Alias accepted for externalCounterpartyId."},"externalSystem":{"type":"string","nullable":true,"description":"Source ERP/integration system for externalDocumentId and default counterparty external-id resolution."},"externalDocumentId":{"type":"string","nullable":true,"description":"Source ERP document id returned in Reconcilia responses for ERP-side mapping."},"externalId":{"type":"string","nullable":true,"description":"Alias accepted for externalDocumentId."},"totalAmount":{"oneOf":[{"type":"number"},{"type":"string"}],"nullable":true},"processingMode":{"$ref":"#/components/schemas/ProcessingMode"},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK"},"lines":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ErpDocumentLine"}},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"ErpDocumentTransmissionRequest":{"type":"object","required":["direction","status"],"additionalProperties":false,"properties":{"direction":{"type":"string","enum":["INBOUND","OUTBOUND"]},"transport":{"type":"string","nullable":true,"example":"WEBHOOK"},"status":{"type":"string","enum":["SENT","ACKNOWLEDGED","POSTED","REJECTED","FAILED"]},"externalSystem":{"type":"string","nullable":true},"externalDocumentId":{"type":"string","nullable":true},"externalStatus":{"type":"string","nullable":true},"responsePayload":{"$ref":"#/components/schemas/Metadata"}}},"OpenItem":{"type":"object","description":"AP/AR invoice settlement state from an auxiliary source feed. Optional ERP document linkage can be supplied when the source invoice document exists in Reconcilia. This is source state only and does not execute settlement or move money.","required":["id","orgId","openItemType","entityId","counterpartyId","invoiceNumber","invoiceDate","dueDate","originalAmount","openAmount","currencyCode","status","source","createdAt","updatedAt"],"additionalProperties":false,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"openItemType":{"$ref":"#/components/schemas/OpenItemType"},"entityId":{"type":"string"},"erpDocumentId":{"type":"string","nullable":true,"description":"Optional Reconcilia ERP document UUID. AP items can link to AP_INVOICE; AR items can link to AR_INVOICE."},"externalSystem":{"type":"string","nullable":true},"externalOpenItemId":{"type":"string","nullable":true},"counterpartyId":{"type":"string","description":"Reconcilia internal vendor/customer UUID. Must match the ERP document header counterparty when the document has one."},"invoiceNumber":{"type":"string"},"invoiceDate":{"type":"string","format":"date"},"dueDate":{"type":"string","format":"date"},"originalAmount":{"oneOf":[{"type":"number"},{"type":"string"}]},"openAmount":{"oneOf":[{"type":"number"},{"type":"string"}]},"currencyCode":{"type":"string","minLength":3,"maxLength":3},"expectedSettlementDate":{"type":"string","format":"date","nullable":true},"asOfDate":{"type":"string","format":"date","nullable":true},"sourceBatchId":{"type":"string","nullable":true},"paymentTermProfileId":{"type":"string","nullable":true},"settlementProfileId":{"type":"string","nullable":true},"status":{"$ref":"#/components/schemas/OpenItemStatus"},"source":{"type":"string","default":"ERP"},"metadata":{"$ref":"#/components/schemas/Metadata"},"integrationMutation":{"type":"string","enum":["CREATED","UPDATED","UNCHANGED"],"nullable":true},"openItemBatchId":{"type":"string","nullable":true},"openItemSnapshotId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"OpenItemCreateRequest":{"type":"object","description":"Creates or updates an AP payable or AR receivable open item from an auxiliary source feed. This endpoint only maintains source state and dated snapshots; ERP document linkage is optional.","required":["openItemType","entityId","invoiceNumber","invoiceDate","dueDate","originalAmount"],"additionalProperties":false,"properties":{"processingMode":{"$ref":"#/components/schemas/ProcessingMode"},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK"},"loadMode":{"type":"string","enum":["UPSERT_CURRENT","SNAPSHOT_CURRENT","FULL_REPLACEMENT"],"default":"UPSERT_CURRENT"},"openItemType":{"$ref":"#/components/schemas/OpenItemType"},"entityId":{"type":"string"},"erpDocumentId":{"type":"string","nullable":true},"externalSystem":{"type":"string","nullable":true},"externalOpenItemId":{"type":"string","nullable":true},"counterpartyId":{"type":"string","nullable":true},"externalCounterpartyId":{"type":"string","nullable":true},"invoiceNumber":{"type":"string"},"invoiceDate":{"type":"string","format":"date"},"dueDate":{"type":"string","format":"date"},"originalAmount":{"oneOf":[{"type":"number"},{"type":"string"}]},"openAmount":{"oneOf":[{"type":"number"},{"type":"string"}],"nullable":true,"description":"Defaults to originalAmount on create. Use 0 with a terminal status to close through PATCH."},"currency":{"type":"string","minLength":3,"maxLength":3,"nullable":true},"currencyCode":{"type":"string","minLength":3,"maxLength":3,"nullable":true},"expectedSettlementDate":{"type":"string","format":"date","nullable":true},"asOfDate":{"type":"string","format":"date","nullable":true},"sourceBatchId":{"type":"string","nullable":true},"status":{"$ref":"#/components/schemas/OpenItemStatus"},"source":{"type":"string","nullable":true,"default":"ERP"},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"OpenItemUpdateRequest":{"type":"object","description":"Updates mutable AP/AR open-item state. To close an item, set openAmount to 0 and a terminal status such as SETTLED, CLOSED, PAID, VOID, or REVERSED.","additionalProperties":false,"properties":{"counterpartyId":{"type":"string","nullable":true},"invoiceNumber":{"type":"string","nullable":true},"invoiceDate":{"type":"string","format":"date","nullable":true},"dueDate":{"type":"string","format":"date","nullable":true},"originalAmount":{"oneOf":[{"type":"number"},{"type":"string"}],"nullable":true},"openAmount":{"oneOf":[{"type":"number"},{"type":"string"}],"nullable":true},"currency":{"type":"string","minLength":3,"maxLength":3,"nullable":true},"currencyCode":{"type":"string","minLength":3,"maxLength":3,"nullable":true},"expectedSettlementDate":{"type":"string","format":"date","nullable":true},"status":{"$ref":"#/components/schemas/OpenItemStatus"},"source":{"type":"string","nullable":true},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"OpenItemSettlement":{"type":"object","description":"Settlement evidence linking an AP/AR open item to a payment, receipt, bank movement, Cash Position row, or manual event. This is source-state evidence only.","required":["id","orgId","entityId","openItemType","openItemId","settlementSourceType","settlementDate","amount","currencyCode","status","linkSource","createdAt","updatedAt"],"additionalProperties":false,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"openItemType":{"$ref":"#/components/schemas/OpenItemType"},"openItemId":{"type":"string"},"settlementSourceType":{"$ref":"#/components/schemas/OpenItemSettlementSourceType"},"settlementSourceId":{"type":"string","nullable":true,"description":"Source row UUID. Null is allowed for unresolved external settlement evidence."},"settlementType":{"type":"string","enum":["PAYMENT","RECEIPT","CREDIT_NOTE","DEBIT_NOTE","ADJUSTMENT","REVERSAL","WRITE_OFF"]},"settlementDate":{"type":"string","format":"date"},"amount":{"oneOf":[{"type":"number"},{"type":"string"}]},"currencyCode":{"type":"string","minLength":3,"maxLength":3},"status":{"$ref":"#/components/schemas/OpenItemSettlementStatus"},"linkSource":{"$ref":"#/components/schemas/OpenItemSettlementLinkSource"},"externalSystem":{"type":"string","nullable":true},"externalId":{"type":"string","nullable":true},"metadata":{"$ref":"#/components/schemas/Metadata"},"createdByUserId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time","nullable":true}}},"OpenItemSettlementCreateRequest":{"type":"object","description":"Creates settlement evidence for an AP/AR open item. It does not move money, approve reconciliation, post accounting entries, or automatically change the open-item balance/status.","required":["entityId","openItemType","settlementSourceType","settlementDate","amount"],"additionalProperties":false,"properties":{"processingMode":{"$ref":"#/components/schemas/ProcessingMode"},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK"},"entityId":{"type":"string"},"openItemType":{"$ref":"#/components/schemas/OpenItemType"},"openItemId":{"type":"string","nullable":true},"externalOpenItemId":{"type":"string","nullable":true},"invoiceNumber":{"type":"string","nullable":true},"settlementSourceType":{"$ref":"#/components/schemas/OpenItemSettlementSourceType"},"settlementSourceId":{"type":"string","nullable":true,"description":"Optional when external source references identify unresolved settlement evidence."},"settlementType":{"type":"string","nullable":true,"enum":["PAYMENT","RECEIPT","CREDIT_NOTE","DEBIT_NOTE","ADJUSTMENT","REVERSAL","WRITE_OFF"]},"settlementDate":{"type":"string","format":"date"},"amount":{"oneOf":[{"type":"number"},{"type":"string"}]},"currency":{"type":"string","minLength":3,"maxLength":3,"nullable":true},"currencyCode":{"type":"string","minLength":3,"maxLength":3,"nullable":true},"status":{"$ref":"#/components/schemas/OpenItemSettlementStatus"},"linkSource":{"$ref":"#/components/schemas/OpenItemSettlementLinkSource"},"externalSystem":{"type":"string","nullable":true},"externalId":{"type":"string","nullable":true},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"PaymentJournalLine":{"type":"object","required":["entityId","journalReference","journalDate","currency","amount","direction"],"additionalProperties":false,"properties":{"entityId":{"type":"string"},"bankAccountId":{"type":"string","nullable":true},"counterpartyId":{"type":"string","nullable":true},"journalReference":{"type":"string"},"paymentReference":{"type":"string","nullable":true},"journalDate":{"type":"string","format":"date"},"paymentDate":{"type":"string","format":"date","nullable":true},"postingDate":{"type":"string","format":"date","nullable":true},"currency":{"type":"string","minLength":3,"maxLength":3},"amount":{"oneOf":[{"type":"number"},{"type":"string"}]},"direction":{"$ref":"#/components/schemas/CashDirection"},"accountCode":{"type":"string","nullable":true},"vendorId":{"type":"string","nullable":true,"description":"Source-system vendor code copied to line metadata. It is not resolved as counterpartyId in this version."},"vendorName":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"PaymentJournalSubmitRequest":{"type":"object","required":["rows"],"additionalProperties":false,"properties":{"processingMode":{"$ref":"#/components/schemas/ProcessingMode"},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK"},"rows":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/PaymentJournalLine"}}}},"StatementTransaction":{"type":"object","required":["transactionDate","amount","currency","description"],"additionalProperties":false,"properties":{"transactionDate":{"type":"string","format":"date"},"valueDate":{"type":"string","format":"date","nullable":true},"amount":{"oneOf":[{"type":"number"},{"type":"string"}]},"direction":{"$ref":"#/components/schemas/CashDirection"},"currency":{"type":"string","minLength":3,"maxLength":3},"description":{"type":"string"},"bankTransactionReference":{"type":"string","nullable":true},"customerReference":{"type":"string","nullable":true},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"DirectStatementSubmitRequest":{"type":"object","required":["bankAccountId","statementType","statementDate","currency","transactions"],"additionalProperties":false,"properties":{"bankAccountId":{"type":"string"},"statementType":{"$ref":"#/components/schemas/StatementType"},"processingMode":{"$ref":"#/components/schemas/ProcessingMode"},"conflictPolicy":{"type":"string","enum":["BLOCK","SUPERSEDE"],"default":"BLOCK"},"statementDate":{"type":"string","format":"date"},"currency":{"type":"string","minLength":3,"maxLength":3},"statementReference":{"type":"string","nullable":true},"transactions":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/StatementTransaction"}}}},"FilePackageSubmitRequest":{"type":"object","required":["files"],"additionalProperties":false,"properties":{"defaultBankAccountId":{"type":"string","nullable":true},"processingMode":{"$ref":"#/components/schemas/ProcessingMode"},"files":{"type":"array","minItems":1,"items":{"type":"object","required":["fileName","fileContent"],"additionalProperties":false,"properties":{"fileName":{"type":"string"},"statementType":{"$ref":"#/components/schemas/StatementType"},"sourceFormat":{"$ref":"#/components/schemas/SourceFormat"},"fileContent":{"type":"string","description":"Raw text or encoded payload accepted by the file endpoint."}}}}}},"CashPositionEntryRow":{"type":"object","required":["valueDate","amount","currency"],"additionalProperties":false,"properties":{"bankAccountId":{"type":"string","nullable":true},"statementAccountNumber":{"type":"string","nullable":true},"valueDate":{"type":"string","format":"date"},"direction":{"$ref":"#/components/schemas/CashDirection"},"amount":{"oneOf":[{"type":"number"},{"type":"string"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"categoryCode":{"type":"string","nullable":true},"counterpartyId":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"externalSourceId":{"type":"string","nullable":true},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"CashPositionEntrySubmitRequest":{"type":"object","required":["rows"],"additionalProperties":false,"properties":{"processingMode":{"$ref":"#/components/schemas/ProcessingMode"},"conflictPolicy":{"type":"string","enum":["BLOCK","ALLOW"],"default":"BLOCK"},"requestReference":{"type":"string","nullable":true},"sourceSystem":{"type":"string","nullable":true},"rows":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/CashPositionEntryRow"}}}},"ForecastInputRow":{"type":"object","required":["expectedDate","amount","currency"],"additionalProperties":false,"properties":{"entityId":{"type":"string","nullable":true},"bankAccountId":{"type":"string","nullable":true},"statementAccountNumber":{"type":"string","nullable":true},"expectedDate":{"type":"string","format":"date"},"direction":{"$ref":"#/components/schemas/CashDirection"},"amount":{"oneOf":[{"type":"number"},{"type":"string"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"categoryCode":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"externalSourceId":{"type":"string","nullable":true},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"ForecastInputSubmitRequest":{"type":"object","required":["rows"],"additionalProperties":false,"properties":{"processingMode":{"$ref":"#/components/schemas/ProcessingMode"},"conflictPolicy":{"type":"string","enum":["BLOCK","ALLOW"],"default":"BLOCK"},"requestReference":{"type":"string","nullable":true},"sourceSystem":{"type":"string","nullable":true},"rows":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ForecastInputRow"}}}},"ReconciliationSuggestion":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"entityId":{"type":"string","nullable":true},"score":{"nullable":true,"oneOf":[{"type":"number"},{"type":"string"}]},"status":{"type":"string","nullable":true},"bankTransaction":{"type":"object","additionalProperties":true},"erpLine":{"type":"object","additionalProperties":true}}},"MatchGroup":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"entityId":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"bankLines":{"type":"array","items":{"type":"object","additionalProperties":true}},"erpLines":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}},"paths":{"/integration/v1/me":{"get":{"summary":"Validate an integration API key and return tenant context","tags":["integration"],"security":[{"apiKeyAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["tenant","apiKey","docs"],"properties":{"tenant":{"type":"object","additionalProperties":false,"required":["id","slug","name","status"],"properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}}},"apiKey":{"type":"object","additionalProperties":false,"required":["id","name","lookupKey","keyPreview","scopes","connectionType","expiresAt","lastUsedAt","status"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["null","string"]},"lookupKey":{"type":"string"},"keyPreview":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"connectionType":{"type":"string","enum":["integration","agent"]},"expiresAt":{"type":["null","string"],"format":"date-time"},"lastUsedAt":{"type":["null","string"],"format":"date-time"},"status":{"type":"string","enum":["active"]}}},"docs":{"type":"object","additionalProperties":false,"required":["audience","version","path"],"properties":{"audience":{"type":"string","enum":["integration"]},"version":{"type":"string","enum":["v1"]},"path":{"type":"string"}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/openapi.json":{"get":{"summary":"Download the Integration API OpenAPI document","tags":["Integration - Support"],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/integration/v1/support":{"get":{"summary":"Get bilingual Integration API support content","tags":["Integration - Support"],"parameters":[{"schema":{"type":"string","enum":["en","es"]},"in":"query","name":"lang","required":false}],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/integration/v1/entities":{"get":{"summary":"List entities","tags":["Integration - Entities"],"description":"Returns tenant entities using cursor pagination. Requires any integration API scope.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false,"description":"Maximum records to return. Reuse the same limit while following pageToken."},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false,"description":"Opaque cursor returned by the previous list response."},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"boolean"},"in":"query","name":"isActive","required":false},{"schema":{"type":"string","enum":["name","createdAt","updatedAt"],"default":"createdAt"},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"in":"query","name":"sortDir","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","orgId","name","currency","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"taxIdType":{"type":["null","string"]},"taxId":{"type":["null","string"]},"activityDescription":{"type":["null","string"]},"countryCode":{"type":["null","string"],"minLength":2,"maxLength":2},"reconciliationLifecycleDefaults":{"type":"object","additionalProperties":true},"currency":{"type":"string","minLength":3,"maxLength":3},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Create an entity","tags":["Integration - Entities"],"description":"Creates an entity in the tenant organization. Requires full_access.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1},"taxIdType":{"type":["string","null"]},"taxId":{"type":["string","null"]},"activityDescription":{"type":["string","null"]},"countryCode":{"type":["string","null"],"minLength":2,"maxLength":2,"pattern":"^[A-Za-z]{2}$"},"reconciliationLifecycleDefaults":{"type":["object","null"],"additionalProperties":true},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD"},"isActive":{"type":"boolean","default":true}}},"example":{"name":"US Operating Entity","taxIdType":"EIN","taxId":"12-3456789","activityDescription":"US sales and operating treasury entity.","countryCode":"US","currency":"USD","isActive":true}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","orgId","name","currency","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"taxIdType":{"type":["null","string"]},"taxId":{"type":["null","string"]},"activityDescription":{"type":["null","string"]},"countryCode":{"type":["null","string"],"minLength":2,"maxLength":2},"reconciliationLifecycleDefaults":{"type":"object","additionalProperties":true},"currency":{"type":"string","minLength":3,"maxLength":3},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/entities/bulk":{"post":{"summary":"Create entities in bulk","tags":["Integration - Entities"],"description":"Validates or creates many entities in one all-or-nothing request. Requires full_access. Each row must include clientRef so clients can build a deterministic ID map for dependent fixture payloads.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"VALIDATE_ONLY validates every row without writes. AUTO writes all rows only when every row is valid."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicates or conflicting rows instead of silently overwriting data."},"requestReference":{"type":["string","null"],"maxLength":255,"description":"Caller batch reference echoed in the response for audit and troubleshooting."},"rows":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["clientRef","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200,"description":"Caller-supplied stable reference echoed in row results and idMap."},"data":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1},"taxIdType":{"type":["string","null"]},"taxId":{"type":["string","null"]},"activityDescription":{"type":["string","null"]},"countryCode":{"type":["string","null"],"minLength":2,"maxLength":2,"pattern":"^[A-Za-z]{2}$"},"reconciliationLifecycleDefaults":{"type":["object","null"],"additionalProperties":true},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD"},"isActive":{"type":"boolean","default":true}},"example":{"name":"US Operating Entity","taxIdType":"EIN","taxId":"12-3456789","activityDescription":"US sales and operating treasury entity.","countryCode":"US","currency":"USD","isActive":true}}}}}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["processingMode","requestReference","summary","rows","idMap"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":["null","string"]},"summary":{"type":"object","additionalProperties":false,"required":["received","valid","blocked","created"],"properties":{"received":{"type":"integer"},"valid":{"type":"integer"},"blocked":{"type":"integer"},"created":{"type":"integer"}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","clientRef","status","id","errors","warnings"],"properties":{"index":{"type":"integer"},"clientRef":{"type":"string"},"status":{"type":"string","enum":["VALID","BLOCKED","CREATED"]},"id":{"type":["null","string"]},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}},"idMap":{"type":"object","additionalProperties":{"type":"string"},"description":"Maps clientRef to created record id for AUTO requests."}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/entities/{id}":{"get":{"summary":"Get an entity","tags":["Integration - Entities"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","orgId","name","currency","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"taxIdType":{"type":["null","string"]},"taxId":{"type":["null","string"]},"activityDescription":{"type":["null","string"]},"countryCode":{"type":["null","string"],"minLength":2,"maxLength":2},"reconciliationLifecycleDefaults":{"type":"object","additionalProperties":true},"currency":{"type":"string","minLength":3,"maxLength":3},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Update an entity","tags":["Integration - Entities"],"description":"Updates mutable entity fields. Requires full_access.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1},"taxIdType":{"type":["string","null"]},"taxId":{"type":["string","null"]},"activityDescription":{"type":["string","null"]},"countryCode":{"type":["string","null"],"minLength":2,"maxLength":2,"pattern":"^[A-Za-z]{2}$"},"reconciliationLifecycleDefaults":{"type":["object","null"],"additionalProperties":true},"currency":{"type":"string","minLength":3,"maxLength":3},"isActive":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","orgId","name","currency","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"taxIdType":{"type":["null","string"]},"taxId":{"type":["null","string"]},"activityDescription":{"type":["null","string"]},"countryCode":{"type":["null","string"],"minLength":2,"maxLength":2},"reconciliationLifecycleDefaults":{"type":"object","additionalProperties":true},"currency":{"type":"string","minLength":3,"maxLength":3},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"delete":{"summary":"Deactivate an entity","tags":["Integration - Entities"],"description":"Safely deactivates the entity instead of hard-deleting financial history. Requires full_access.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","orgId","name","currency","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"taxIdType":{"type":["null","string"]},"taxId":{"type":["null","string"]},"activityDescription":{"type":["null","string"]},"countryCode":{"type":["null","string"],"minLength":2,"maxLength":2},"reconciliationLifecycleDefaults":{"type":"object","additionalProperties":true},"currency":{"type":"string","minLength":3,"maxLength":3},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/bank-accounts":{"get":{"summary":"List bank accounts","tags":["Integration - Bank Accounts"],"description":"Returns tenant bank accounts using cursor pagination. Requires any integration API scope.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false,"description":"Maximum records to return. Reuse the same limit while following pageToken."},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false,"description":"Opaque cursor returned by the previous list response."},{"schema":{"type":"string"},"in":"query","name":"entityId","required":false},{"schema":{"type":"string"},"in":"query","name":"institution","required":false},{"schema":{"type":"string"},"in":"query","name":"accountCode","required":false},{"schema":{"type":"string"},"in":"query","name":"accountNumber","required":false},{"schema":{"type":"string"},"in":"query","name":"statementAccountNumber","required":false},{"schema":{"type":"string"},"in":"query","name":"name","required":false},{"schema":{"type":"string"},"in":"query","name":"description","required":false},{"schema":{"type":"string"},"in":"query","name":"bankGroupId","required":false},{"schema":{"type":"string"},"in":"query","name":"bankBranchId","required":false},{"schema":{"type":"string","enum":["entityId","institution","accountCode","accountNumber","statementAccountNumber","name","createdAt","updatedAt"],"default":"createdAt"},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"in":"query","name":"sortDir","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","orgId","entityId","name","currency","isActive","initialBalance","connectionStatus","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"providerConnectionId":{"type":["null","string"]},"providerAccountId":{"type":["null","string"]},"institution":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"name":{"type":"string"},"officialName":{"type":["null","string"]},"mask":{"type":["null","string"]},"type":{"type":["null","string"]},"currency":{"type":"string","minLength":3,"maxLength":3},"isActive":{"type":"boolean"},"initialBalance":{"type":"number"},"minimumBalance":{"type":["null","number"],"minimum":0},"concentrationScope":{"type":"string","enum":["NONE","ENTITY","ORGANIZATION"]},"accountNumber":{"type":["null","string"]},"statementAccountNumber":{"type":["null","string"]},"routingNumber":{"type":["null","string"]},"description":{"type":["null","string"]},"bankGroupId":{"type":["null","string"]},"bankBranchId":{"type":["null","string"]},"defaultGlAccountId":{"type":["null","string"]},"categorizationSettings":{"type":["null","object"],"additionalProperties":true},"reconciliationSettings":{"type":["null","object"],"additionalProperties":true},"connectionStatus":{"type":"string","enum":["connected","disconnected","inactive","syncing","synced","manual","error"]},"lastSyncAt":{"type":["null","string"],"format":"date-time"},"lastError":{"type":["null","string"]},"providerAccountStatus":{"type":["null","string"]},"providerPermissions":{"type":["null","array"],"items":{"type":"string"}},"providerSubscriptions":{"type":["null","array"],"items":{"type":"string"}},"bankGroup":{"type":["null","object"],"additionalProperties":true},"bankBranch":{"type":["null","object"],"additionalProperties":true},"defaultGlAccount":{"type":["null","object"],"additionalProperties":true},"bankAccountLatestBalance":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Create a bank account","tags":["Integration - Bank Accounts"],"description":"Creates a manual/API-managed bank account. Requires full_access.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["entityId","name"],"properties":{"entityId":{"type":"string"},"name":{"type":"string","minLength":1},"institution":{"type":["string","null"]},"accountCode":{"type":["string","null"]},"officialName":{"type":["string","null"]},"mask":{"type":["string","null"]},"type":{"type":["string","null"]},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD"},"isActive":{"type":"boolean","default":true},"initialBalance":{"type":"number","default":0},"minimumBalance":{"type":["number","null"],"minimum":0},"concentrationScope":{"type":"string","enum":["NONE","ENTITY","ORGANIZATION"],"default":"NONE"},"accountNumber":{"type":["string","null"]},"statementAccountNumber":{"type":["string","null"]},"routingNumber":{"type":["string","null"]},"description":{"type":["string","null"]},"providerConnectionId":{"type":["string","null"]},"providerAccountId":{"type":["string","null"]},"bankGroupId":{"type":["string","null"]},"bankBranchId":{"type":["string","null"]},"defaultGlAccountId":{"type":["string","null"],"description":"Active same-entity GL account used by final Bank reconciliation. Bank-to-GL matching never infers this account from a provider mapping."},"reconciliationSettings":{"type":["object","null"],"additionalProperties":true,"description":"Account lifecycle policy for external source availability, Reconcilia-generated artifacts, and ERP outbound handling. This policy determines whether generated GL lines are authoritative or early candidates."},"connectionStatus":{"type":"string","enum":["connected","syncing","synced","manual","error"],"default":"manual","description":"Allowed values: manual = caller-managed account without provider sync; connected/syncing/synced = provider-backed lifecycle states; error = provider or import issue."}}},"example":{"entityId":"00000000-0000-0000-0000-000000000000","accountCode":"US01-OPER-001","name":"Operating Account","institution":"Example Bank","currency":"USD","initialBalance":0,"minimumBalance":25000,"concentrationScope":"ENTITY","accountNumber":"1234567890","statementAccountNumber":"ACCT-1234567890","routingNumber":"110000001","description":"Primary operating checking account used for daily cash.","connectionStatus":"manual"}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","orgId","entityId","name","currency","isActive","initialBalance","connectionStatus","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"providerConnectionId":{"type":["null","string"]},"providerAccountId":{"type":["null","string"]},"institution":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"name":{"type":"string"},"officialName":{"type":["null","string"]},"mask":{"type":["null","string"]},"type":{"type":["null","string"]},"currency":{"type":"string","minLength":3,"maxLength":3},"isActive":{"type":"boolean"},"initialBalance":{"type":"number"},"minimumBalance":{"type":["null","number"],"minimum":0},"concentrationScope":{"type":"string","enum":["NONE","ENTITY","ORGANIZATION"]},"accountNumber":{"type":["null","string"]},"statementAccountNumber":{"type":["null","string"]},"routingNumber":{"type":["null","string"]},"description":{"type":["null","string"]},"bankGroupId":{"type":["null","string"]},"bankBranchId":{"type":["null","string"]},"defaultGlAccountId":{"type":["null","string"]},"categorizationSettings":{"type":["null","object"],"additionalProperties":true},"reconciliationSettings":{"type":["null","object"],"additionalProperties":true},"connectionStatus":{"type":"string","enum":["connected","disconnected","inactive","syncing","synced","manual","error"]},"lastSyncAt":{"type":["null","string"],"format":"date-time"},"lastError":{"type":["null","string"]},"providerAccountStatus":{"type":["null","string"]},"providerPermissions":{"type":["null","array"],"items":{"type":"string"}},"providerSubscriptions":{"type":["null","array"],"items":{"type":"string"}},"bankGroup":{"type":["null","object"],"additionalProperties":true},"bankBranch":{"type":["null","object"],"additionalProperties":true},"defaultGlAccount":{"type":["null","object"],"additionalProperties":true},"bankAccountLatestBalance":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/bank-accounts/bulk":{"post":{"summary":"Create bank accounts in bulk","tags":["Integration - Bank Accounts"],"description":"Validates or creates many manual/API-managed bank accounts in one all-or-nothing request. Requires full_access. Each row must include clientRef so dependent statement and payment payloads can resolve bank account IDs.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"VALIDATE_ONLY validates every row without writes. AUTO writes all rows only when every row is valid."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicates or conflicting rows instead of silently overwriting data."},"requestReference":{"type":["string","null"],"maxLength":255,"description":"Caller batch reference echoed in the response for audit and troubleshooting."},"rows":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["clientRef","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200,"description":"Caller-supplied stable reference echoed in row results and idMap."},"data":{"type":"object","additionalProperties":false,"required":["entityId","name"],"properties":{"entityId":{"type":"string"},"name":{"type":"string","minLength":1},"institution":{"type":["string","null"]},"accountCode":{"type":["string","null"]},"officialName":{"type":["string","null"]},"mask":{"type":["string","null"]},"type":{"type":["string","null"]},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD"},"isActive":{"type":"boolean","default":true},"initialBalance":{"type":"number","default":0},"minimumBalance":{"type":["number","null"],"minimum":0},"concentrationScope":{"type":"string","enum":["NONE","ENTITY","ORGANIZATION"],"default":"NONE"},"accountNumber":{"type":["string","null"]},"statementAccountNumber":{"type":["string","null"]},"routingNumber":{"type":["string","null"]},"description":{"type":["string","null"]},"providerConnectionId":{"type":["string","null"]},"providerAccountId":{"type":["string","null"]},"bankGroupId":{"type":["string","null"]},"bankBranchId":{"type":["string","null"]},"defaultGlAccountId":{"type":["string","null"],"description":"Active same-entity GL account used by final Bank reconciliation. Bank-to-GL matching never infers this account from a provider mapping."},"reconciliationSettings":{"type":["object","null"],"additionalProperties":true,"description":"Account lifecycle policy for external source availability, Reconcilia-generated artifacts, and ERP outbound handling. This policy determines whether generated GL lines are authoritative or early candidates."},"connectionStatus":{"type":"string","enum":["connected","syncing","synced","manual","error"],"default":"manual","description":"Allowed values: manual = caller-managed account without provider sync; connected/syncing/synced = provider-backed lifecycle states; error = provider or import issue."}},"example":{"entityId":"00000000-0000-0000-0000-000000000000","accountCode":"US01-OPER-001","name":"Operating Account","institution":"Example Bank","currency":"USD","initialBalance":0,"minimumBalance":25000,"concentrationScope":"ENTITY","accountNumber":"1234567890","statementAccountNumber":"ACCT-1234567890","routingNumber":"110000001","description":"Primary operating checking account used for daily cash.","connectionStatus":"manual"}}}}}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["processingMode","requestReference","summary","rows","idMap"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":["null","string"]},"summary":{"type":"object","additionalProperties":false,"required":["received","valid","blocked","created"],"properties":{"received":{"type":"integer"},"valid":{"type":"integer"},"blocked":{"type":"integer"},"created":{"type":"integer"}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","clientRef","status","id","errors","warnings"],"properties":{"index":{"type":"integer"},"clientRef":{"type":"string"},"status":{"type":"string","enum":["VALID","BLOCKED","CREATED"]},"id":{"type":["null","string"]},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}},"idMap":{"type":"object","additionalProperties":{"type":"string"},"description":"Maps clientRef to created record id for AUTO requests."}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/bank-accounts/{id}":{"get":{"summary":"Get a bank account","tags":["Integration - Bank Accounts"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","orgId","entityId","name","currency","isActive","initialBalance","connectionStatus","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"providerConnectionId":{"type":["null","string"]},"providerAccountId":{"type":["null","string"]},"institution":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"name":{"type":"string"},"officialName":{"type":["null","string"]},"mask":{"type":["null","string"]},"type":{"type":["null","string"]},"currency":{"type":"string","minLength":3,"maxLength":3},"isActive":{"type":"boolean"},"initialBalance":{"type":"number"},"minimumBalance":{"type":["null","number"],"minimum":0},"concentrationScope":{"type":"string","enum":["NONE","ENTITY","ORGANIZATION"]},"accountNumber":{"type":["null","string"]},"statementAccountNumber":{"type":["null","string"]},"routingNumber":{"type":["null","string"]},"description":{"type":["null","string"]},"bankGroupId":{"type":["null","string"]},"bankBranchId":{"type":["null","string"]},"defaultGlAccountId":{"type":["null","string"]},"categorizationSettings":{"type":["null","object"],"additionalProperties":true},"reconciliationSettings":{"type":["null","object"],"additionalProperties":true},"connectionStatus":{"type":"string","enum":["connected","disconnected","inactive","syncing","synced","manual","error"]},"lastSyncAt":{"type":["null","string"],"format":"date-time"},"lastError":{"type":["null","string"]},"providerAccountStatus":{"type":["null","string"]},"providerPermissions":{"type":["null","array"],"items":{"type":"string"}},"providerSubscriptions":{"type":["null","array"],"items":{"type":"string"}},"bankGroup":{"type":["null","object"],"additionalProperties":true},"bankBranch":{"type":["null","object"],"additionalProperties":true},"defaultGlAccount":{"type":["null","object"],"additionalProperties":true},"bankAccountLatestBalance":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Update a bank account","tags":["Integration - Bank Accounts"],"description":"Updates mutable bank account fields. Requires full_access.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"entityId":{"type":"string"},"name":{"type":"string","minLength":1},"institution":{"type":["string","null"]},"accountCode":{"type":["string","null"]},"officialName":{"type":["string","null"]},"mask":{"type":["string","null"]},"type":{"type":["string","null"]},"currency":{"type":"string","minLength":3,"maxLength":3},"isActive":{"type":"boolean"},"initialBalance":{"type":"number"},"minimumBalance":{"type":["number","null"],"minimum":0},"concentrationScope":{"type":"string","enum":["NONE","ENTITY","ORGANIZATION"]},"accountNumber":{"type":["string","null"]},"statementAccountNumber":{"type":["string","null"]},"routingNumber":{"type":["string","null"]},"description":{"type":["string","null"]},"providerConnectionId":{"type":["string","null"]},"providerAccountId":{"type":["string","null"]},"bankGroupId":{"type":["string","null"]},"bankBranchId":{"type":["string","null"]},"defaultGlAccountId":{"type":["string","null"],"description":"Active same-entity GL account used by final Bank reconciliation. Bank-to-GL matching never infers this account from a provider mapping."},"reconciliationSettings":{"type":["object","null"],"additionalProperties":true,"description":"Account lifecycle policy for external source availability, Reconcilia-generated artifacts, and ERP outbound handling. This policy determines whether generated GL lines are authoritative or early candidates."},"connectionStatus":{"type":"string","enum":["connected","disconnected","inactive","syncing","synced","manual","error"],"description":"Allowed values: manual = caller-managed account without provider sync; connected/syncing/synced = provider-backed lifecycle states; error = provider or import issue. disconnected/inactive are accepted on updates for lifecycle cleanup."}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","orgId","entityId","name","currency","isActive","initialBalance","connectionStatus","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"providerConnectionId":{"type":["null","string"]},"providerAccountId":{"type":["null","string"]},"institution":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"name":{"type":"string"},"officialName":{"type":["null","string"]},"mask":{"type":["null","string"]},"type":{"type":["null","string"]},"currency":{"type":"string","minLength":3,"maxLength":3},"isActive":{"type":"boolean"},"initialBalance":{"type":"number"},"minimumBalance":{"type":["null","number"],"minimum":0},"concentrationScope":{"type":"string","enum":["NONE","ENTITY","ORGANIZATION"]},"accountNumber":{"type":["null","string"]},"statementAccountNumber":{"type":["null","string"]},"routingNumber":{"type":["null","string"]},"description":{"type":["null","string"]},"bankGroupId":{"type":["null","string"]},"bankBranchId":{"type":["null","string"]},"defaultGlAccountId":{"type":["null","string"]},"categorizationSettings":{"type":["null","object"],"additionalProperties":true},"reconciliationSettings":{"type":["null","object"],"additionalProperties":true},"connectionStatus":{"type":"string","enum":["connected","disconnected","inactive","syncing","synced","manual","error"]},"lastSyncAt":{"type":["null","string"],"format":"date-time"},"lastError":{"type":["null","string"]},"providerAccountStatus":{"type":["null","string"]},"providerPermissions":{"type":["null","array"],"items":{"type":"string"}},"providerSubscriptions":{"type":["null","array"],"items":{"type":"string"}},"bankGroup":{"type":["null","object"],"additionalProperties":true},"bankBranch":{"type":["null","object"],"additionalProperties":true},"defaultGlAccount":{"type":["null","object"],"additionalProperties":true},"bankAccountLatestBalance":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"delete":{"summary":"Deactivate a bank account","tags":["Integration - Bank Accounts"],"description":"Safely deactivates the account instead of hard-deleting financial history. Requires full_access.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","orgId","entityId","name","currency","isActive","initialBalance","connectionStatus","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"providerConnectionId":{"type":["null","string"]},"providerAccountId":{"type":["null","string"]},"institution":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"name":{"type":"string"},"officialName":{"type":["null","string"]},"mask":{"type":["null","string"]},"type":{"type":["null","string"]},"currency":{"type":"string","minLength":3,"maxLength":3},"isActive":{"type":"boolean"},"initialBalance":{"type":"number"},"minimumBalance":{"type":["null","number"],"minimum":0},"concentrationScope":{"type":"string","enum":["NONE","ENTITY","ORGANIZATION"]},"accountNumber":{"type":["null","string"]},"statementAccountNumber":{"type":["null","string"]},"routingNumber":{"type":["null","string"]},"description":{"type":["null","string"]},"bankGroupId":{"type":["null","string"]},"bankBranchId":{"type":["null","string"]},"defaultGlAccountId":{"type":["null","string"]},"categorizationSettings":{"type":["null","object"],"additionalProperties":true},"reconciliationSettings":{"type":["null","object"],"additionalProperties":true},"connectionStatus":{"type":"string","enum":["connected","disconnected","inactive","syncing","synced","manual","error"]},"lastSyncAt":{"type":["null","string"],"format":"date-time"},"lastError":{"type":["null","string"]},"providerAccountStatus":{"type":["null","string"]},"providerPermissions":{"type":["null","array"],"items":{"type":"string"}},"providerSubscriptions":{"type":["null","array"],"items":{"type":"string"}},"bankGroup":{"type":["null","object"],"additionalProperties":true},"bankBranch":{"type":["null","object"],"additionalProperties":true},"defaultGlAccount":{"type":["null","object"],"additionalProperties":true},"bankAccountLatestBalance":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/gl/accounts":{"get":{"summary":"List GL accounts","tags":["Integration - GL"],"description":"Returns chart-of-account records for external GL and ERP integrations. Requires any integration API scope.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string"},"in":"query","name":"entityId","required":false},{"schema":{"type":"string"},"in":"query","name":"accountCode","required":false},{"schema":{"type":"string"},"in":"query","name":"accountType","required":false},{"schema":{"type":"boolean"},"in":"query","name":"isActive","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string","enum":["accountCode","accountName","accountType","createdAt","updatedAt"]},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string","enum":["asc","desc"]},"in":"query","name":"sortDir","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","accountCode","accountName","accountType","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":["null","string"]},"accountCode":{"type":"string"},"accountName":{"type":"string"},"accountType":{"type":"string"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Create a GL account","tags":["Integration - GL"],"description":"Creates a chart-of-account record. Requires full_access because this is master data.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["entityId","accountCode","accountName","accountType"],"properties":{"entityId":{"type":"string"},"accountCode":{"type":"string","minLength":1},"accountName":{"type":"string","minLength":1},"accountType":{"type":"string","enum":["ASSET","LIABILITY","EQUITY","REVENUE","EXPENSE","OTHER"],"description":"Allowed values: ASSET = cash, bank, receivable, and other asset accounts; LIABILITY = payables, debt, and obligations; EQUITY = owner/shareholder equity; REVENUE = income accounts; EXPENSE = costs, fees, and operating expenses; OTHER = fallback when the source chart does not map cleanly."},"isActive":{"type":"boolean","default":true}}},"example":{"entityId":"00000000-0000-0000-0000-000000000000","accountCode":"1000","accountName":"Operating Cash","accountType":"ASSET","isActive":true}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","accountCode","accountName","accountType","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":["null","string"]},"accountCode":{"type":"string"},"accountName":{"type":"string"},"accountType":{"type":"string"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/gl/accounts/bulk":{"post":{"summary":"Create GL accounts in bulk","tags":["Integration - GL"],"description":"Validates or creates many chart-of-account rows in one all-or-nothing request. Requires full_access. Each row must include clientRef so clients can build a deterministic ID map for dependent fixture payloads.\n\nAllowed values: ASSET = cash, bank, receivable, and other asset accounts; LIABILITY = payables, debt, and obligations; EQUITY = owner/shareholder equity; REVENUE = income accounts; EXPENSE = costs, fees, and operating expenses; OTHER = fallback when the source chart does not map cleanly.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid data. VALIDATE_ONLY performs contract, reference, duplicate, and parser validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting rows. Silent overwrite/supersede is intentionally not supported for these source-data endpoints."},"requestReference":{"type":["string","null"],"maxLength":255,"description":"Caller batch reference echoed in the response for audit and troubleshooting."},"rows":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["clientRef","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200,"description":"Caller-supplied stable reference echoed in row results and idMap."},"data":{"type":"object","additionalProperties":false,"required":["entityId","accountCode","accountName","accountType"],"properties":{"entityId":{"type":"string"},"accountCode":{"type":"string","minLength":1},"accountName":{"type":"string","minLength":1},"accountType":{"type":"string","enum":["ASSET","LIABILITY","EQUITY","REVENUE","EXPENSE","OTHER"],"description":"Allowed values: ASSET = cash, bank, receivable, and other asset accounts; LIABILITY = payables, debt, and obligations; EQUITY = owner/shareholder equity; REVENUE = income accounts; EXPENSE = costs, fees, and operating expenses; OTHER = fallback when the source chart does not map cleanly."},"isActive":{"type":"boolean","default":true}},"example":{"entityId":"00000000-0000-0000-0000-000000000000","accountCode":"1000","accountName":"Operating Cash","accountType":"ASSET","isActive":true}}}}}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["processingMode","requestReference","summary","rows","idMap"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":["null","string"]},"summary":{"type":"object","additionalProperties":false,"required":["received","valid","blocked","created"],"properties":{"received":{"type":"integer"},"valid":{"type":"integer"},"blocked":{"type":"integer"},"created":{"type":"integer"}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","clientRef","status","id","errors","warnings"],"properties":{"index":{"type":"integer"},"clientRef":{"type":"string"},"status":{"type":"string","enum":["VALID","BLOCKED","CREATED"]},"id":{"type":["null","string"]},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}},"idMap":{"type":"object","additionalProperties":{"type":"string"},"description":"Maps clientRef to created record id for AUTO requests."}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/gl/accounts/{id}":{"get":{"summary":"Get a GL account","tags":["Integration - GL"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","accountCode","accountName","accountType","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":["null","string"]},"accountCode":{"type":"string"},"accountName":{"type":"string"},"accountType":{"type":"string"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Update a GL account","tags":["Integration - GL"],"description":"Updates mutable chart-of-account fields. Requires full_access.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"entityId":{"type":["string","null"]},"accountCode":{"type":"string","minLength":1},"accountName":{"type":"string","minLength":1},"accountType":{"type":"string","enum":["ASSET","LIABILITY","EQUITY","REVENUE","EXPENSE","OTHER"],"description":"Allowed values: ASSET = cash, bank, receivable, and other asset accounts; LIABILITY = payables, debt, and obligations; EQUITY = owner/shareholder equity; REVENUE = income accounts; EXPENSE = costs, fees, and operating expenses; OTHER = fallback when the source chart does not map cleanly."},"isActive":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","accountCode","accountName","accountType","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":["null","string"]},"accountCode":{"type":"string"},"accountName":{"type":"string"},"accountType":{"type":"string"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"delete":{"summary":"Deactivate a GL account","tags":["Integration - GL"],"description":"Safely deactivates the GL account instead of hard-deleting historical ERP lines. Requires full_access.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","accountCode","accountName","accountType","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":["null","string"]},"accountCode":{"type":"string"},"accountName":{"type":"string"},"accountType":{"type":"string"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/counterparties":{"get":{"summary":"List counterparties","tags":["Integration - Counterparties"],"description":"Returns vendor, customer, employee, bank, and other counterparty records. Requires any integration API scope.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string"},"in":"query","name":"entityId","required":false},{"schema":{"type":"string"},"in":"query","name":"type","required":false},{"schema":{"type":"string"},"in":"query","name":"externalSystem","required":false},{"schema":{"type":"string"},"in":"query","name":"externalCounterpartyId","required":false},{"schema":{"type":"string"},"in":"query","name":"externalId","required":false,"description":"Alias for externalCounterpartyId."},{"schema":{"type":"string"},"in":"query","name":"defaultCategoryDefinitionId","required":false},{"schema":{"type":"string"},"in":"query","name":"defaultCategoryNodeId","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string","enum":["name","type","createdAt","updatedAt"]},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string","enum":["asc","desc"]},"in":"query","name":"sortDir","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","type","name","createdAt","updatedAt"],"properties":{"id":{"type":"string","description":"Reconcilia internal counterparty UUID. The API also accepts externalSystem + externalCounterpartyId as lookup fields; responses return this internal id so the ERP can store a stable map."},"orgId":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":["null","string"]},"type":{"type":"string"},"name":{"type":"string"},"taxId":{"type":["null","string"]},"email":{"type":["null","string"]},"phone":{"type":["null","string"]},"externalSystem":{"type":["null","string"],"description":"Source ERP/integration system that owns externalCounterpartyId."},"externalCounterpartyId":{"type":["null","string"],"description":"Source ERP vendor/customer/party id. Unique per entityId + externalSystem when supplied."},"defaultCategoryDefinitionId":{"type":["null","string"],"description":"Reconcilia category definition UUID used as the default category for this counterparty."},"defaultCategoryNodeId":{"type":["null","string"],"description":"Reconcilia category hierarchy node UUID used as the default category node for this counterparty."},"categorizationMetadata":{"type":["null","object"],"additionalProperties":true},"categoryDefinitions":{"type":["null","object"],"additionalProperties":true,"description":"Default category definition details when a defaultCategoryDefinitionId is configured."},"categoryNodes":{"type":["null","object"],"additionalProperties":true,"description":"Default category node details when a defaultCategoryNodeId is configured."},"metadata":{"type":["null","object"],"additionalProperties":true,"description":"Free-form source metadata. Use first-class externalSystem/externalCounterpartyId for stable ERP identity mapping."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Create a counterparty","tags":["Integration - Counterparties"],"description":"Creates vendor/customer-style counterparty master data. Requires full_access.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["entityId","type","name"],"properties":{"entityId":{"type":"string"},"type":{"type":"string","enum":["CUSTOMER","VENDOR","EMPLOYEE","BANK","OTHER"],"description":"Allowed values: CUSTOMER = payer/debtor/customer; VENDOR = supplier/payee/vendor; EMPLOYEE = payroll or employee-related counterparty; BANK = financial institution; OTHER = fallback for counterparties that do not fit the standard types."},"name":{"type":"string","minLength":1},"taxId":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"externalSystem":{"type":["string","null"],"description":"Source ERP/integration system that owns externalCounterpartyId."},"externalCounterpartyId":{"type":["string","null"],"description":"Source ERP vendor/customer/party id. Unique per entityId + externalSystem when supplied."},"externalId":{"type":["string","null"],"description":"Alias accepted for externalCounterpartyId on create/update."},"defaultCategoryDefinitionId":{"type":["string","null"],"description":"Optional Reconcilia category definition UUID to use as this counterparty default."},"defaultCategoryNodeId":{"type":["string","null"],"description":"Optional Reconcilia category node UUID to use as this counterparty default."},"categorizationMetadata":{"type":["null","object"],"additionalProperties":true,"description":"Optional metadata for the default category assignment, such as source system and confidence."},"metadata":{"type":["null","object"],"additionalProperties":true,"description":"Free-form source metadata. Use first-class externalSystem/externalCounterpartyId for stable ERP identity mapping."}}},"example":{"entityId":"00000000-0000-0000-0000-000000000000","type":"VENDOR","name":"Example Vendor","email":"ap@example-vendor.test","externalSystem":"example-erp","externalCounterpartyId":"VEND-001","metadata":{"externalVendorId":"VEND-001"},"defaultCategoryDefinitionId":"33333333-3333-3333-3333-333333333333","defaultCategoryNodeId":"44444444-4444-4444-4444-444444444444","categorizationMetadata":{"source":"integration_api"}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","type","name","createdAt","updatedAt"],"properties":{"id":{"type":"string","description":"Reconcilia internal counterparty UUID. The API also accepts externalSystem + externalCounterpartyId as lookup fields; responses return this internal id so the ERP can store a stable map."},"orgId":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":["null","string"]},"type":{"type":"string"},"name":{"type":"string"},"taxId":{"type":["null","string"]},"email":{"type":["null","string"]},"phone":{"type":["null","string"]},"externalSystem":{"type":["null","string"],"description":"Source ERP/integration system that owns externalCounterpartyId."},"externalCounterpartyId":{"type":["null","string"],"description":"Source ERP vendor/customer/party id. Unique per entityId + externalSystem when supplied."},"defaultCategoryDefinitionId":{"type":["null","string"],"description":"Reconcilia category definition UUID used as the default category for this counterparty."},"defaultCategoryNodeId":{"type":["null","string"],"description":"Reconcilia category hierarchy node UUID used as the default category node for this counterparty."},"categorizationMetadata":{"type":["null","object"],"additionalProperties":true},"categoryDefinitions":{"type":["null","object"],"additionalProperties":true,"description":"Default category definition details when a defaultCategoryDefinitionId is configured."},"categoryNodes":{"type":["null","object"],"additionalProperties":true,"description":"Default category node details when a defaultCategoryNodeId is configured."},"metadata":{"type":["null","object"],"additionalProperties":true,"description":"Free-form source metadata. Use first-class externalSystem/externalCounterpartyId for stable ERP identity mapping."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/counterparties/bulk":{"post":{"summary":"Create counterparties in bulk","tags":["Integration - Counterparties"],"description":"Validates or creates many counterparty master-data rows in one all-or-nothing request. Requires full_access. Each row must include clientRef so clients can build a deterministic ID map for payment-journal and ERP source-data payloads.\n\nAllowed values: CUSTOMER = payer/debtor/customer; VENDOR = supplier/payee/vendor; EMPLOYEE = payroll or employee-related counterparty; BANK = financial institution; OTHER = fallback for counterparties that do not fit the standard types.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid data. VALIDATE_ONLY performs contract, reference, duplicate, and parser validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting rows. Silent overwrite/supersede is intentionally not supported for these source-data endpoints."},"requestReference":{"type":["string","null"],"maxLength":255,"description":"Caller batch reference echoed in the response for audit and troubleshooting."},"rows":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["clientRef","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200,"description":"Caller-supplied stable reference echoed in row results and idMap."},"data":{"type":"object","additionalProperties":false,"required":["entityId","type","name"],"properties":{"entityId":{"type":"string"},"type":{"type":"string","enum":["CUSTOMER","VENDOR","EMPLOYEE","BANK","OTHER"],"description":"Allowed values: CUSTOMER = payer/debtor/customer; VENDOR = supplier/payee/vendor; EMPLOYEE = payroll or employee-related counterparty; BANK = financial institution; OTHER = fallback for counterparties that do not fit the standard types."},"name":{"type":"string","minLength":1},"taxId":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"externalSystem":{"type":["string","null"],"description":"Source ERP/integration system that owns externalCounterpartyId."},"externalCounterpartyId":{"type":["string","null"],"description":"Source ERP vendor/customer/party id. Unique per entityId + externalSystem when supplied."},"externalId":{"type":["string","null"],"description":"Alias accepted for externalCounterpartyId on create/update."},"defaultCategoryDefinitionId":{"type":["string","null"],"description":"Optional Reconcilia category definition UUID to use as this counterparty default."},"defaultCategoryNodeId":{"type":["string","null"],"description":"Optional Reconcilia category node UUID to use as this counterparty default."},"categorizationMetadata":{"type":["null","object"],"additionalProperties":true,"description":"Optional metadata for the default category assignment, such as source system and confidence."},"metadata":{"type":["null","object"],"additionalProperties":true,"description":"Free-form source metadata. Use first-class externalSystem/externalCounterpartyId for stable ERP identity mapping."}},"example":{"entityId":"00000000-0000-0000-0000-000000000000","type":"VENDOR","name":"Example Vendor","email":"ap@example-vendor.test","externalSystem":"example-erp","externalCounterpartyId":"VEND-001","metadata":{"externalVendorId":"VEND-001"},"defaultCategoryDefinitionId":"33333333-3333-3333-3333-333333333333","defaultCategoryNodeId":"44444444-4444-4444-4444-444444444444","categorizationMetadata":{"source":"integration_api"}}}}}}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["processingMode","requestReference","summary","rows","idMap"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":["null","string"]},"summary":{"type":"object","additionalProperties":false,"required":["received","valid","blocked","created"],"properties":{"received":{"type":"integer"},"valid":{"type":"integer"},"blocked":{"type":"integer"},"created":{"type":"integer"}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","clientRef","status","id","errors","warnings"],"properties":{"index":{"type":"integer"},"clientRef":{"type":"string"},"status":{"type":"string","enum":["VALID","BLOCKED","CREATED"]},"id":{"type":["null","string"]},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}},"idMap":{"type":"object","additionalProperties":{"type":"string"},"description":"Maps clientRef to created record id for AUTO requests."}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/counterparties/{id}":{"get":{"summary":"Get a counterparty","tags":["Integration - Counterparties"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","type","name","createdAt","updatedAt"],"properties":{"id":{"type":"string","description":"Reconcilia internal counterparty UUID. The API also accepts externalSystem + externalCounterpartyId as lookup fields; responses return this internal id so the ERP can store a stable map."},"orgId":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":["null","string"]},"type":{"type":"string"},"name":{"type":"string"},"taxId":{"type":["null","string"]},"email":{"type":["null","string"]},"phone":{"type":["null","string"]},"externalSystem":{"type":["null","string"],"description":"Source ERP/integration system that owns externalCounterpartyId."},"externalCounterpartyId":{"type":["null","string"],"description":"Source ERP vendor/customer/party id. Unique per entityId + externalSystem when supplied."},"defaultCategoryDefinitionId":{"type":["null","string"],"description":"Reconcilia category definition UUID used as the default category for this counterparty."},"defaultCategoryNodeId":{"type":["null","string"],"description":"Reconcilia category hierarchy node UUID used as the default category node for this counterparty."},"categorizationMetadata":{"type":["null","object"],"additionalProperties":true},"categoryDefinitions":{"type":["null","object"],"additionalProperties":true,"description":"Default category definition details when a defaultCategoryDefinitionId is configured."},"categoryNodes":{"type":["null","object"],"additionalProperties":true,"description":"Default category node details when a defaultCategoryNodeId is configured."},"metadata":{"type":["null","object"],"additionalProperties":true,"description":"Free-form source metadata. Use first-class externalSystem/externalCounterpartyId for stable ERP identity mapping."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Update a counterparty","tags":["Integration - Counterparties"],"description":"Updates mutable counterparty fields. Requires full_access.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"entityId":{"type":"string"},"type":{"type":"string","enum":["CUSTOMER","VENDOR","EMPLOYEE","BANK","OTHER"],"description":"Allowed values: CUSTOMER = payer/debtor/customer; VENDOR = supplier/payee/vendor; EMPLOYEE = payroll or employee-related counterparty; BANK = financial institution; OTHER = fallback for counterparties that do not fit the standard types."},"name":{"type":"string","minLength":1},"taxId":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"externalSystem":{"type":["string","null"],"description":"Source ERP/integration system that owns externalCounterpartyId."},"externalCounterpartyId":{"type":["string","null"],"description":"Source ERP vendor/customer/party id. Unique per entityId + externalSystem when supplied."},"externalId":{"type":["string","null"],"description":"Alias accepted for externalCounterpartyId on create/update."},"defaultCategoryDefinitionId":{"type":["string","null"],"description":"Optional Reconcilia category definition UUID to use as this counterparty default."},"defaultCategoryNodeId":{"type":["string","null"],"description":"Optional Reconcilia category node UUID to use as this counterparty default."},"categorizationMetadata":{"type":["null","object"],"additionalProperties":true,"description":"Optional metadata for the default category assignment, such as source system and confidence."},"metadata":{"type":["null","object"],"additionalProperties":true,"description":"Free-form source metadata. Use first-class externalSystem/externalCounterpartyId for stable ERP identity mapping."}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","type","name","createdAt","updatedAt"],"properties":{"id":{"type":"string","description":"Reconcilia internal counterparty UUID. The API also accepts externalSystem + externalCounterpartyId as lookup fields; responses return this internal id so the ERP can store a stable map."},"orgId":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":["null","string"]},"type":{"type":"string"},"name":{"type":"string"},"taxId":{"type":["null","string"]},"email":{"type":["null","string"]},"phone":{"type":["null","string"]},"externalSystem":{"type":["null","string"],"description":"Source ERP/integration system that owns externalCounterpartyId."},"externalCounterpartyId":{"type":["null","string"],"description":"Source ERP vendor/customer/party id. Unique per entityId + externalSystem when supplied."},"defaultCategoryDefinitionId":{"type":["null","string"],"description":"Reconcilia category definition UUID used as the default category for this counterparty."},"defaultCategoryNodeId":{"type":["null","string"],"description":"Reconcilia category hierarchy node UUID used as the default category node for this counterparty."},"categorizationMetadata":{"type":["null","object"],"additionalProperties":true},"categoryDefinitions":{"type":["null","object"],"additionalProperties":true,"description":"Default category definition details when a defaultCategoryDefinitionId is configured."},"categoryNodes":{"type":["null","object"],"additionalProperties":true,"description":"Default category node details when a defaultCategoryNodeId is configured."},"metadata":{"type":["null","object"],"additionalProperties":true,"description":"Free-form source metadata. Use first-class externalSystem/externalCounterpartyId for stable ERP identity mapping."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/erp-documents":{"get":{"summary":"List ERP source documents","tags":["Integration - ERP Documents"],"description":"Returns ERP document headers and lines for source-data integrations. Requires any integration API scope.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string"},"in":"query","name":"entityId","required":false},{"schema":{"type":"string"},"in":"query","name":"docType","required":false},{"schema":{"type":"string"},"in":"query","name":"docNo","required":false},{"schema":{"type":"string"},"in":"query","name":"counterpartyId","required":false},{"schema":{"type":"string"},"in":"query","name":"counterpartyExternalSystem","required":false},{"schema":{"type":"string"},"in":"query","name":"externalCounterpartyId","required":false,"description":"External counterparty id filter. Requires entityId; defaults counterpartyExternalSystem to externalSystem when omitted."},{"schema":{"type":"string"},"in":"query","name":"counterpartyExternalId","required":false,"description":"Alias for externalCounterpartyId."},{"schema":{"type":"string","enum":["HEADER","LINE","ANY"],"default":"HEADER"},"in":"query","name":"counterpartyScope","required":false,"description":"HEADER filters document-level counterpartyId, LINE filters ERP document line counterparties, and ANY searches both."},{"schema":{"type":"string","enum":["EXTERNAL_ERP","RECONCILIA_GENERATED","MANUAL"]},"in":"query","name":"origin","required":false},{"schema":{"type":"string","enum":["DRAFT","READY_TO_SEND","SENT","ACKNOWLEDGED","POSTED","REJECTED","CANCELLED"]},"in":"query","name":"lifecycleStatus","required":false},{"schema":{"type":"string"},"in":"query","name":"externalSystem","required":false},{"schema":{"type":"string"},"in":"query","name":"externalDocumentId","required":false},{"schema":{"type":"string"},"in":"query","name":"externalId","required":false,"description":"Alias for externalDocumentId."},{"schema":{"type":"string"},"in":"query","name":"generatedFromType","required":false},{"schema":{"type":"string"},"in":"query","name":"generatedFromId","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"dateFrom","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"dateTo","required":false},{"schema":{"type":"string","enum":["docDate","postingDate","docNo","lifecycleStatus","createdAt","updatedAt"]},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string","enum":["asc","desc"]},"in":"query","name":"sortDir","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","docType","docDate","postingDate","currency","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":["null","string"]},"docType":{"type":"string"},"docNo":{"type":["null","string"],"description":"Caller/source document number. Reconcilia uses entityId + docType + docNo as the natural idempotency key for ERP document writes. externalSystem + externalDocumentId can also be supplied and is returned for ERP-side mapping."},"docDate":{"type":"string","format":"date"},"postingDate":{"type":"string","format":"date"},"currency":{"type":"string"},"counterpartyId":{"type":["null","string"],"description":"Document-level primary counterparty. Use this for AP_INVOICE vendor, AR_INVOICE customer, and any single-party document. Supply either counterpartyId or externalSystem/counterpartyExternalSystem + externalCounterpartyId."},"totalAmount":{"type":["null","number","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"importJobId":{"type":["null","string"]},"sourceType":{"type":"string"},"isManual":{"type":"boolean"},"origin":{"type":"string"},"lifecycleStatus":{"type":"string"},"externalSystem":{"type":["null","string"]},"externalDocumentId":{"type":["null","string"],"description":"External ERP/source document id used with externalSystem for mapping. It is separate from docNo and can also be updated by transmission callbacks."},"externalStatus":{"type":["null","string"]},"generatedFromType":{"type":["null","string"]},"generatedFromId":{"type":["null","string"]},"submittedAt":{"type":["null","string"],"format":"date-time"},"acknowledgedAt":{"type":["null","string"],"format":"date-time"},"postedAt":{"type":["null","string"],"format":"date-time"},"rejectedAt":{"type":["null","string"],"format":"date-time"},"lastSyncAt":{"type":["null","string"],"format":"date-time"},"lastError":{"type":["null","string"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"erpDocumentLines":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","lineNo","debit","credit"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"documentId":{"type":"string"},"lineNo":{"type":"integer"},"accountId":{"type":["null","string"]},"counterpartyId":{"type":["null","string"],"description":"Line-level counterparty reference. Use counterpartyId or externalSystem/counterpartyExternalSystem + externalCounterpartyId for payment/receipt batches, mixed journals, or allocation lines. Matching should prefer the line counterparty and fall back to the document header counterparty."},"description":{"type":["null","string"]},"debit":{"type":["number","string"]},"credit":{"type":["number","string"]},"amount":{"type":["null","number","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"chartOfAccounts":{"type":["null","object"],"additionalProperties":true},"counterparties":{"type":["null","object"],"additionalProperties":true}}}},"erpDocumentTransmissions":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","erpDocumentId","direction","transport","status","occurredAt","createdAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"erpDocumentId":{"type":"string"},"direction":{"type":"string"},"transport":{"type":"string"},"status":{"type":"string"},"externalSystem":{"type":["null","string"]},"externalReference":{"type":["null","string"]},"requestPayload":{"type":["null","object"],"additionalProperties":true},"responsePayload":{"type":["null","object"],"additionalProperties":true},"errorMessage":{"type":["null","string"]},"occurredAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}}},"erpPostingConfirmations":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","erpDocumentId","transmissionId","eventType","verificationStatus","sourceVersion","postingDate","currency","totalDebit","totalCredit","contentHash","createdAt","lines"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"erpDocumentId":{"type":"string"},"transmissionId":{"type":"string"},"eventType":{"type":"string","enum":["POSTING","REVERSAL"]},"verificationStatus":{"type":"string","enum":["VERIFIED","MISMATCH"]},"externalSystem":{"type":["null","string"]},"externalDocumentId":{"type":["null","string"]},"externalReference":{"type":["null","string"]},"sourceVersion":{"type":"string"},"sourceUpdatedAt":{"type":["null","string"],"format":"date-time"},"postingDate":{"type":"string","format":"date"},"currency":{"type":"string"},"totalDebit":{"type":["number","string"]},"totalCredit":{"type":["number","string"]},"contentHash":{"type":"string"},"supersedesConfirmationId":{"type":["null","string"]},"reversesConfirmationId":{"type":["null","string"]},"verificationSummary":{"type":["null","object"],"additionalProperties":true,"properties":{"diagnostics":{"type":["null","object"],"additionalProperties":true,"description":"Latest confirmation comparison evidence. CONFIRMATION_SNAPSHOT retains expected/received headers and lines plus an order-independent multiset diff; LEGACY_CHECKS reports stored-check reasons only, with unavailable historical snapshots/diff set to null. This does not alter accounting authority.","properties":{"version":{"type":"integer","enum":[1]},"evidenceBasis":{"type":"string","enum":["CONFIRMATION_SNAPSHOT","LEGACY_CHECKS"]},"reasonCodes":{"type":"array","items":{"type":"string","enum":["UNRESOLVED_ACCOUNT","ACCOUNTING_LINES_MISMATCH","CURRENCY_MISMATCH","POSTING_DATE_MISMATCH"]}},"expected":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"received":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"lineDiff":{"type":["null","object"],"additionalProperties":true,"properties":{"missingExpected":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unexpectedReceived":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unresolvedAccounts":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}}}}}},"metadata":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","confirmationId","lineNo","debit","credit","createdAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"confirmationId":{"type":"string"},"lineNo":{"type":"integer"},"externalLineId":{"type":["null","string"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"description":{"type":["null","string"]},"debit":{"type":["number","string"]},"credit":{"type":["number","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"chartOfAccounts":{"type":["null","object"],"additionalProperties":true}}}}}}},"accountingConfirmationState":{"type":"object","additionalProperties":false,"required":["status","latestConfirmationId","currentConfirmationId","latestEventType","latestSourceVersion"],"properties":{"status":{"type":"string","enum":["AWAITING_EVIDENCE","VERIFIED","MISMATCH","REVERSED"]},"latestConfirmationId":{"type":["null","string"]},"currentConfirmationId":{"type":["null","string"]},"latestEventType":{"type":["null","string"],"enum":["POSTING","REVERSAL",null]},"latestSourceVersion":{"type":["null","string"]},"diagnostics":{"type":["null","object"],"additionalProperties":true,"description":"Latest confirmation comparison evidence. CONFIRMATION_SNAPSHOT retains expected/received headers and lines plus an order-independent multiset diff; LEGACY_CHECKS reports stored-check reasons only, with unavailable historical snapshots/diff set to null. This does not alter accounting authority.","properties":{"version":{"type":"integer","enum":[1]},"evidenceBasis":{"type":"string","enum":["CONFIRMATION_SNAPSHOT","LEGACY_CHECKS"]},"reasonCodes":{"type":"array","items":{"type":"string","enum":["UNRESOLVED_ACCOUNT","ACCOUNTING_LINES_MISMATCH","CURRENCY_MISMATCH","POSTING_DATE_MISMATCH"]}},"expected":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"received":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"lineDiff":{"type":["null","object"],"additionalProperties":true,"properties":{"missingExpected":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unexpectedReceived":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unresolvedAccounts":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}}}}}}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Create an ERP source document","tags":["Integration - ERP Documents"],"description":"Creates accounting source data only; this endpoint does not execute payments or auto-reconcile. VALIDATE_ONLY checks references and duplicate policy without writes. Requires full_access or transactions.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["entityId","docType","docNo","docDate","postingDate","lines"],"properties":{"entityId":{"type":"string"},"docType":{"type":"string","enum":["JE","JOURNAL_ENTRY","AP_INVOICE","AR_INVOICE","PAYMENT","RECEIPT","CREDIT_NOTE","DEBIT_NOTE","OTHER"],"description":"Allowed values: JE/JOURNAL_ENTRY = general ledger journal; AP_INVOICE = vendor invoice; AR_INVOICE = customer invoice; PAYMENT = payment proposal/source data only; RECEIPT = receipt/source data; CREDIT_NOTE = credit memo; DEBIT_NOTE = debit memo; OTHER = fallback source document."},"docNo":{"type":"string","minLength":1},"docDate":{"type":"string","format":"date"},"postingDate":{"type":"string","format":"date"},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD"},"counterpartyId":{"type":["string","null"],"description":"Document-level primary counterparty. Use this for AP_INVOICE vendor, AR_INVOICE customer, and any single-party document. Supply either counterpartyId or externalSystem/counterpartyExternalSystem + externalCounterpartyId."},"counterpartyExternalSystem":{"type":["string","null"],"description":"Optional source system for resolving the document-level externalCounterpartyId. Defaults to externalSystem when omitted."},"externalCounterpartyId":{"type":["string","null"],"description":"Source ERP vendor/customer/party id for resolving the document-level counterparty."},"counterpartyExternalId":{"type":["string","null"],"description":"Alias accepted for externalCounterpartyId on ERP document writes."},"externalSystem":{"type":["string","null"],"description":"Source ERP/integration system for externalDocumentId and default counterparty external-id resolution."},"externalDocumentId":{"type":["string","null"],"description":"Source ERP document id returned in Reconcilia responses for ERP-side mapping. externalSystem is required when this is supplied."},"externalId":{"type":["string","null"],"description":"Alias accepted for externalDocumentId on ERP document writes."},"totalAmount":{"type":["number","string","null"]},"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid data. VALIDATE_ONLY performs contract, reference, duplicate, and parser validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting rows. Silent overwrite/supersede is intentionally not supported for these source-data endpoints."},"metadata":{"type":["null","object"],"additionalProperties":true},"lines":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"lineNo":{"type":["integer","null"],"minimum":1},"accountId":{"type":["string","null"]},"accountCode":{"type":["string","null"]},"counterpartyId":{"type":["string","null"],"description":"Line-level counterparty reference. Use counterpartyId or externalSystem/counterpartyExternalSystem + externalCounterpartyId for payment/receipt batches, mixed journals, or allocation lines. Matching should prefer the line counterparty and fall back to the document header counterparty."},"counterpartyExternalSystem":{"type":["string","null"],"description":"Optional source system for resolving this line externalCounterpartyId. Defaults to document externalSystem when omitted."},"externalCounterpartyId":{"type":["string","null"],"description":"Source ERP vendor/customer/party id for resolving this line counterparty."},"counterpartyExternalId":{"type":["string","null"],"description":"Alias accepted for externalCounterpartyId on ERP document lines."},"description":{"type":["string","null"]},"debit":{"type":["number","string","null"]},"credit":{"type":["number","string","null"]},"amount":{"type":["number","string","null"]},"direction":{"type":["string","null"],"enum":["DEBIT","CREDIT","INFLOW","OUTFLOW",null],"description":"Allowed values: DEBIT/CREDIT use accounting sign semantics; INFLOW/OUTFLOW use cash-movement semantics and are normalized to debit/credit where needed."},"metadata":{"type":["null","object"],"additionalProperties":true}}}}}},"examples":{"example1":{"value":{"entityId":"00000000-0000-0000-0000-000000000000","docType":"AP_INVOICE","docNo":"AP-INV-2026-0001","docDate":"2026-04-25","postingDate":"2026-04-25","currency":"USD","externalSystem":"example-erp","externalDocumentId":"ERP-AP-INV-0001","externalCounterpartyId":"VEND-001","totalAmount":"1250.00","processingMode":"VALIDATE_ONLY","conflictPolicy":"BLOCK","metadata":{"externalDocumentNumber":"AP-INV-2026-0001","dueDate":"2026-05-25"},"lines":[{"lineNo":1,"accountCode":"2000","amount":"1250.00","direction":"CREDIT","externalCounterpartyId":"VEND-001","description":"Vendor invoice payable","metadata":{"source_line_id":"1"}},{"lineNo":2,"accountCode":"5000","amount":"1250.00","direction":"DEBIT","description":"Operating expense","metadata":{"source_line_id":"2"}}]}},"example2":{"value":{"entityId":"00000000-0000-0000-0000-000000000000","docType":"AR_INVOICE","docNo":"AR-INV-2026-0001","docDate":"2026-04-26","postingDate":"2026-04-26","currency":"USD","externalSystem":"example-erp","externalDocumentId":"ERP-AR-INV-0001","externalCounterpartyId":"CUST-001","totalAmount":"2500.00","processingMode":"VALIDATE_ONLY","conflictPolicy":"BLOCK","metadata":{"externalDocumentNumber":"AR-INV-2026-0001","dueDate":"2026-05-26"},"lines":[{"lineNo":1,"accountCode":"1100","amount":"2500.00","direction":"DEBIT","externalCounterpartyId":"CUST-001","description":"Customer receivable","metadata":{"source_line_id":"1"}},{"lineNo":2,"accountCode":"4000","amount":"2500.00","direction":"CREDIT","description":"Service revenue","metadata":{"source_line_id":"2"}}]}},"example3":{"value":{"entityId":"00000000-0000-0000-0000-000000000000","docType":"PAYMENT","docNo":"PAY-2026-0001","docDate":"2026-04-27","postingDate":"2026-04-27","currency":"USD","externalSystem":"example-erp","externalCounterpartyId":"VEND-001","processingMode":"VALIDATE_ONLY","conflictPolicy":"BLOCK","metadata":{"settles":[{"docType":"AP_INVOICE","docNo":"AP-INV-2026-0001","externalDocumentNumber":"AP-INV-2026-0001"}]},"lines":[{"accountCode":"1000","externalCounterpartyId":"VEND-001","amount":"1250.00","direction":"OUTFLOW","description":"Vendor payment","metadata":{"payment_reference":"PAY-2026-0001","payment_date":"2026-04-27"}}]}}}}},"required":true},"parameters":[{"schema":{"type":"string","maxLength":200},"in":"header","name":"idempotency-key","required":false,"description":"Optional caller idempotency key. ERP document writes prefer entityId/docType/docNo; payment journal writes prefer entityId/journalReference."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true},"idempotency":{"type":"object","additionalProperties":false,"required":["key","replayed","requestBodyHash"],"properties":{"key":{"type":"string"},"replayed":{"type":"boolean"},"requestBodyHash":{"type":"string"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/erp-documents/bulk":{"post":{"summary":"Create ERP source documents in bulk","tags":["Integration - ERP Documents"],"description":"Validates or creates many ERP source documents in one all-or-nothing request. Requires full_access or transactions. Bulk requests use requestReference/clientRef for batch tracing and idMap building; per-row idempotency-key headers are not used.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid data. VALIDATE_ONLY performs contract, reference, duplicate, and parser validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting rows. Silent overwrite/supersede is intentionally not supported for these source-data endpoints."},"requestReference":{"type":["string","null"],"maxLength":255,"description":"Caller batch reference echoed in the response for audit and troubleshooting."},"rows":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["clientRef","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200,"description":"Caller-supplied stable reference echoed in row results and idMap."},"data":{"type":"object","additionalProperties":false,"required":["entityId","docType","docNo","docDate","postingDate","lines"],"properties":{"entityId":{"type":"string"},"docType":{"type":"string","enum":["JE","JOURNAL_ENTRY","AP_INVOICE","AR_INVOICE","PAYMENT","RECEIPT","CREDIT_NOTE","DEBIT_NOTE","OTHER"],"description":"Allowed values: JE/JOURNAL_ENTRY = general ledger journal; AP_INVOICE = vendor invoice; AR_INVOICE = customer invoice; PAYMENT = payment proposal/source data only; RECEIPT = receipt/source data; CREDIT_NOTE = credit memo; DEBIT_NOTE = debit memo; OTHER = fallback source document."},"docNo":{"type":"string","minLength":1},"docDate":{"type":"string","format":"date"},"postingDate":{"type":"string","format":"date"},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD"},"counterpartyId":{"type":["string","null"],"description":"Document-level primary counterparty. Use this for AP_INVOICE vendor, AR_INVOICE customer, and any single-party document. Supply either counterpartyId or externalSystem/counterpartyExternalSystem + externalCounterpartyId."},"counterpartyExternalSystem":{"type":["string","null"],"description":"Optional source system for resolving the document-level externalCounterpartyId. Defaults to externalSystem when omitted."},"externalCounterpartyId":{"type":["string","null"],"description":"Source ERP vendor/customer/party id for resolving the document-level counterparty."},"counterpartyExternalId":{"type":["string","null"],"description":"Alias accepted for externalCounterpartyId on ERP document writes."},"externalSystem":{"type":["string","null"],"description":"Source ERP/integration system for externalDocumentId and default counterparty external-id resolution."},"externalDocumentId":{"type":["string","null"],"description":"Source ERP document id returned in Reconcilia responses for ERP-side mapping. externalSystem is required when this is supplied."},"externalId":{"type":["string","null"],"description":"Alias accepted for externalDocumentId on ERP document writes."},"totalAmount":{"type":["number","string","null"]},"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid data. VALIDATE_ONLY performs contract, reference, duplicate, and parser validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting rows. Silent overwrite/supersede is intentionally not supported for these source-data endpoints."},"metadata":{"type":["null","object"],"additionalProperties":true},"lines":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"lineNo":{"type":["integer","null"],"minimum":1},"accountId":{"type":["string","null"]},"accountCode":{"type":["string","null"]},"counterpartyId":{"type":["string","null"],"description":"Line-level counterparty reference. Use counterpartyId or externalSystem/counterpartyExternalSystem + externalCounterpartyId for payment/receipt batches, mixed journals, or allocation lines. Matching should prefer the line counterparty and fall back to the document header counterparty."},"counterpartyExternalSystem":{"type":["string","null"],"description":"Optional source system for resolving this line externalCounterpartyId. Defaults to document externalSystem when omitted."},"externalCounterpartyId":{"type":["string","null"],"description":"Source ERP vendor/customer/party id for resolving this line counterparty."},"counterpartyExternalId":{"type":["string","null"],"description":"Alias accepted for externalCounterpartyId on ERP document lines."},"description":{"type":["string","null"]},"debit":{"type":["number","string","null"]},"credit":{"type":["number","string","null"]},"amount":{"type":["number","string","null"]},"direction":{"type":["string","null"],"enum":["DEBIT","CREDIT","INFLOW","OUTFLOW",null],"description":"Allowed values: DEBIT/CREDIT use accounting sign semantics; INFLOW/OUTFLOW use cash-movement semantics and are normalized to debit/credit where needed."},"metadata":{"type":["null","object"],"additionalProperties":true}}}}},"example":{"entityId":"00000000-0000-0000-0000-000000000000","docType":"AP_INVOICE","docNo":"AP-INV-2026-0001","docDate":"2026-04-25","postingDate":"2026-04-25","currency":"USD","externalSystem":"example-erp","externalDocumentId":"ERP-AP-INV-0001","externalCounterpartyId":"VEND-001","totalAmount":"1250.00","processingMode":"VALIDATE_ONLY","conflictPolicy":"BLOCK","metadata":{"externalDocumentNumber":"AP-INV-2026-0001","dueDate":"2026-05-25"},"lines":[{"lineNo":1,"accountCode":"2000","amount":"1250.00","direction":"CREDIT","externalCounterpartyId":"VEND-001","description":"Vendor invoice payable","metadata":{"source_line_id":"1"}},{"lineNo":2,"accountCode":"5000","amount":"1250.00","direction":"DEBIT","description":"Operating expense","metadata":{"source_line_id":"2"}}]}}}}}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["processingMode","requestReference","summary","rows","idMap"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":["null","string"]},"summary":{"type":"object","additionalProperties":false,"required":["received","valid","blocked","created"],"properties":{"received":{"type":"integer"},"valid":{"type":"integer"},"blocked":{"type":"integer"},"created":{"type":"integer"}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","clientRef","status","id","errors","warnings"],"properties":{"index":{"type":"integer"},"clientRef":{"type":"string"},"status":{"type":"string","enum":["VALID","BLOCKED","CREATED"]},"id":{"type":["null","string"]},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}},"idMap":{"type":"object","additionalProperties":{"type":"string"},"description":"Maps clientRef to created record id for AUTO requests."}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/erp-documents/{id}":{"get":{"summary":"Get an ERP source document","tags":["Integration - ERP Documents"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","docType","docDate","postingDate","currency","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":["null","string"]},"docType":{"type":"string"},"docNo":{"type":["null","string"],"description":"Caller/source document number. Reconcilia uses entityId + docType + docNo as the natural idempotency key for ERP document writes. externalSystem + externalDocumentId can also be supplied and is returned for ERP-side mapping."},"docDate":{"type":"string","format":"date"},"postingDate":{"type":"string","format":"date"},"currency":{"type":"string"},"counterpartyId":{"type":["null","string"],"description":"Document-level primary counterparty. Use this for AP_INVOICE vendor, AR_INVOICE customer, and any single-party document. Supply either counterpartyId or externalSystem/counterpartyExternalSystem + externalCounterpartyId."},"totalAmount":{"type":["null","number","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"importJobId":{"type":["null","string"]},"sourceType":{"type":"string"},"isManual":{"type":"boolean"},"origin":{"type":"string"},"lifecycleStatus":{"type":"string"},"externalSystem":{"type":["null","string"]},"externalDocumentId":{"type":["null","string"],"description":"External ERP/source document id used with externalSystem for mapping. It is separate from docNo and can also be updated by transmission callbacks."},"externalStatus":{"type":["null","string"]},"generatedFromType":{"type":["null","string"]},"generatedFromId":{"type":["null","string"]},"submittedAt":{"type":["null","string"],"format":"date-time"},"acknowledgedAt":{"type":["null","string"],"format":"date-time"},"postedAt":{"type":["null","string"],"format":"date-time"},"rejectedAt":{"type":["null","string"],"format":"date-time"},"lastSyncAt":{"type":["null","string"],"format":"date-time"},"lastError":{"type":["null","string"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"erpDocumentLines":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","lineNo","debit","credit"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"documentId":{"type":"string"},"lineNo":{"type":"integer"},"accountId":{"type":["null","string"]},"counterpartyId":{"type":["null","string"],"description":"Line-level counterparty reference. Use counterpartyId or externalSystem/counterpartyExternalSystem + externalCounterpartyId for payment/receipt batches, mixed journals, or allocation lines. Matching should prefer the line counterparty and fall back to the document header counterparty."},"description":{"type":["null","string"]},"debit":{"type":["number","string"]},"credit":{"type":["number","string"]},"amount":{"type":["null","number","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"chartOfAccounts":{"type":["null","object"],"additionalProperties":true},"counterparties":{"type":["null","object"],"additionalProperties":true}}}},"erpDocumentTransmissions":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","erpDocumentId","direction","transport","status","occurredAt","createdAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"erpDocumentId":{"type":"string"},"direction":{"type":"string"},"transport":{"type":"string"},"status":{"type":"string"},"externalSystem":{"type":["null","string"]},"externalReference":{"type":["null","string"]},"requestPayload":{"type":["null","object"],"additionalProperties":true},"responsePayload":{"type":["null","object"],"additionalProperties":true},"errorMessage":{"type":["null","string"]},"occurredAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}}},"erpPostingConfirmations":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","erpDocumentId","transmissionId","eventType","verificationStatus","sourceVersion","postingDate","currency","totalDebit","totalCredit","contentHash","createdAt","lines"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"erpDocumentId":{"type":"string"},"transmissionId":{"type":"string"},"eventType":{"type":"string","enum":["POSTING","REVERSAL"]},"verificationStatus":{"type":"string","enum":["VERIFIED","MISMATCH"]},"externalSystem":{"type":["null","string"]},"externalDocumentId":{"type":["null","string"]},"externalReference":{"type":["null","string"]},"sourceVersion":{"type":"string"},"sourceUpdatedAt":{"type":["null","string"],"format":"date-time"},"postingDate":{"type":"string","format":"date"},"currency":{"type":"string"},"totalDebit":{"type":["number","string"]},"totalCredit":{"type":["number","string"]},"contentHash":{"type":"string"},"supersedesConfirmationId":{"type":["null","string"]},"reversesConfirmationId":{"type":["null","string"]},"verificationSummary":{"type":["null","object"],"additionalProperties":true,"properties":{"diagnostics":{"type":["null","object"],"additionalProperties":true,"description":"Latest confirmation comparison evidence. CONFIRMATION_SNAPSHOT retains expected/received headers and lines plus an order-independent multiset diff; LEGACY_CHECKS reports stored-check reasons only, with unavailable historical snapshots/diff set to null. This does not alter accounting authority.","properties":{"version":{"type":"integer","enum":[1]},"evidenceBasis":{"type":"string","enum":["CONFIRMATION_SNAPSHOT","LEGACY_CHECKS"]},"reasonCodes":{"type":"array","items":{"type":"string","enum":["UNRESOLVED_ACCOUNT","ACCOUNTING_LINES_MISMATCH","CURRENCY_MISMATCH","POSTING_DATE_MISMATCH"]}},"expected":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"received":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"lineDiff":{"type":["null","object"],"additionalProperties":true,"properties":{"missingExpected":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unexpectedReceived":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unresolvedAccounts":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}}}}}},"metadata":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","confirmationId","lineNo","debit","credit","createdAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"confirmationId":{"type":"string"},"lineNo":{"type":"integer"},"externalLineId":{"type":["null","string"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"description":{"type":["null","string"]},"debit":{"type":["number","string"]},"credit":{"type":["number","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"chartOfAccounts":{"type":["null","object"],"additionalProperties":true}}}}}}},"accountingConfirmationState":{"type":"object","additionalProperties":false,"required":["status","latestConfirmationId","currentConfirmationId","latestEventType","latestSourceVersion"],"properties":{"status":{"type":"string","enum":["AWAITING_EVIDENCE","VERIFIED","MISMATCH","REVERSED"]},"latestConfirmationId":{"type":["null","string"]},"currentConfirmationId":{"type":["null","string"]},"latestEventType":{"type":["null","string"],"enum":["POSTING","REVERSAL",null]},"latestSourceVersion":{"type":["null","string"]},"diagnostics":{"type":["null","object"],"additionalProperties":true,"description":"Latest confirmation comparison evidence. CONFIRMATION_SNAPSHOT retains expected/received headers and lines plus an order-independent multiset diff; LEGACY_CHECKS reports stored-check reasons only, with unavailable historical snapshots/diff set to null. This does not alter accounting authority.","properties":{"version":{"type":"integer","enum":[1]},"evidenceBasis":{"type":"string","enum":["CONFIRMATION_SNAPSHOT","LEGACY_CHECKS"]},"reasonCodes":{"type":"array","items":{"type":"string","enum":["UNRESOLVED_ACCOUNT","ACCOUNTING_LINES_MISMATCH","CURRENCY_MISMATCH","POSTING_DATE_MISMATCH"]}},"expected":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"received":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"lineDiff":{"type":["null","object"],"additionalProperties":true,"properties":{"missingExpected":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unexpectedReceived":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unresolvedAccounts":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}}}}}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/erp-documents/{id}/transmissions":{"post":{"summary":"Record ERP document transmission status","tags":["Integration - ERP Documents"],"description":"Records send, acknowledgement, posting, rejection, cancellation, or failed-transfer history for an ERP document and updates its lifecycle timestamps/status. An INBOUND POSTED callback may include an immutable accountingConfirmation snapshot so Reconcilia can verify authoritative ERP journal lines, corrections, and reversals. Requires full_access or transactions.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["direction","transport","status"],"properties":{"direction":{"type":"string","enum":["OUTBOUND","INBOUND"],"description":"OUTBOUND records handoff from Reconcilia to an ERP or connector. INBOUND records ERP callback/postback status."},"transport":{"type":"string","enum":["API_PULL","API_PUSH","WEBHOOK","MANUAL"]},"status":{"type":"string","enum":["PENDING","SENT","ACKNOWLEDGED","POSTED","REJECTED","FAILED","CANCELLED"]},"externalSystem":{"type":["string","null"],"maxLength":160},"externalReference":{"type":["string","null"],"maxLength":255},"externalDocumentId":{"type":["string","null"],"maxLength":255},"externalStatus":{"type":["string","null"],"maxLength":160},"requestPayload":{"type":["null","object"],"additionalProperties":true},"responsePayload":{"type":["null","object"],"additionalProperties":true},"errorMessage":{"type":["string","null"],"maxLength":2000},"occurredAt":{"type":["string","null"],"format":"date-time"},"accountingConfirmation":{"type":"object","additionalProperties":false,"required":["eventType","sourceVersion","postingDate","currency","lines"],"properties":{"eventType":{"type":"string","enum":["POSTING","REVERSAL"]},"sourceVersion":{"type":"string","minLength":1,"maxLength":255,"description":"Immutable ERP source version or event id. Unique per ERP document."},"sourceUpdatedAt":{"type":["string","null"],"format":"date-time"},"externalDocumentId":{"type":["string","null"],"maxLength":255},"externalReference":{"type":["string","null"],"maxLength":255},"postingDate":{"type":"string","format":"date"},"currency":{"type":"string","minLength":3,"maxLength":3},"supersedesConfirmationId":{"type":["string","null"]},"reversesConfirmationId":{"type":["string","null"]},"metadata":{"type":["null","object"],"additionalProperties":true},"lines":{"type":"array","minItems":2,"items":{"type":"object","additionalProperties":false,"required":["lineNo","debit","credit"],"anyOf":[{"required":["accountId"]},{"required":["accountCode"]}],"properties":{"lineNo":{"type":"integer","minimum":1},"externalLineId":{"type":["string","null"],"maxLength":255},"accountId":{"type":["string","null"]},"accountCode":{"type":["string","null"],"maxLength":160},"description":{"type":["string","null"],"maxLength":2000},"debit":{"type":["number","string"]},"credit":{"type":["number","string"]},"metadata":{"type":["null","object"],"additionalProperties":true}}}}}}}},"examples":{"example1":{"value":{"direction":"OUTBOUND","transport":"API_PUSH","status":"SENT","externalSystem":"example-erp","externalReference":"ERP-JE-2026-0001","occurredAt":"2026-04-27T16:00:00.000Z","requestPayload":{"batchId":"batch-2026-04-27"}}},"example2":{"value":{"direction":"INBOUND","transport":"WEBHOOK","status":"POSTED","externalSystem":"example-erp","externalDocumentId":"ERP-JE-2026-0001","externalStatus":"POSTED","responsePayload":{"postingRunId":"post-2026-04-27"},"accountingConfirmation":{"eventType":"POSTING","sourceVersion":"posting-v1","sourceUpdatedAt":"2026-04-27T16:05:00.000Z","postingDate":"2026-04-27","currency":"USD","lines":[{"lineNo":1,"accountCode":"1000","debit":"125.00","credit":"0.00"},{"lineNo":2,"accountCode":"6100","debit":"0.00","credit":"125.00"}]}}}}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string","maxLength":200},"in":"header","name":"idempotency-key","required":false,"description":"Optional caller idempotency key. ERP document writes prefer entityId/docType/docNo; payment journal writes prefer entityId/journalReference."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["data","transmission"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","docType","docDate","postingDate","currency","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":["null","string"]},"docType":{"type":"string"},"docNo":{"type":["null","string"],"description":"Caller/source document number. Reconcilia uses entityId + docType + docNo as the natural idempotency key for ERP document writes. externalSystem + externalDocumentId can also be supplied and is returned for ERP-side mapping."},"docDate":{"type":"string","format":"date"},"postingDate":{"type":"string","format":"date"},"currency":{"type":"string"},"counterpartyId":{"type":["null","string"],"description":"Document-level primary counterparty. Use this for AP_INVOICE vendor, AR_INVOICE customer, and any single-party document. Supply either counterpartyId or externalSystem/counterpartyExternalSystem + externalCounterpartyId."},"totalAmount":{"type":["null","number","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"importJobId":{"type":["null","string"]},"sourceType":{"type":"string"},"isManual":{"type":"boolean"},"origin":{"type":"string"},"lifecycleStatus":{"type":"string"},"externalSystem":{"type":["null","string"]},"externalDocumentId":{"type":["null","string"],"description":"External ERP/source document id used with externalSystem for mapping. It is separate from docNo and can also be updated by transmission callbacks."},"externalStatus":{"type":["null","string"]},"generatedFromType":{"type":["null","string"]},"generatedFromId":{"type":["null","string"]},"submittedAt":{"type":["null","string"],"format":"date-time"},"acknowledgedAt":{"type":["null","string"],"format":"date-time"},"postedAt":{"type":["null","string"],"format":"date-time"},"rejectedAt":{"type":["null","string"],"format":"date-time"},"lastSyncAt":{"type":["null","string"],"format":"date-time"},"lastError":{"type":["null","string"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"erpDocumentLines":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","lineNo","debit","credit"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"documentId":{"type":"string"},"lineNo":{"type":"integer"},"accountId":{"type":["null","string"]},"counterpartyId":{"type":["null","string"],"description":"Line-level counterparty reference. Use counterpartyId or externalSystem/counterpartyExternalSystem + externalCounterpartyId for payment/receipt batches, mixed journals, or allocation lines. Matching should prefer the line counterparty and fall back to the document header counterparty."},"description":{"type":["null","string"]},"debit":{"type":["number","string"]},"credit":{"type":["number","string"]},"amount":{"type":["null","number","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"chartOfAccounts":{"type":["null","object"],"additionalProperties":true},"counterparties":{"type":["null","object"],"additionalProperties":true}}}},"erpDocumentTransmissions":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","erpDocumentId","direction","transport","status","occurredAt","createdAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"erpDocumentId":{"type":"string"},"direction":{"type":"string"},"transport":{"type":"string"},"status":{"type":"string"},"externalSystem":{"type":["null","string"]},"externalReference":{"type":["null","string"]},"requestPayload":{"type":["null","object"],"additionalProperties":true},"responsePayload":{"type":["null","object"],"additionalProperties":true},"errorMessage":{"type":["null","string"]},"occurredAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}}},"erpPostingConfirmations":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","erpDocumentId","transmissionId","eventType","verificationStatus","sourceVersion","postingDate","currency","totalDebit","totalCredit","contentHash","createdAt","lines"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"erpDocumentId":{"type":"string"},"transmissionId":{"type":"string"},"eventType":{"type":"string","enum":["POSTING","REVERSAL"]},"verificationStatus":{"type":"string","enum":["VERIFIED","MISMATCH"]},"externalSystem":{"type":["null","string"]},"externalDocumentId":{"type":["null","string"]},"externalReference":{"type":["null","string"]},"sourceVersion":{"type":"string"},"sourceUpdatedAt":{"type":["null","string"],"format":"date-time"},"postingDate":{"type":"string","format":"date"},"currency":{"type":"string"},"totalDebit":{"type":["number","string"]},"totalCredit":{"type":["number","string"]},"contentHash":{"type":"string"},"supersedesConfirmationId":{"type":["null","string"]},"reversesConfirmationId":{"type":["null","string"]},"verificationSummary":{"type":["null","object"],"additionalProperties":true,"properties":{"diagnostics":{"type":["null","object"],"additionalProperties":true,"description":"Latest confirmation comparison evidence. CONFIRMATION_SNAPSHOT retains expected/received headers and lines plus an order-independent multiset diff; LEGACY_CHECKS reports stored-check reasons only, with unavailable historical snapshots/diff set to null. This does not alter accounting authority.","properties":{"version":{"type":"integer","enum":[1]},"evidenceBasis":{"type":"string","enum":["CONFIRMATION_SNAPSHOT","LEGACY_CHECKS"]},"reasonCodes":{"type":"array","items":{"type":"string","enum":["UNRESOLVED_ACCOUNT","ACCOUNTING_LINES_MISMATCH","CURRENCY_MISMATCH","POSTING_DATE_MISMATCH"]}},"expected":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"received":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"lineDiff":{"type":["null","object"],"additionalProperties":true,"properties":{"missingExpected":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unexpectedReceived":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unresolvedAccounts":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}}}}}},"metadata":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","confirmationId","lineNo","debit","credit","createdAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"confirmationId":{"type":"string"},"lineNo":{"type":"integer"},"externalLineId":{"type":["null","string"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"description":{"type":["null","string"]},"debit":{"type":["number","string"]},"credit":{"type":["number","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"chartOfAccounts":{"type":["null","object"],"additionalProperties":true}}}}}}},"accountingConfirmationState":{"type":"object","additionalProperties":false,"required":["status","latestConfirmationId","currentConfirmationId","latestEventType","latestSourceVersion"],"properties":{"status":{"type":"string","enum":["AWAITING_EVIDENCE","VERIFIED","MISMATCH","REVERSED"]},"latestConfirmationId":{"type":["null","string"]},"currentConfirmationId":{"type":["null","string"]},"latestEventType":{"type":["null","string"],"enum":["POSTING","REVERSAL",null]},"latestSourceVersion":{"type":["null","string"]},"diagnostics":{"type":["null","object"],"additionalProperties":true,"description":"Latest confirmation comparison evidence. CONFIRMATION_SNAPSHOT retains expected/received headers and lines plus an order-independent multiset diff; LEGACY_CHECKS reports stored-check reasons only, with unavailable historical snapshots/diff set to null. This does not alter accounting authority.","properties":{"version":{"type":"integer","enum":[1]},"evidenceBasis":{"type":"string","enum":["CONFIRMATION_SNAPSHOT","LEGACY_CHECKS"]},"reasonCodes":{"type":"array","items":{"type":"string","enum":["UNRESOLVED_ACCOUNT","ACCOUNTING_LINES_MISMATCH","CURRENCY_MISMATCH","POSTING_DATE_MISMATCH"]}},"expected":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"received":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"lineDiff":{"type":["null","object"],"additionalProperties":true,"properties":{"missingExpected":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unexpectedReceived":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unresolvedAccounts":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}}}}}}}},"transmission":{"type":"object","additionalProperties":true,"required":["id","orgId","erpDocumentId","direction","transport","status","occurredAt","createdAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"erpDocumentId":{"type":"string"},"direction":{"type":"string"},"transport":{"type":"string"},"status":{"type":"string"},"externalSystem":{"type":["null","string"]},"externalReference":{"type":["null","string"]},"requestPayload":{"type":["null","object"],"additionalProperties":true},"responsePayload":{"type":["null","object"],"additionalProperties":true},"errorMessage":{"type":["null","string"]},"occurredAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}},"accountingConfirmation":{"type":"object","additionalProperties":true,"required":["id","orgId","erpDocumentId","transmissionId","eventType","verificationStatus","sourceVersion","postingDate","currency","totalDebit","totalCredit","contentHash","createdAt","lines"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"erpDocumentId":{"type":"string"},"transmissionId":{"type":"string"},"eventType":{"type":"string","enum":["POSTING","REVERSAL"]},"verificationStatus":{"type":"string","enum":["VERIFIED","MISMATCH"]},"externalSystem":{"type":["null","string"]},"externalDocumentId":{"type":["null","string"]},"externalReference":{"type":["null","string"]},"sourceVersion":{"type":"string"},"sourceUpdatedAt":{"type":["null","string"],"format":"date-time"},"postingDate":{"type":"string","format":"date"},"currency":{"type":"string"},"totalDebit":{"type":["number","string"]},"totalCredit":{"type":["number","string"]},"contentHash":{"type":"string"},"supersedesConfirmationId":{"type":["null","string"]},"reversesConfirmationId":{"type":["null","string"]},"verificationSummary":{"type":["null","object"],"additionalProperties":true,"properties":{"diagnostics":{"type":["null","object"],"additionalProperties":true,"description":"Latest confirmation comparison evidence. CONFIRMATION_SNAPSHOT retains expected/received headers and lines plus an order-independent multiset diff; LEGACY_CHECKS reports stored-check reasons only, with unavailable historical snapshots/diff set to null. This does not alter accounting authority.","properties":{"version":{"type":"integer","enum":[1]},"evidenceBasis":{"type":"string","enum":["CONFIRMATION_SNAPSHOT","LEGACY_CHECKS"]},"reasonCodes":{"type":"array","items":{"type":"string","enum":["UNRESOLVED_ACCOUNT","ACCOUNTING_LINES_MISMATCH","CURRENCY_MISMATCH","POSTING_DATE_MISMATCH"]}},"expected":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"received":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"lineDiff":{"type":["null","object"],"additionalProperties":true,"properties":{"missingExpected":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unexpectedReceived":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unresolvedAccounts":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}}}}}},"metadata":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","confirmationId","lineNo","debit","credit","createdAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"confirmationId":{"type":"string"},"lineNo":{"type":"integer"},"externalLineId":{"type":["null","string"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"description":{"type":["null","string"]},"debit":{"type":["number","string"]},"credit":{"type":["number","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"chartOfAccounts":{"type":["null","object"],"additionalProperties":true}}}}}},"idempotency":{"type":"object","additionalProperties":false,"required":["key","replayed","requestBodyHash"],"properties":{"key":{"type":"string"},"replayed":{"type":"boolean"},"requestBodyHash":{"type":"string"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/payment-journals":{"get":{"summary":"List ERP payment journals","tags":["Integration - Payment Journals"],"description":"Returns PAYMENT ERP documents through the payment-journal read model. Requires any integration API scope.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string"},"in":"query","name":"entityId","required":false},{"schema":{"type":"string"},"in":"query","name":"bankAccountId","required":false},{"schema":{"type":"string"},"in":"query","name":"counterpartyId","required":false},{"schema":{"type":"string"},"in":"query","name":"journalReference","required":false},{"schema":{"type":"string"},"in":"query","name":"paymentReference","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"dateFrom","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"dateTo","required":false},{"schema":{"type":"string","enum":["journalDate","paymentDate","journalReference","createdAt","updatedAt"]},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string","enum":["asc","desc"]},"in":"query","name":"sortDir","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","erpJournalReference","paymentDate","totalAmount","currency","lineCount"],"properties":{"id":{"type":["null","string"]},"orgId":{"type":["null","string"]},"entityId":{"type":["null","string"]},"erpJournalReference":{"type":["null","string"]},"journalDate":{"type":["null","string"],"format":"date"},"paymentDate":{"type":["null","string"],"format":"date"},"sourceFormat":{"type":["null","string"]},"importedByUserId":{"type":["null","string"]},"importedAt":{"type":["null","string"],"format":"date-time"},"originalFilename":{"type":["null","string"]},"totalAmount":{"type":["null","number","string"]},"currency":{"type":["null","string"]},"lineCount":{"type":["null","integer"]},"createdAt":{"type":["null","string"],"format":"date-time"},"updatedAt":{"type":["null","string"],"format":"date-time"},"deletedAt":{"type":["null","string"],"format":"date-time"},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","erpPaymentJournalId","amount","direction","currency"],"properties":{"id":{"type":"string"},"orgId":{"type":["null","string"]},"erpPaymentJournalId":{"type":["null","string"]},"bankAccountId":{"type":["null","string"]},"counterpartyId":{"type":["null","string"]},"counterpartyName":{"type":["null","string"]},"counterpartyType":{"type":["null","string"]},"vendorId":{"type":["null","string"]},"vendorName":{"type":["null","string"]},"paymentReference":{"type":["null","string"]},"paymentDate":{"type":["null","string"],"format":"date"},"amount":{"type":["null","number","string"]},"direction":{"type":["null","string"]},"currency":{"type":["null","string"]},"description":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"updatedAt":{"type":["null","string"],"format":"date-time"},"deletedAt":{"type":["null","string"],"format":"date-time"}}}}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Create an ERP payment journal","tags":["Integration - Payment Journals"],"description":"Creates PAYMENT ERP source data from row-shaped payment-file data. The payload has no separate header object; repeated row fields are grouped into one journal per request. This endpoint does not execute payments, move money, or auto-reconcile. VALIDATE_ONLY checks the generated ERP document without writes. Requires full_access or transactions.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid data. VALIDATE_ONLY performs contract, reference, duplicate, and parser validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting rows. Silent overwrite/supersede is intentionally not supported for these source-data endpoints."},"externalSystem":{"type":["string","null"],"description":"Source ERP/integration system used as the default counterparty external-id system for rows."},"metadata":{"type":["null","object"],"additionalProperties":true},"rows":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["entityId","journalReference","paymentDate","currency","amount"],"properties":{"entityId":{"type":"string"},"journalReference":{"type":"string","minLength":1},"journalDate":{"type":["string","null"],"format":"date"},"paymentDate":{"type":"string","format":"date"},"postingDate":{"type":["string","null"],"format":"date"},"currency":{"type":"string","minLength":3,"maxLength":3},"bankAccountId":{"type":["string","null"]},"counterpartyId":{"type":["string","null"]},"externalSystem":{"type":["string","null"],"description":"Row-specific source system for external counterparty resolution."},"counterpartyExternalSystem":{"type":["string","null"],"description":"Row-specific source system for externalCounterpartyId. Defaults to request externalSystem."},"externalCounterpartyId":{"type":["string","null"],"description":"External vendor/customer/party id used to resolve counterpartyId."},"counterpartyExternalId":{"type":["string","null"],"description":"Alias for externalCounterpartyId."},"vendorId":{"type":["string","null"],"description":"External vendor/provider identifier preserved in line metadata."},"vendorName":{"type":["string","null"]},"paymentReference":{"type":["string","null"]},"amount":{"type":["number","string"]},"direction":{"type":["string","null"],"enum":["DEBIT","CREDIT","INFLOW","OUTFLOW",null],"description":"Allowed values: DEBIT/CREDIT use accounting sign semantics; INFLOW/OUTFLOW use cash-movement semantics and are normalized to debit/credit where needed."},"description":{"type":["string","null"]},"accountId":{"type":["string","null"]},"accountCode":{"type":["string","null"]},"lineNo":{"type":["integer","null"],"minimum":1},"metadata":{"type":["null","object"],"additionalProperties":true}}}}}},"example":{"processingMode":"AUTO","conflictPolicy":"BLOCK","externalSystem":"example-erp","rows":[{"entityId":"00000000-0000-0000-0000-000000000000","journalReference":"PAY-2026-0001","journalDate":"2026-04-27","paymentDate":"2026-04-27","postingDate":"2026-04-27","currency":"USD","bankAccountId":"00000000-0000-0000-0000-000000000000","externalCounterpartyId":"VEND-001","vendorId":"VEND-001","vendorName":"Example Vendor","paymentReference":"PAY-2026-0001-L1","amount":"1250.00","direction":"OUTFLOW","accountCode":"1000","description":"Vendor payment","metadata":{"sourceLineId":"payment-file-row-1"}}]}}},"required":true},"parameters":[{"schema":{"type":"string","maxLength":200},"in":"header","name":"idempotency-key","required":false,"description":"Optional caller idempotency key. ERP document writes prefer entityId/docType/docNo; payment journal writes prefer entityId/journalReference."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["data"],"properties":{"data":{"type":["null","object"],"additionalProperties":true},"erpDocument":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","docType","docDate","postingDate","currency","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":["null","string"]},"docType":{"type":"string"},"docNo":{"type":["null","string"],"description":"Caller/source document number. Reconcilia uses entityId + docType + docNo as the natural idempotency key for ERP document writes. externalSystem + externalDocumentId can also be supplied and is returned for ERP-side mapping."},"docDate":{"type":"string","format":"date"},"postingDate":{"type":"string","format":"date"},"currency":{"type":"string"},"counterpartyId":{"type":["null","string"],"description":"Document-level primary counterparty. Use this for AP_INVOICE vendor, AR_INVOICE customer, and any single-party document. Supply either counterpartyId or externalSystem/counterpartyExternalSystem + externalCounterpartyId."},"totalAmount":{"type":["null","number","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"importJobId":{"type":["null","string"]},"sourceType":{"type":"string"},"isManual":{"type":"boolean"},"origin":{"type":"string"},"lifecycleStatus":{"type":"string"},"externalSystem":{"type":["null","string"]},"externalDocumentId":{"type":["null","string"],"description":"External ERP/source document id used with externalSystem for mapping. It is separate from docNo and can also be updated by transmission callbacks."},"externalStatus":{"type":["null","string"]},"generatedFromType":{"type":["null","string"]},"generatedFromId":{"type":["null","string"]},"submittedAt":{"type":["null","string"],"format":"date-time"},"acknowledgedAt":{"type":["null","string"],"format":"date-time"},"postedAt":{"type":["null","string"],"format":"date-time"},"rejectedAt":{"type":["null","string"],"format":"date-time"},"lastSyncAt":{"type":["null","string"],"format":"date-time"},"lastError":{"type":["null","string"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"erpDocumentLines":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","lineNo","debit","credit"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"documentId":{"type":"string"},"lineNo":{"type":"integer"},"accountId":{"type":["null","string"]},"counterpartyId":{"type":["null","string"],"description":"Line-level counterparty reference. Use counterpartyId or externalSystem/counterpartyExternalSystem + externalCounterpartyId for payment/receipt batches, mixed journals, or allocation lines. Matching should prefer the line counterparty and fall back to the document header counterparty."},"description":{"type":["null","string"]},"debit":{"type":["number","string"]},"credit":{"type":["number","string"]},"amount":{"type":["null","number","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"chartOfAccounts":{"type":["null","object"],"additionalProperties":true},"counterparties":{"type":["null","object"],"additionalProperties":true}}}},"erpDocumentTransmissions":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","erpDocumentId","direction","transport","status","occurredAt","createdAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"erpDocumentId":{"type":"string"},"direction":{"type":"string"},"transport":{"type":"string"},"status":{"type":"string"},"externalSystem":{"type":["null","string"]},"externalReference":{"type":["null","string"]},"requestPayload":{"type":["null","object"],"additionalProperties":true},"responsePayload":{"type":["null","object"],"additionalProperties":true},"errorMessage":{"type":["null","string"]},"occurredAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}}},"erpPostingConfirmations":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","erpDocumentId","transmissionId","eventType","verificationStatus","sourceVersion","postingDate","currency","totalDebit","totalCredit","contentHash","createdAt","lines"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"erpDocumentId":{"type":"string"},"transmissionId":{"type":"string"},"eventType":{"type":"string","enum":["POSTING","REVERSAL"]},"verificationStatus":{"type":"string","enum":["VERIFIED","MISMATCH"]},"externalSystem":{"type":["null","string"]},"externalDocumentId":{"type":["null","string"]},"externalReference":{"type":["null","string"]},"sourceVersion":{"type":"string"},"sourceUpdatedAt":{"type":["null","string"],"format":"date-time"},"postingDate":{"type":"string","format":"date"},"currency":{"type":"string"},"totalDebit":{"type":["number","string"]},"totalCredit":{"type":["number","string"]},"contentHash":{"type":"string"},"supersedesConfirmationId":{"type":["null","string"]},"reversesConfirmationId":{"type":["null","string"]},"verificationSummary":{"type":["null","object"],"additionalProperties":true,"properties":{"diagnostics":{"type":["null","object"],"additionalProperties":true,"description":"Latest confirmation comparison evidence. CONFIRMATION_SNAPSHOT retains expected/received headers and lines plus an order-independent multiset diff; LEGACY_CHECKS reports stored-check reasons only, with unavailable historical snapshots/diff set to null. This does not alter accounting authority.","properties":{"version":{"type":"integer","enum":[1]},"evidenceBasis":{"type":"string","enum":["CONFIRMATION_SNAPSHOT","LEGACY_CHECKS"]},"reasonCodes":{"type":"array","items":{"type":"string","enum":["UNRESOLVED_ACCOUNT","ACCOUNTING_LINES_MISMATCH","CURRENCY_MISMATCH","POSTING_DATE_MISMATCH"]}},"expected":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"received":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"lineDiff":{"type":["null","object"],"additionalProperties":true,"properties":{"missingExpected":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unexpectedReceived":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unresolvedAccounts":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}}}}}},"metadata":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","confirmationId","lineNo","debit","credit","createdAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"confirmationId":{"type":"string"},"lineNo":{"type":"integer"},"externalLineId":{"type":["null","string"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"description":{"type":["null","string"]},"debit":{"type":["number","string"]},"credit":{"type":["number","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"chartOfAccounts":{"type":["null","object"],"additionalProperties":true}}}}}}},"accountingConfirmationState":{"type":"object","additionalProperties":false,"required":["status","latestConfirmationId","currentConfirmationId","latestEventType","latestSourceVersion"],"properties":{"status":{"type":"string","enum":["AWAITING_EVIDENCE","VERIFIED","MISMATCH","REVERSED"]},"latestConfirmationId":{"type":["null","string"]},"currentConfirmationId":{"type":["null","string"]},"latestEventType":{"type":["null","string"],"enum":["POSTING","REVERSAL",null]},"latestSourceVersion":{"type":["null","string"]},"diagnostics":{"type":["null","object"],"additionalProperties":true,"description":"Latest confirmation comparison evidence. CONFIRMATION_SNAPSHOT retains expected/received headers and lines plus an order-independent multiset diff; LEGACY_CHECKS reports stored-check reasons only, with unavailable historical snapshots/diff set to null. This does not alter accounting authority.","properties":{"version":{"type":"integer","enum":[1]},"evidenceBasis":{"type":"string","enum":["CONFIRMATION_SNAPSHOT","LEGACY_CHECKS"]},"reasonCodes":{"type":"array","items":{"type":"string","enum":["UNRESOLVED_ACCOUNT","ACCOUNTING_LINES_MISMATCH","CURRENCY_MISMATCH","POSTING_DATE_MISMATCH"]}},"expected":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"received":{"type":["null","object"],"additionalProperties":true,"properties":{"postingDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}},"lineDiff":{"type":["null","object"],"additionalProperties":true,"properties":{"missingExpected":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unexpectedReceived":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}},"unresolvedAccounts":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"lineNo":{"type":["null","integer"]},"accountId":{"type":["null","string"]},"accountCode":{"type":["null","string"]},"debit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."},"credit":{"type":"string","description":"Amount at the existing six-decimal comparison precision."}}}}}}}}}}}},"idempotency":{"type":"object","additionalProperties":false,"required":["key","replayed","requestBodyHash"],"properties":{"key":{"type":"string"},"replayed":{"type":"boolean"},"requestBodyHash":{"type":"string"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/payment-journals/{id}":{"get":{"summary":"Get an ERP payment journal","tags":["Integration - Payment Journals"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","erpJournalReference","paymentDate","totalAmount","currency","lineCount"],"properties":{"id":{"type":["null","string"]},"orgId":{"type":["null","string"]},"entityId":{"type":["null","string"]},"erpJournalReference":{"type":["null","string"]},"journalDate":{"type":["null","string"],"format":"date"},"paymentDate":{"type":["null","string"],"format":"date"},"sourceFormat":{"type":["null","string"]},"importedByUserId":{"type":["null","string"]},"importedAt":{"type":["null","string"],"format":"date-time"},"originalFilename":{"type":["null","string"]},"totalAmount":{"type":["null","number","string"]},"currency":{"type":["null","string"]},"lineCount":{"type":["null","integer"]},"createdAt":{"type":["null","string"],"format":"date-time"},"updatedAt":{"type":["null","string"],"format":"date-time"},"deletedAt":{"type":["null","string"],"format":"date-time"},"lines":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","erpPaymentJournalId","amount","direction","currency"],"properties":{"id":{"type":"string"},"orgId":{"type":["null","string"]},"erpPaymentJournalId":{"type":["null","string"]},"bankAccountId":{"type":["null","string"]},"counterpartyId":{"type":["null","string"]},"counterpartyName":{"type":["null","string"]},"counterpartyType":{"type":["null","string"]},"vendorId":{"type":["null","string"]},"vendorName":{"type":["null","string"]},"paymentReference":{"type":["null","string"]},"paymentDate":{"type":["null","string"],"format":"date"},"amount":{"type":["null","number","string"]},"direction":{"type":["null","string"]},"currency":{"type":["null","string"]},"description":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"updatedAt":{"type":["null","string"],"format":"date-time"},"deletedAt":{"type":["null","string"],"format":"date-time"}}}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/category-definitions":{"get":{"summary":"List category definitions","tags":["Integration - Categories"],"description":"Returns Reconcilia category definitions. Use code as the stable external mapping value and id when linking Reconcilia-owned rows. Requires any integration API scope.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string"},"in":"query","name":"createdByEntityId","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string","enum":["code","name","categoryNature","createdAt","updatedAt"]},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string","enum":["asc","desc"]},"in":"query","name":"sortDir","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","code","name","categoryNature","isActive","approvalStatus","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"createdByEntityId":{"type":["null","string"]},"createdByEntityName":{"type":["null","string"]},"code":{"type":"string","description":"Stable category definition code suitable for external mapping when the ERP does not know Reconcilia ids."},"name":{"type":"string"},"description":{"type":["null","string"]},"categoryNature":{"type":"string","enum":["INFLOW","OUTFLOW","UNDEFINED","OTHER"]},"isSystem":{"type":"boolean"},"isActive":{"type":"boolean"},"approvalStatus":{"type":"string"},"approvedAt":{"type":["null","string"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Create a category definition","tags":["Integration - Categories"],"description":"Creates tenant-owned category setup data for implementation/onboarding tools. Requires full_access. Use VALIDATE_ONLY to dry-run without writes.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["code","name"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs contract, reference, and duplicate validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting setup rows. Silent overwrite/upsert is intentionally not supported for category setup endpoints."},"createdByEntityId":{"type":["string","null"]},"code":{"type":"string","minLength":1,"pattern":"\\S","description":"Stable implementation/setup code. Treat this as the external mapping key for category definitions."},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"categoryNature":{"type":["string","null"],"enum":["INFLOW","OUTFLOW","UNDEFINED","OTHER",null],"description":"Cash-flow nature: INFLOW, OUTFLOW, UNDEFINED, or OTHER. UNDEFINED and OTHER do not imply a cash direction."},"isActive":{"type":"boolean"}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"oneOf":[{"type":"object","additionalProperties":true,"required":["id","orgId","code","name","categoryNature","isActive","approvalStatus","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"createdByEntityId":{"type":["null","string"]},"createdByEntityName":{"type":["null","string"]},"code":{"type":"string","description":"Stable category definition code suitable for external mapping when the ERP does not know Reconcilia ids."},"name":{"type":"string"},"description":{"type":["null","string"]},"categoryNature":{"type":"string","enum":["INFLOW","OUTFLOW","UNDEFINED","OTHER"]},"isSystem":{"type":"boolean"},"isActive":{"type":"boolean"},"approvalStatus":{"type":"string"},"approvedAt":{"type":["null","string"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},{"type":"object","additionalProperties":false,"required":["valid","accepted","processingMode","checks"],"properties":{"valid":{"type":"boolean"},"accepted":{"type":"boolean"},"processingMode":{"type":"string","enum":["VALIDATE_ONLY"]},"checks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","status","message"],"properties":{"code":{"type":"string"},"status":{"type":"string","enum":["PASSED"]},"message":{"type":"string"}}}}}}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/category-definitions/bulk":{"post":{"summary":"Create category definitions in bulk","tags":["Integration - Categories"],"description":"Validates or creates many tenant-owned category definitions in one all-or-nothing setup request. Requires full_access. Each row must include clientRef so implementation tooling can build a deterministic ID map.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs contract, reference, and duplicate validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting setup rows. Silent overwrite/upsert is intentionally not supported for category setup endpoints."},"requestReference":{"type":["string","null"],"maxLength":255,"description":"Caller setup-batch reference echoed in the response for audit and troubleshooting."},"rows":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["clientRef","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200,"description":"Caller-supplied stable reference echoed in row results and idMap."},"data":{"type":"object","additionalProperties":false,"required":["code","name"],"properties":{"createdByEntityId":{"type":["string","null"]},"code":{"type":"string","minLength":1,"pattern":"\\S","description":"Stable implementation/setup code. Treat this as the external mapping key for category definitions."},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"categoryNature":{"type":["string","null"],"enum":["INFLOW","OUTFLOW","UNDEFINED","OTHER",null],"description":"Cash-flow nature: INFLOW, OUTFLOW, UNDEFINED, or OTHER. UNDEFINED and OTHER do not imply a cash direction."},"isActive":{"type":"boolean"}}}}}}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["processingMode","requestReference","summary","rows","idMap"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":["null","string"]},"summary":{"type":"object","additionalProperties":false,"required":["received","valid","blocked","created"],"properties":{"received":{"type":"integer"},"valid":{"type":"integer"},"blocked":{"type":"integer"},"created":{"type":"integer"}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","clientRef","status","id","errors","warnings"],"properties":{"index":{"type":"integer"},"clientRef":{"type":"string"},"status":{"type":"string","enum":["VALID","BLOCKED","CREATED"]},"id":{"type":["null","string"]},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}},"idMap":{"type":"object","additionalProperties":{"type":"string"},"description":"Maps clientRef to created record id for AUTO requests."}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/category-definitions/{id}":{"get":{"summary":"Get a category definition","tags":["Integration - Categories"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","code","name","categoryNature","isActive","approvalStatus","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"createdByEntityId":{"type":["null","string"]},"createdByEntityName":{"type":["null","string"]},"code":{"type":"string","description":"Stable category definition code suitable for external mapping when the ERP does not know Reconcilia ids."},"name":{"type":"string"},"description":{"type":["null","string"]},"categoryNature":{"type":"string","enum":["INFLOW","OUTFLOW","UNDEFINED","OTHER"]},"isSystem":{"type":"boolean"},"isActive":{"type":"boolean"},"approvalStatus":{"type":"string"},"approvedAt":{"type":["null","string"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Update a category definition","tags":["Integration - Categories"],"description":"Updates mutable category definition setup fields. Requires full_access. Use VALIDATE_ONLY to dry-run without writes.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs contract, reference, and duplicate validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting setup rows. Silent overwrite/upsert is intentionally not supported for category setup endpoints."},"createdByEntityId":{"type":["string","null"]},"code":{"type":"string","minLength":1,"pattern":"\\S","description":"Stable implementation/setup code. Treat this as the external mapping key for category definitions."},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"categoryNature":{"type":["string","null"],"enum":["INFLOW","OUTFLOW","UNDEFINED","OTHER",null],"description":"Cash-flow nature: INFLOW, OUTFLOW, UNDEFINED, or OTHER. UNDEFINED and OTHER do not imply a cash direction."},"isActive":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"oneOf":[{"type":"object","additionalProperties":true,"required":["id","orgId","code","name","categoryNature","isActive","approvalStatus","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"createdByEntityId":{"type":["null","string"]},"createdByEntityName":{"type":["null","string"]},"code":{"type":"string","description":"Stable category definition code suitable for external mapping when the ERP does not know Reconcilia ids."},"name":{"type":"string"},"description":{"type":["null","string"]},"categoryNature":{"type":"string","enum":["INFLOW","OUTFLOW","UNDEFINED","OTHER"]},"isSystem":{"type":"boolean"},"isActive":{"type":"boolean"},"approvalStatus":{"type":"string"},"approvedAt":{"type":["null","string"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},{"type":"object","additionalProperties":false,"required":["valid","accepted","processingMode","checks"],"properties":{"valid":{"type":"boolean"},"accepted":{"type":"boolean"},"processingMode":{"type":"string","enum":["VALIDATE_ONLY"]},"checks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","status","message"],"properties":{"code":{"type":"string"},"status":{"type":"string","enum":["PASSED"]},"message":{"type":"string"}}}}}}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/category-hierarchies":{"get":{"summary":"List category hierarchies","tags":["Integration - Categories"],"description":"Returns category hierarchies that organize category definitions into reporting, cash-position, forecast, categorization, or accounting trees. Requires any integration API scope.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string"},"in":"query","name":"entityId","required":false},{"schema":{"type":"string"},"in":"query","name":"purpose","required":false},{"schema":{"type":"string","enum":["CATEGORIZATION","CASH_POSITION","LIQUIDITY_FORECAST","REPORTING","ACCOUNTING"]},"in":"query","name":"usage","required":false},{"schema":{"type":"string","enum":["ORG_TEMPLATE","ENTITY_PRIVATE","GROUP_SHARED"]},"in":"query","name":"ownerType","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string","enum":["name","purpose","createdAt","updatedAt"]},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string","enum":["asc","desc"]},"in":"query","name":"sortDir","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","name","purpose","ownerType","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":["null","string"]},"entityName":{"type":["null","string"]},"entityGroupId":{"type":["null","string"]},"entityGroupName":{"type":["null","string"]},"name":{"type":"string"},"description":{"type":["null","string"]},"purpose":{"type":"string"},"accessScope":{"type":"string"},"ownerType":{"type":"string","enum":["ORG_TEMPLATE","ENTITY_PRIVATE","GROUP_SHARED"]},"usages":{"type":"array","items":{"type":"object","additionalProperties":true}},"nodeCount":{"type":"integer"},"assignmentCount":{"type":"integer"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Create a category hierarchy","tags":["Integration - Categories"],"description":"Creates a category hierarchy for implementation/onboarding setup. Requires full_access. Use VALIDATE_ONLY to dry-run owner, usage, and duplicate checks without writes.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs contract, reference, and duplicate validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting setup rows. Silent overwrite/upsert is intentionally not supported for category setup endpoints."},"entityId":{"type":["string","null"]},"entityGroupId":{"type":["string","null"]},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"purpose":{"type":["string","null"],"description":"Setup purpose such as CLASSIFICATION, CASH_POSITION, LIQUIDITY_FORECAST, REPORTING, or ACCOUNTING."},"accessScope":{"type":["string","null"]},"isActive":{"type":"boolean"},"usages":{"type":["array","null"],"items":{"type":"object","additionalProperties":false,"required":["usage"],"properties":{"usage":{"type":"string","enum":["CATEGORIZATION","CASH_POSITION","LIQUIDITY_FORECAST","REPORTING","ACCOUNTING"]},"isDefault":{"type":"boolean"},"metadata":{"type":["object","null"],"additionalProperties":true}}}}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"oneOf":[{"type":"object","additionalProperties":true,"required":["id","orgId","name","purpose","ownerType","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":["null","string"]},"entityName":{"type":["null","string"]},"entityGroupId":{"type":["null","string"]},"entityGroupName":{"type":["null","string"]},"name":{"type":"string"},"description":{"type":["null","string"]},"purpose":{"type":"string"},"accessScope":{"type":"string"},"ownerType":{"type":"string","enum":["ORG_TEMPLATE","ENTITY_PRIVATE","GROUP_SHARED"]},"usages":{"type":"array","items":{"type":"object","additionalProperties":true}},"nodeCount":{"type":"integer"},"assignmentCount":{"type":"integer"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},{"type":"object","additionalProperties":false,"required":["valid","accepted","processingMode","checks"],"properties":{"valid":{"type":"boolean"},"accepted":{"type":"boolean"},"processingMode":{"type":"string","enum":["VALIDATE_ONLY"]},"checks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","status","message"],"properties":{"code":{"type":"string"},"status":{"type":"string","enum":["PASSED"]},"message":{"type":"string"}}}}}}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/category-hierarchies/bulk":{"post":{"summary":"Create category hierarchies in bulk","tags":["Integration - Categories"],"description":"Validates or creates many category hierarchies in one all-or-nothing setup request. Requires full_access. Run definition setup before node setup so nodes can reference captured ids.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs contract, reference, and duplicate validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting setup rows. Silent overwrite/upsert is intentionally not supported for category setup endpoints."},"requestReference":{"type":["string","null"],"maxLength":255,"description":"Caller setup-batch reference echoed in the response for audit and troubleshooting."},"rows":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["clientRef","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200,"description":"Caller-supplied stable reference echoed in row results and idMap."},"data":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"entityId":{"type":["string","null"]},"entityGroupId":{"type":["string","null"]},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"purpose":{"type":["string","null"],"description":"Setup purpose such as CLASSIFICATION, CASH_POSITION, LIQUIDITY_FORECAST, REPORTING, or ACCOUNTING."},"accessScope":{"type":["string","null"]},"isActive":{"type":"boolean"},"usages":{"type":["array","null"],"items":{"type":"object","additionalProperties":false,"required":["usage"],"properties":{"usage":{"type":"string","enum":["CATEGORIZATION","CASH_POSITION","LIQUIDITY_FORECAST","REPORTING","ACCOUNTING"]},"isDefault":{"type":"boolean"},"metadata":{"type":["object","null"],"additionalProperties":true}}}}}}}}}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["processingMode","requestReference","summary","rows","idMap"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":["null","string"]},"summary":{"type":"object","additionalProperties":false,"required":["received","valid","blocked","created"],"properties":{"received":{"type":"integer"},"valid":{"type":"integer"},"blocked":{"type":"integer"},"created":{"type":"integer"}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","clientRef","status","id","errors","warnings"],"properties":{"index":{"type":"integer"},"clientRef":{"type":"string"},"status":{"type":"string","enum":["VALID","BLOCKED","CREATED"]},"id":{"type":["null","string"]},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}},"idMap":{"type":"object","additionalProperties":{"type":"string"},"description":"Maps clientRef to created record id for AUTO requests."}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/category-hierarchies/{id}":{"get":{"summary":"Get a category hierarchy","tags":["Integration - Categories"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","name","purpose","ownerType","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":["null","string"]},"entityName":{"type":["null","string"]},"entityGroupId":{"type":["null","string"]},"entityGroupName":{"type":["null","string"]},"name":{"type":"string"},"description":{"type":["null","string"]},"purpose":{"type":"string"},"accessScope":{"type":"string"},"ownerType":{"type":"string","enum":["ORG_TEMPLATE","ENTITY_PRIVATE","GROUP_SHARED"]},"usages":{"type":"array","items":{"type":"object","additionalProperties":true}},"nodeCount":{"type":"integer"},"assignmentCount":{"type":"integer"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Update a category hierarchy","tags":["Integration - Categories"],"description":"Updates mutable category hierarchy setup fields and usage metadata. Requires full_access. Use VALIDATE_ONLY to dry-run without writes.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs contract, reference, and duplicate validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting setup rows. Silent overwrite/upsert is intentionally not supported for category setup endpoints."},"entityId":{"type":["string","null"]},"entityGroupId":{"type":["string","null"]},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"purpose":{"type":["string","null"],"description":"Setup purpose such as CLASSIFICATION, CASH_POSITION, LIQUIDITY_FORECAST, REPORTING, or ACCOUNTING."},"accessScope":{"type":["string","null"]},"isActive":{"type":"boolean"},"usages":{"type":["array","null"],"items":{"type":"object","additionalProperties":false,"required":["usage"],"properties":{"usage":{"type":"string","enum":["CATEGORIZATION","CASH_POSITION","LIQUIDITY_FORECAST","REPORTING","ACCOUNTING"]},"isDefault":{"type":"boolean"},"metadata":{"type":["object","null"],"additionalProperties":true}}}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"oneOf":[{"type":"object","additionalProperties":true,"required":["id","orgId","name","purpose","ownerType","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":["null","string"]},"entityName":{"type":["null","string"]},"entityGroupId":{"type":["null","string"]},"entityGroupName":{"type":["null","string"]},"name":{"type":"string"},"description":{"type":["null","string"]},"purpose":{"type":"string"},"accessScope":{"type":"string"},"ownerType":{"type":"string","enum":["ORG_TEMPLATE","ENTITY_PRIVATE","GROUP_SHARED"]},"usages":{"type":"array","items":{"type":"object","additionalProperties":true}},"nodeCount":{"type":"integer"},"assignmentCount":{"type":"integer"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},{"type":"object","additionalProperties":false,"required":["valid","accepted","processingMode","checks"],"properties":{"valid":{"type":"boolean"},"accepted":{"type":"boolean"},"processingMode":{"type":"string","enum":["VALIDATE_ONLY"]},"checks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","status","message"],"properties":{"code":{"type":"string"},"status":{"type":"string","enum":["PASSED"]},"message":{"type":"string"}}}}}}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/category-nodes":{"get":{"summary":"List category nodes","tags":["Integration - Categories"],"description":"Returns the nodes for one hierarchy. Leaf nodes usually point to a category definition; branch nodes group leaves. Requires any integration API scope.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string"},"in":"query","name":"hierarchyId","required":true},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string","enum":["sortOrder","name","createdAt","updatedAt"]},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string","enum":["asc","desc"]},"in":"query","name":"sortDir","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","hierarchyId","nodeType","name","sortOrder","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"hierarchyId":{"type":"string"},"parentId":{"type":["null","string"]},"parentName":{"type":["null","string"]},"nodeType":{"type":"string"},"name":{"type":"string"},"description":{"type":["null","string"]},"sortOrder":{"type":"integer"},"categoryDefinitionId":{"type":["null","string"]},"categoryDefinitionCode":{"type":["null","string"]},"categoryDefinitionName":{"type":["null","string"]},"categoryNature":{"type":["null","string"],"enum":["INFLOW","OUTFLOW","UNDEFINED","OTHER",null]},"globalMappingId":{"type":["null","string"]},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Create a category node","tags":["Integration - Categories"],"description":"Creates a branch or leaf node in a category hierarchy for implementation/onboarding setup. Requires full_access. Use VALIDATE_ONLY to dry-run hierarchy, parent, and category-definition references without writes.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["hierarchyId","nodeType","name"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs contract, reference, and duplicate validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting setup rows. Silent overwrite/upsert is intentionally not supported for category setup endpoints."},"hierarchyId":{"type":"string"},"parentId":{"type":["string","null"]},"nodeType":{"type":"string","enum":["BRANCH","LEAF"]},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"sortOrder":{"type":"integer"},"categoryDefinitionId":{"type":["string","null"],"description":"Required for LEAF nodes. Omit for BRANCH grouping nodes."},"isActive":{"type":"boolean"}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"oneOf":[{"type":"object","additionalProperties":true,"required":["id","orgId","hierarchyId","nodeType","name","sortOrder","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"hierarchyId":{"type":"string"},"parentId":{"type":["null","string"]},"parentName":{"type":["null","string"]},"nodeType":{"type":"string"},"name":{"type":"string"},"description":{"type":["null","string"]},"sortOrder":{"type":"integer"},"categoryDefinitionId":{"type":["null","string"]},"categoryDefinitionCode":{"type":["null","string"]},"categoryDefinitionName":{"type":["null","string"]},"categoryNature":{"type":["null","string"],"enum":["INFLOW","OUTFLOW","UNDEFINED","OTHER",null]},"globalMappingId":{"type":["null","string"]},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},{"type":"object","additionalProperties":false,"required":["valid","accepted","processingMode","checks"],"properties":{"valid":{"type":"boolean"},"accepted":{"type":"boolean"},"processingMode":{"type":"string","enum":["VALIDATE_ONLY"]},"checks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","status","message"],"properties":{"code":{"type":"string"},"status":{"type":"string","enum":["PASSED"]},"message":{"type":"string"}}}}}}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/category-nodes/bulk":{"post":{"summary":"Create category nodes in bulk","tags":["Integration - Categories"],"description":"Validates or creates many category hierarchy nodes in one all-or-nothing setup request. Requires full_access. Run hierarchy and definition setup first, then create branch nodes before dependent leaf nodes.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs contract, reference, and duplicate validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting setup rows. Silent overwrite/upsert is intentionally not supported for category setup endpoints."},"requestReference":{"type":["string","null"],"maxLength":255,"description":"Caller setup-batch reference echoed in the response for audit and troubleshooting."},"rows":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["clientRef","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200,"description":"Caller-supplied stable reference echoed in row results and idMap."},"data":{"type":"object","additionalProperties":false,"required":["hierarchyId","nodeType","name"],"properties":{"hierarchyId":{"type":"string"},"parentId":{"type":["string","null"]},"nodeType":{"type":"string","enum":["BRANCH","LEAF"]},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"sortOrder":{"type":"integer"},"categoryDefinitionId":{"type":["string","null"],"description":"Required for LEAF nodes. Omit for BRANCH grouping nodes."},"isActive":{"type":"boolean"}}}}}}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["processingMode","requestReference","summary","rows","idMap"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":["null","string"]},"summary":{"type":"object","additionalProperties":false,"required":["received","valid","blocked","created"],"properties":{"received":{"type":"integer"},"valid":{"type":"integer"},"blocked":{"type":"integer"},"created":{"type":"integer"}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","clientRef","status","id","errors","warnings"],"properties":{"index":{"type":"integer"},"clientRef":{"type":"string"},"status":{"type":"string","enum":["VALID","BLOCKED","CREATED"]},"id":{"type":["null","string"]},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}},"idMap":{"type":"object","additionalProperties":{"type":"string"},"description":"Maps clientRef to created record id for AUTO requests."}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/category-nodes/{id}":{"get":{"summary":"Get a category node","tags":["Integration - Categories"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","hierarchyId","nodeType","name","sortOrder","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"hierarchyId":{"type":"string"},"parentId":{"type":["null","string"]},"parentName":{"type":["null","string"]},"nodeType":{"type":"string"},"name":{"type":"string"},"description":{"type":["null","string"]},"sortOrder":{"type":"integer"},"categoryDefinitionId":{"type":["null","string"]},"categoryDefinitionCode":{"type":["null","string"]},"categoryDefinitionName":{"type":["null","string"]},"categoryNature":{"type":["null","string"],"enum":["INFLOW","OUTFLOW","UNDEFINED","OTHER",null]},"globalMappingId":{"type":["null","string"]},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Update a category node","tags":["Integration - Categories"],"description":"Updates mutable category node setup fields. Requires full_access. Use VALIDATE_ONLY to dry-run without writes.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs contract, reference, and duplicate validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting setup rows. Silent overwrite/upsert is intentionally not supported for category setup endpoints."},"parentId":{"type":["string","null"]},"nodeType":{"type":"string","enum":["BRANCH","LEAF"]},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"sortOrder":{"type":"integer"},"categoryDefinitionId":{"type":["string","null"],"description":"Required for LEAF nodes. Omit for BRANCH grouping nodes."},"isActive":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"oneOf":[{"type":"object","additionalProperties":true,"required":["id","orgId","hierarchyId","nodeType","name","sortOrder","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"hierarchyId":{"type":"string"},"parentId":{"type":["null","string"]},"parentName":{"type":["null","string"]},"nodeType":{"type":"string"},"name":{"type":"string"},"description":{"type":["null","string"]},"sortOrder":{"type":"integer"},"categoryDefinitionId":{"type":["null","string"]},"categoryDefinitionCode":{"type":["null","string"]},"categoryDefinitionName":{"type":["null","string"]},"categoryNature":{"type":["null","string"],"enum":["INFLOW","OUTFLOW","UNDEFINED","OTHER",null]},"globalMappingId":{"type":["null","string"]},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},{"type":"object","additionalProperties":false,"required":["valid","accepted","processingMode","checks"],"properties":{"valid":{"type":"boolean"},"accepted":{"type":"boolean"},"processingMode":{"type":"string","enum":["VALIDATE_ONLY"]},"checks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","status","message"],"properties":{"code":{"type":"string"},"status":{"type":"string","enum":["PASSED"]},"message":{"type":"string"}}}}}}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/classification-dimensions":{"get":{"summary":"List classification types","tags":["Integration - Classifications"],"description":"Returns reusable classification dimensions such as bank-code tables. Requires any integration API scope.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":["boolean","string"]},"in":"query","name":"isActive","required":false},{"schema":{"type":"string","enum":["code","name","sortOrder","createdAt","updatedAt"]},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string","enum":["asc","desc"]},"in":"query","name":"sortDir","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","code","name","assignmentMode","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"description":{"type":["null","string"]},"assignmentMode":{"type":"string","enum":["SINGLE","MULTI"]},"isSystem":{"type":"boolean"},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadataJson":{"type":["null","object"],"additionalProperties":true},"createdByUserId":{"type":["null","string"]},"valueCount":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Create a classification type","tags":["Integration - Classifications"],"description":"Creates a reusable classification dimension for bank codes, movement codes, or other source-owned classifications. Requires full_access.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["code","name"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"Single-record setup endpoints use BLOCK so duplicates are explicit instead of silently overwritten."},"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"assignmentMode":{"type":["string","null"],"enum":["SINGLE","MULTI",null]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadata":{"type":["null","object"],"additionalProperties":true}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"oneOf":[{"type":"object","additionalProperties":true,"required":["id","orgId","code","name","assignmentMode","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"description":{"type":["null","string"]},"assignmentMode":{"type":"string","enum":["SINGLE","MULTI"]},"isSystem":{"type":"boolean"},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadataJson":{"type":["null","object"],"additionalProperties":true},"createdByUserId":{"type":["null","string"]},"valueCount":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},{"type":"object","additionalProperties":false,"required":["valid","accepted","processingMode","checks"],"properties":{"valid":{"type":"boolean"},"accepted":{"type":"boolean"},"processingMode":{"type":"string","enum":["VALIDATE_ONLY"]},"checks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","status","message"],"properties":{"code":{"type":"string"},"status":{"type":"string","enum":["PASSED"]},"message":{"type":"string"}}}}}}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/classification-dimensions/bulk":{"post":{"summary":"Create classification types in bulk","tags":["Integration - Classifications"],"description":"Validates or creates many classification dimensions in one setup request. Requires full_access.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"Single-record setup endpoints use BLOCK so duplicates are explicit instead of silently overwritten."},"requestReference":{"type":["string","null"],"maxLength":255},"rows":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["clientRef","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200,"description":"Caller-supplied stable reference echoed in row results and idMap."},"data":{"type":"object","additionalProperties":false,"required":["code","name"],"properties":{"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"assignmentMode":{"type":["string","null"],"enum":["SINGLE","MULTI",null]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadata":{"type":["null","object"],"additionalProperties":true}}}}}}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["processingMode","requestReference","summary","rows","idMap"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":["null","string"]},"summary":{"type":"object","additionalProperties":false,"required":["received","valid","blocked","created"],"properties":{"received":{"type":"integer"},"valid":{"type":"integer"},"blocked":{"type":"integer"},"created":{"type":"integer"}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","clientRef","status","id","errors","warnings"],"properties":{"index":{"type":"integer"},"clientRef":{"type":"string"},"status":{"type":"string","enum":["VALID","BLOCKED","CREATED"]},"id":{"type":["null","string"]},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}},"idMap":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/classification-dimensions/{id}":{"get":{"summary":"Get a classification type","tags":["Integration - Classifications"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","code","name","assignmentMode","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"description":{"type":["null","string"]},"assignmentMode":{"type":"string","enum":["SINGLE","MULTI"]},"isSystem":{"type":"boolean"},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadataJson":{"type":["null","object"],"additionalProperties":true},"createdByUserId":{"type":["null","string"]},"valueCount":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Update a classification type","tags":["Integration - Classifications"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"Single-record setup endpoints use BLOCK so duplicates are explicit instead of silently overwritten."},"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"assignmentMode":{"type":["string","null"],"enum":["SINGLE","MULTI",null]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadata":{"type":["null","object"],"additionalProperties":true}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"oneOf":[{"type":"object","additionalProperties":true,"required":["id","orgId","code","name","assignmentMode","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"description":{"type":["null","string"]},"assignmentMode":{"type":"string","enum":["SINGLE","MULTI"]},"isSystem":{"type":"boolean"},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadataJson":{"type":["null","object"],"additionalProperties":true},"createdByUserId":{"type":["null","string"]},"valueCount":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},{"type":"object","additionalProperties":false,"required":["valid","accepted","processingMode","checks"],"properties":{"valid":{"type":"boolean"},"accepted":{"type":"boolean"},"processingMode":{"type":"string","enum":["VALIDATE_ONLY"]},"checks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","status","message"],"properties":{"code":{"type":"string"},"status":{"type":"string","enum":["PASSED"]},"message":{"type":"string"}}}}}}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a classification type","tags":["Integration - Classifications"],"description":"Soft-deletes the classification type when it is not in use. Requires full_access.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","deleted"],"properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/classification-values":{"get":{"summary":"List classification values","tags":["Integration - Classifications"],"description":"Returns values for one classification type. Pass either dimensionId or dimensionCode.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string"},"in":"query","name":"dimensionId","required":false},{"schema":{"type":"string"},"in":"query","name":"dimensionCode","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":["boolean","string"]},"in":"query","name":"isActive","required":false},{"schema":{"type":"string","enum":["code","name","sortOrder","createdAt","updatedAt"]},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string","enum":["asc","desc"]},"in":"query","name":"sortDir","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","dimensionId","code","name","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"dimensionId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"description":{"type":["null","string"]},"defaultCategoryDefinitionId":{"type":["null","string"]},"defaultCategoryDefinitionCode":{"type":["null","string"]},"defaultCategoryDefinitionName":{"type":["null","string"]},"defaultCategoryNodeId":{"type":["null","string"]},"defaultCategoryNodeName":{"type":["null","string"]},"isSystem":{"type":"boolean"},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadataJson":{"type":["null","object"],"additionalProperties":true},"createdByUserId":{"type":["null","string"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Create a classification value","tags":["Integration - Classifications"],"description":"Creates one value inside a classification type. Pass dimensionId or dimensionCode. Requires full_access.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["code","name"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"Single-record setup endpoints use BLOCK so duplicates are explicit instead of silently overwritten."},"dimensionId":{"type":["string","null"]},"dimensionCode":{"type":["string","null"]},"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"defaultCategoryDefinitionId":{"type":["string","null"]},"defaultCategoryNodeId":{"type":["string","null"]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadata":{"type":["null","object"],"additionalProperties":true}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"oneOf":[{"type":"object","additionalProperties":true,"required":["id","orgId","dimensionId","code","name","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"dimensionId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"description":{"type":["null","string"]},"defaultCategoryDefinitionId":{"type":["null","string"]},"defaultCategoryDefinitionCode":{"type":["null","string"]},"defaultCategoryDefinitionName":{"type":["null","string"]},"defaultCategoryNodeId":{"type":["null","string"]},"defaultCategoryNodeName":{"type":["null","string"]},"isSystem":{"type":"boolean"},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadataJson":{"type":["null","object"],"additionalProperties":true},"createdByUserId":{"type":["null","string"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},{"type":"object","additionalProperties":false,"required":["valid","accepted","processingMode","checks"],"properties":{"valid":{"type":"boolean"},"accepted":{"type":"boolean"},"processingMode":{"type":"string","enum":["VALIDATE_ONLY"]},"checks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","status","message"],"properties":{"code":{"type":"string"},"status":{"type":"string","enum":["PASSED"]},"message":{"type":"string"}}}}}}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/classification-values/bulk":{"post":{"summary":"Import classification values in bulk","tags":["Integration - Classifications"],"description":"Validates or imports classification values for one classification type. Supports BLOCK, SKIP, and OVERWRITE so file/API setup can load bank-code lists safely. Requires full_access.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"VALIDATE_ONLY validates the list without writes. AUTO writes non-blocked rows."},"conflictPolicy":{"type":"string","enum":["BLOCK","SKIP","OVERWRITE"],"default":"BLOCK","description":"BLOCK rejects existing codes, SKIP keeps existing codes, OVERWRITE updates existing codes."},"requestReference":{"type":["string","null"],"maxLength":255},"dimensionId":{"type":["string","null"]},"dimensionCode":{"type":["string","null"]},"rows":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"object","additionalProperties":false,"required":["clientRef","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200,"description":"Caller-supplied stable reference echoed in row results and idMap."},"data":{"type":"object","additionalProperties":false,"required":["code","name"],"properties":{"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"defaultCategoryDefinitionId":{"type":["string","null"]},"defaultCategoryNodeId":{"type":["string","null"]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadata":{"type":["null","object"],"additionalProperties":true}}}}}}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["processingMode","requestReference","summary","rows","idMap"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":["null","string"]},"summary":{"type":"object","additionalProperties":false,"required":["received","valid","blocked","created","updated","skipped","wouldCreate","wouldUpdate"],"properties":{"received":{"type":"integer"},"valid":{"type":"integer"},"blocked":{"type":"integer"},"created":{"type":"integer"},"updated":{"type":"integer"},"skipped":{"type":"integer"},"wouldCreate":{"type":"integer"},"wouldUpdate":{"type":"integer"}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","clientRef","status","id","errors","warnings"],"properties":{"index":{"type":"integer"},"clientRef":{"type":"string"},"status":{"type":"string","enum":["VALID","BLOCKED","CREATED","UPDATED","SKIPPED"]},"id":{"type":["null","string"]},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}},"idMap":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/classification-values/{id}":{"get":{"summary":"Get a classification value","tags":["Integration - Classifications"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","dimensionId","code","name","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"dimensionId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"description":{"type":["null","string"]},"defaultCategoryDefinitionId":{"type":["null","string"]},"defaultCategoryDefinitionCode":{"type":["null","string"]},"defaultCategoryDefinitionName":{"type":["null","string"]},"defaultCategoryNodeId":{"type":["null","string"]},"defaultCategoryNodeName":{"type":["null","string"]},"isSystem":{"type":"boolean"},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadataJson":{"type":["null","object"],"additionalProperties":true},"createdByUserId":{"type":["null","string"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Update a classification value","tags":["Integration - Classifications"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"Single-record setup endpoints use BLOCK so duplicates are explicit instead of silently overwritten."},"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"defaultCategoryDefinitionId":{"type":["string","null"]},"defaultCategoryNodeId":{"type":["string","null"]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadata":{"type":["null","object"],"additionalProperties":true}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"oneOf":[{"type":"object","additionalProperties":true,"required":["id","orgId","dimensionId","code","name","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"dimensionId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"description":{"type":["null","string"]},"defaultCategoryDefinitionId":{"type":["null","string"]},"defaultCategoryDefinitionCode":{"type":["null","string"]},"defaultCategoryDefinitionName":{"type":["null","string"]},"defaultCategoryNodeId":{"type":["null","string"]},"defaultCategoryNodeName":{"type":["null","string"]},"isSystem":{"type":"boolean"},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadataJson":{"type":["null","object"],"additionalProperties":true},"createdByUserId":{"type":["null","string"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},{"type":"object","additionalProperties":false,"required":["valid","accepted","processingMode","checks"],"properties":{"valid":{"type":"boolean"},"accepted":{"type":"boolean"},"processingMode":{"type":"string","enum":["VALIDATE_ONLY"]},"checks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","status","message"],"properties":{"code":{"type":"string"},"status":{"type":"string","enum":["PASSED"]},"message":{"type":"string"}}}}}}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a classification value","tags":["Integration - Classifications"],"description":"Soft-deletes the value when it has not been assigned to source rows. Requires full_access.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","deleted"],"properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/bank-account-classification-profiles":{"get":{"summary":"List bank account classification assignments","tags":["Integration - Classifications"],"description":"Returns which classification type is used for each bank account and source field, such as transaction_type bank-code mappings.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string"},"in":"query","name":"entityId","required":false},{"schema":{"type":"string"},"in":"query","name":"bankAccountId","required":false},{"schema":{"type":"string"},"in":"query","name":"accountCode","required":false},{"schema":{"type":"string"},"in":"query","name":"accountNumber","required":false},{"schema":{"type":"string"},"in":"query","name":"statementAccountNumber","required":false},{"schema":{"type":"string"},"in":"query","name":"classificationRole","required":false},{"schema":{"type":["boolean","string"]},"in":"query","name":"isActive","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string","enum":["bankAccountName","dimensionCode","classificationRole","sortOrder","updatedAt"]},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string","enum":["asc","desc"]},"in":"query","name":"sortDir","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","bankAccountId","dimensionId","classificationRole","sourceField","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"bankAccountId":{"type":"string"},"bankAccountCode":{"type":["null","string"]},"bankAccountName":{"type":"string"},"bankAccountNumberMask":{"type":["null","string"]},"entityId":{"type":"string"},"entityName":{"type":"string"},"classificationRole":{"type":"string"},"dimensionId":{"type":"string"},"dimensionCode":{"type":"string"},"dimensionName":{"type":"string"},"sourceField":{"type":"string"},"rawPayloadPath":{"type":["null","string"]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadataJson":{"type":["null","object"],"additionalProperties":true},"createdByUserId":{"type":["null","string"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Create a bank account classification assignment","tags":["Integration - Classifications"],"description":"Assigns a classification type to a bank account and source field. The account can be resolved by bankAccountId, accountCode, statementAccountNumber, or accountNumber. Requires full_access.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"Single-record setup endpoints use BLOCK so duplicates are explicit instead of silently overwritten."},"bankAccountId":{"type":["string","null"]},"accountCode":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"statementAccountNumber":{"type":["string","null"]},"dimensionId":{"type":["string","null"]},"dimensionCode":{"type":["string","null"]},"classificationRole":{"type":["string","null"],"enum":["BANK_CODE","PAYMENT_METHOD","PAYMENT_RAIL","MOVEMENT_FAMILY","CUSTOM",null]},"sourceField":{"type":["string","null"],"enum":["transaction_type","bank_code","external_id","bank_ref_number","customer_ref_number","raw_payload",null]},"rawPayloadPath":{"type":["string","null"]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadata":{"type":["null","object"],"additionalProperties":true}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"oneOf":[{"type":"object","additionalProperties":true,"required":["id","orgId","bankAccountId","dimensionId","classificationRole","sourceField","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"bankAccountId":{"type":"string"},"bankAccountCode":{"type":["null","string"]},"bankAccountName":{"type":"string"},"bankAccountNumberMask":{"type":["null","string"]},"entityId":{"type":"string"},"entityName":{"type":"string"},"classificationRole":{"type":"string"},"dimensionId":{"type":"string"},"dimensionCode":{"type":"string"},"dimensionName":{"type":"string"},"sourceField":{"type":"string"},"rawPayloadPath":{"type":["null","string"]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadataJson":{"type":["null","object"],"additionalProperties":true},"createdByUserId":{"type":["null","string"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},{"type":"object","additionalProperties":false,"required":["valid","accepted","processingMode","checks"],"properties":{"valid":{"type":"boolean"},"accepted":{"type":"boolean"},"processingMode":{"type":"string","enum":["VALIDATE_ONLY"]},"checks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","status","message"],"properties":{"code":{"type":"string"},"status":{"type":"string","enum":["PASSED"]},"message":{"type":"string"}}}}}}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/bank-account-classification-profiles/bulk":{"post":{"summary":"Create bank account classification assignments in bulk","tags":["Integration - Classifications"],"description":"Validates or creates many bank-account-to-classification assignments. Requires full_access.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"Single-record setup endpoints use BLOCK so duplicates are explicit instead of silently overwritten."},"requestReference":{"type":["string","null"],"maxLength":255},"rows":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["clientRef","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200,"description":"Caller-supplied stable reference echoed in row results and idMap."},"data":{"type":"object","additionalProperties":false,"properties":{"bankAccountId":{"type":["string","null"]},"accountCode":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"statementAccountNumber":{"type":["string","null"]},"dimensionId":{"type":["string","null"]},"dimensionCode":{"type":["string","null"]},"classificationRole":{"type":["string","null"],"enum":["BANK_CODE","PAYMENT_METHOD","PAYMENT_RAIL","MOVEMENT_FAMILY","CUSTOM",null]},"sourceField":{"type":["string","null"],"enum":["transaction_type","bank_code","external_id","bank_ref_number","customer_ref_number","raw_payload",null]},"rawPayloadPath":{"type":["string","null"]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadata":{"type":["null","object"],"additionalProperties":true}}}}}}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["processingMode","requestReference","summary","rows","idMap"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":["null","string"]},"summary":{"type":"object","additionalProperties":false,"required":["received","valid","blocked","created"],"properties":{"received":{"type":"integer"},"valid":{"type":"integer"},"blocked":{"type":"integer"},"created":{"type":"integer"}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","clientRef","status","id","errors","warnings"],"properties":{"index":{"type":"integer"},"clientRef":{"type":"string"},"status":{"type":"string","enum":["VALID","BLOCKED","CREATED"]},"id":{"type":["null","string"]},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}},"idMap":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/bank-account-classification-profiles/{id}":{"get":{"summary":"Get a bank account classification assignment","tags":["Integration - Classifications"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","bankAccountId","dimensionId","classificationRole","sourceField","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"bankAccountId":{"type":"string"},"bankAccountCode":{"type":["null","string"]},"bankAccountName":{"type":"string"},"bankAccountNumberMask":{"type":["null","string"]},"entityId":{"type":"string"},"entityName":{"type":"string"},"classificationRole":{"type":"string"},"dimensionId":{"type":"string"},"dimensionCode":{"type":"string"},"dimensionName":{"type":"string"},"sourceField":{"type":"string"},"rawPayloadPath":{"type":["null","string"]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadataJson":{"type":["null","object"],"additionalProperties":true},"createdByUserId":{"type":["null","string"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Update a bank account classification assignment","tags":["Integration - Classifications"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid setup data. VALIDATE_ONLY performs validation without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"Single-record setup endpoints use BLOCK so duplicates are explicit instead of silently overwritten."},"bankAccountId":{"type":["string","null"]},"accountCode":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"statementAccountNumber":{"type":["string","null"]},"dimensionId":{"type":["string","null"]},"dimensionCode":{"type":["string","null"]},"classificationRole":{"type":["string","null"],"enum":["BANK_CODE","PAYMENT_METHOD","PAYMENT_RAIL","MOVEMENT_FAMILY","CUSTOM",null]},"sourceField":{"type":["string","null"],"enum":["transaction_type","bank_code","external_id","bank_ref_number","customer_ref_number","raw_payload",null]},"rawPayloadPath":{"type":["string","null"]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadata":{"type":["null","object"],"additionalProperties":true}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"oneOf":[{"type":"object","additionalProperties":true,"required":["id","orgId","bankAccountId","dimensionId","classificationRole","sourceField","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"bankAccountId":{"type":"string"},"bankAccountCode":{"type":["null","string"]},"bankAccountName":{"type":"string"},"bankAccountNumberMask":{"type":["null","string"]},"entityId":{"type":"string"},"entityName":{"type":"string"},"classificationRole":{"type":"string"},"dimensionId":{"type":"string"},"dimensionCode":{"type":"string"},"dimensionName":{"type":"string"},"sourceField":{"type":"string"},"rawPayloadPath":{"type":["null","string"]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"},"metadataJson":{"type":["null","object"],"additionalProperties":true},"createdByUserId":{"type":["null","string"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},{"type":"object","additionalProperties":false,"required":["valid","accepted","processingMode","checks"],"properties":{"valid":{"type":"boolean"},"accepted":{"type":"boolean"},"processingMode":{"type":"string","enum":["VALIDATE_ONLY"]},"checks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","status","message"],"properties":{"code":{"type":"string"},"status":{"type":"string","enum":["PASSED"]},"message":{"type":"string"}}}}}}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a bank account classification assignment","tags":["Integration - Classifications"],"description":"Soft-deletes the bank account classification profile. Requires full_access.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","deleted"],"properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/merchant-accounts":{"get":{"summary":"List merchant processor accounts","tags":["Integration - Merchant Settlements"],"description":"Stores merchant processor settlement and payout evidence for credit-card/POS reconciliation. It does not move money, submit payments, post accounting, or apply open-item settlements by itself. Lines may link to current AP/AR open items, historical open-item snapshots, ERP documents, bank transactions, bank auxiliary rows, or unresolved external references. Requires read access.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"entityId","required":false},{"schema":{"type":"string","enum":["STRIPE","ADYEN","PAYPAL","FIRST_DATA","GENERIC_CSV","OTHER"]},"in":"query","name":"providerCode","required":false},{"schema":{"type":"string","enum":["ACTIVE","INACTIVE","DISCONNECTED","NEEDS_ATTENTION"]},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["items","nextPageToken","total"],"properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}},"nextPageToken":{"type":["null","string"]},"total":{"type":"integer"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"post":{"summary":"Create a merchant processor account","tags":["Integration - Merchant Settlements"],"description":"Stores merchant processor settlement and payout evidence for credit-card/POS reconciliation. It does not move money, submit payments, post accounting, or apply open-item settlements by itself. Lines may link to current AP/AR open items, historical open-item snapshots, ERP documents, bank transactions, bank auxiliary rows, or unresolved external references. Requires full_access or transactions.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["entityId","providerCode","merchantAccountRef","displayName"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid data. VALIDATE_ONLY validates references and duplicate policy without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate provider settlement, payout, merchant-account, or transaction references."},"entityId":{"type":"string","format":"uuid"},"providerCode":{"type":"string","enum":["STRIPE","ADYEN","PAYPAL","FIRST_DATA","GENERIC_CSV","OTHER"],"description":"MVP provider families are STRIPE, ADYEN, PAYPAL, and FIRST_DATA. GENERIC_CSV and OTHER support file/API intake before native connectors exist."},"providerName":{"type":["string","null"],"description":"Human-readable provider/acquirer name, for example Fiserv or First Data."},"merchantAccountRef":{"type":"string","description":"Processor merchant account id, MID, Stripe account id, or equivalent source key."},"displayName":{"type":"string"},"bankAccountId":{"type":["string","null"],"format":"uuid"},"accountCode":{"type":["string","null"],"description":"Bank account Account ID/code used when bankAccountId is not supplied."},"statementAccountNumber":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"status":{"type":["string","null"],"enum":["ACTIVE","INACTIVE","DISCONNECTED","NEEDS_ATTENTION",null]},"metadata":{"type":["object","null"],"additionalProperties":true}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["processingMode","record","preview"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"record":{"type":["null","object"],"additionalProperties":true},"preview":{"type":"object","additionalProperties":true}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}},"/integration/v1/merchant-accounts/{id}":{"patch":{"summary":"Update a merchant processor account","tags":["Integration - Merchant Settlements"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid data. VALIDATE_ONLY validates references and duplicate policy without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate provider settlement, payout, merchant-account, or transaction references."},"providerName":{"type":["string","null"]},"displayName":{"type":["string","null"]},"bankAccountId":{"type":["string","null"],"format":"uuid"},"accountCode":{"type":["string","null"]},"statementAccountNumber":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"status":{"type":["string","null"],"enum":["ACTIVE","INACTIVE","DISCONNECTED","NEEDS_ATTENTION",null]},"metadata":{"type":["object","null"],"additionalProperties":true}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["processingMode","record","preview"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"record":{"type":["null","object"],"additionalProperties":true},"preview":{"type":"object","additionalProperties":true}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"delete":{"summary":"Deactivate a merchant processor account","tags":["Integration - Merchant Settlements"],"description":"Soft-deletes the merchant account setup. Existing settlement evidence remains for audit.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["deleted","id"],"properties":{"deleted":{"type":"boolean"},"id":{"type":"string","format":"uuid"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}},"/integration/v1/merchant-settlement-batches":{"get":{"summary":"List merchant settlement batches","tags":["Integration - Merchant Settlements"],"description":"Stores merchant processor settlement and payout evidence for credit-card/POS reconciliation. It does not move money, submit payments, post accounting, or apply open-item settlements by itself. Lines may link to current AP/AR open items, historical open-item snapshots, ERP documents, bank transactions, bank auxiliary rows, or unresolved external references. These rows are evidence-only unless created through a governed materialization path. Use POST /integration/v1/merchant-settlement-intake for normalized source components and completed intake provenance required by Card accounting; batch creation alone does not make an output plan accounting-ready. Use these rows to reconcile processor payout totals to bank deposits.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"entityId","required":false},{"schema":{"type":"string","enum":["STRIPE","ADYEN","PAYPAL","FIRST_DATA","GENERIC_CSV","OTHER"]},"in":"query","name":"providerCode","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"merchantAccountId","required":false},{"schema":{"type":"string"},"in":"query","name":"settlementId","required":false},{"schema":{"type":"string"},"in":"query","name":"payoutId","required":false},{"schema":{"type":"string","enum":["RECEIVED","PROCESSING","READY_FOR_RECONCILIATION","PARTIALLY_MATCHED","MATCHED","IGNORED","ERROR"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"from","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"to","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["items","nextPageToken","total"],"properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}},"nextPageToken":{"type":["null","string"]},"total":{"type":"integer"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"post":{"summary":"Create a merchant settlement batch with optional detail lines","tags":["Integration - Merchant Settlements"],"description":"Stores merchant processor settlement and payout evidence for credit-card/POS reconciliation. It does not move money, submit payments, post accounting, or apply open-item settlements by itself. Lines may link to current AP/AR open items, historical open-item snapshots, ERP documents, bank transactions, bank auxiliary rows, or unresolved external references. This legacy writer is evidence-only: it does not establish governed materialization provenance or structured component evidence required by the Card accounting output plan. For governed normalized payouts, use POST /integration/v1/merchant-settlement-intake, including when there are no open items. VALIDATE_ONLY and AUTO success on this route do not certify accounting readiness; business-evidence enrichment cannot upgrade monetary provenance. The ERP-paid case is supported: a line can carry invoice/customer/provider references even when no current open item exists; Reconcilia stores an unresolved or historical link instead of rejecting the line.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["entityId","settlementDate"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid data. VALIDATE_ONLY validates references and duplicate policy without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate provider settlement, payout, merchant-account, or transaction references."},"entityId":{"type":"string","format":"uuid"},"merchantAccountId":{"type":["string","null"],"format":"uuid"},"providerCode":{"type":["string","null"],"enum":["STRIPE","ADYEN","PAYPAL","FIRST_DATA","GENERIC_CSV","OTHER",null],"description":"MVP provider families are STRIPE, ADYEN, PAYPAL, and FIRST_DATA. GENERIC_CSV and OTHER support file/API intake before native connectors exist."},"merchantAccountRef":{"type":["string","null"]},"bankAccountId":{"type":["string","null"],"format":"uuid"},"accountCode":{"type":["string","null"]},"statementAccountNumber":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"settlementId":{"type":["string","null"]},"payoutId":{"type":["string","null"]},"settlementDate":{"type":"string","format":"date"},"payoutDate":{"type":["string","null"],"format":"date"},"arrivalDate":{"type":["string","null"],"format":"date"},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"grossAmount":{"type":["number","string","null"]},"feeAmount":{"type":["number","string","null"]},"refundAmount":{"type":["number","string","null"]},"chargebackAmount":{"type":["number","string","null"]},"adjustmentAmount":{"type":["number","string","null"]},"reserveAmount":{"type":["number","string","null"]},"netAmount":{"type":["number","string","null"]},"status":{"type":["string","null"],"enum":["RECEIVED","PROCESSING","READY_FOR_RECONCILIATION","PARTIALLY_MATCHED","MATCHED","IGNORED","ERROR",null]},"externalSystem":{"type":["string","null"]},"externalId":{"type":["string","null"]},"sourceBatchId":{"type":["string","null"]},"rawPayload":{"type":["object","null"],"additionalProperties":true},"metadata":{"type":["object","null"],"additionalProperties":true},"lines":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["lineType","netAmount"],"properties":{"openItemLinkMode":{"type":["string","null"],"enum":["AUTO","EXPLICIT_ONLY","NONE",null],"description":"AUTO may resolve invoice references, EXPLICIT_ONLY uses explicit open-item identifiers, and NONE preserves invoice/customer text without creating an AP/AR candidate link."},"lineType":{"type":"string","enum":["CHARGE","PAYMENT","REFUND","DISPUTE","CHARGEBACK","FEE","TAX","ADJUSTMENT","RESERVE","PAYOUT","OTHER"]},"lineStatus":{"type":["string","null"],"enum":["UNMATCHED","CANDIDATE","MATCHED","NEEDS_REVIEW","IGNORED","REVERSED",null]},"transactionDate":{"type":["string","null"],"format":"date"},"payoutDate":{"type":["string","null"],"format":"date"},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"grossAmount":{"type":["number","string","null"]},"feeAmount":{"type":["number","string","null"]},"netAmount":{"type":["number","string"]},"providerTransactionId":{"type":["string","null"]},"providerBalanceTransactionId":{"type":["string","null"]},"providerChargeId":{"type":["string","null"]},"providerPaymentId":{"type":["string","null"]},"providerRefundId":{"type":["string","null"]},"providerDisputeId":{"type":["string","null"]},"authorizationCode":{"type":["string","null"]},"cardBrand":{"type":["string","null"]},"paymentMethod":{"type":["string","null"]},"sourceSystem":{"type":["string","null"],"maxLength":100},"sourceTransactionId":{"type":["string","null"],"maxLength":300},"storeRef":{"type":["string","null"],"maxLength":200},"locationRef":{"type":["string","null"],"maxLength":200},"departmentRef":{"type":["string","null"],"maxLength":200},"channel":{"type":["string","null"],"maxLength":100},"terminalRef":{"type":["string","null"],"maxLength":200},"registerRef":{"type":["string","null"],"maxLength":200},"posBatchRef":{"type":["string","null"],"maxLength":200},"shiftRef":{"type":["string","null"],"maxLength":200},"businessDate":{"type":["string","null"],"format":"date"},"receiptRef":{"type":["string","null"],"maxLength":300},"orderRef":{"type":["string","null"],"maxLength":300},"tenderRef":{"type":["string","null"],"maxLength":300},"merchantReference":{"type":["string","null"],"maxLength":300},"transactionOccurredAt":{"type":["string","null"],"format":"date-time","description":"Business/source transaction timestamp with an explicit UTC offset."},"sourceTimezone":{"type":["string","null"],"maxLength":100},"cardNetwork":{"type":["string","null"],"maxLength":100},"maskedCardLast4":{"type":["string","null"],"pattern":"^[0-9]{4}$","description":"Accountant-safe final four digits only. Never send PAN, CVV/CVC, PIN, or track data."},"providerCardFingerprint":{"type":["string","null"],"maxLength":300},"providerCardToken":{"type":["string","null"],"maxLength":300},"acquirerReferenceNumber":{"type":["string","null"],"maxLength":300},"networkTransactionId":{"type":["string","null"],"maxLength":300},"walletType":{"type":["string","null"],"maxLength":100},"cardPresent":{"type":["boolean","null"]},"originalProviderTransactionId":{"type":["string","null"],"maxLength":300,"description":"Original provider transaction for a refund, dispute, chargeback, or reversal."},"disputeReason":{"type":["string","null"],"maxLength":300},"disputeStage":{"type":["string","null"],"maxLength":100},"disputeStatus":{"type":["string","null"],"maxLength":100},"disputeResponseDueAt":{"type":["string","null"],"format":"date-time"},"disputeOutcome":{"type":["string","null"],"maxLength":100},"fieldProvenance":{"type":["object","null"],"additionalProperties":true,"description":"Field-keyed source provenance for normalized accountant-facing evidence."},"invoiceNumber":{"type":["string","null"],"description":"Invoice number from the processor or ERP. May resolve a current open item or a historical open-item snapshot."},"customerRef":{"type":["string","null"]},"description":{"type":["string","null"]},"counterpartyId":{"type":["string","null"],"format":"uuid"},"externalCounterpartyId":{"type":["string","null"]},"counterpartyExternalSystem":{"type":["string","null"]},"erpDocumentId":{"type":["string","null"],"format":"uuid"},"erpDocumentLineId":{"type":["string","null"],"format":"uuid"},"documentExternalSystem":{"type":["string","null"]},"externalDocumentId":{"type":["string","null"]},"docType":{"type":["string","null"]},"docNo":{"type":["string","null"]},"lineNo":{"type":["integer","null"],"minimum":1},"openItemType":{"type":["string","null"],"enum":["AP","AR",null]},"openItemId":{"type":["string","null"],"format":"uuid"},"externalOpenItemId":{"type":["string","null"]},"openItemSnapshotId":{"type":["string","null"],"format":"uuid"},"bankTransactionId":{"type":["string","null"],"format":"uuid"},"bankAuxiliaryEntryId":{"type":["string","null"],"format":"uuid"},"rawPayload":{"type":["object","null"],"additionalProperties":true},"metadata":{"type":["object","null"],"additionalProperties":true}}}}}},"example":{"processingMode":"VALIDATE_ONLY","entityId":"00000000-0000-0000-0000-000000000000","providerCode":"FIRST_DATA","merchantAccountRef":"MID-10001234","settlementId":"FD-SETTLE-2026-05-24","settlementDate":"2026-05-24","payoutDate":"2026-05-25","currency":"USD","grossAmount":"1050.00","feeAmount":"-31.50","netAmount":"1018.50","lines":[{"lineType":"CHARGE","transactionDate":"2026-05-24","grossAmount":"1050.00","feeAmount":"-31.50","netAmount":"1018.50","invoiceNumber":"AR-INV-10045","providerTransactionId":"FD-TXN-778899"}]}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["processingMode","record","preview"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"record":{"type":["null","object"],"additionalProperties":true},"preview":{"type":"object","additionalProperties":true}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}},"/integration/v1/merchant-settlement-intake":{"post":{"summary":"Atomically ingest AP/AR items, settlements, and merchant evidence","tags":["Integration - Merchant Settlements"],"description":"Stores merchant processor settlement and payout evidence for credit-card/POS reconciliation. It does not move money, submit payments, post accounting, or apply open-item settlements by itself. Lines may link to current AP/AR open items, historical open-item snapshots, ERP documents, bank transactions, bank auxiliary rows, or unresolved external references. This additive intake endpoint accepts source-owned AP/AR current state, optional existing open-item settlements, and processor/POS lines in one all-or-nothing request. A line that references openItemSettlementClientRef links to that existing settlement and never creates a duplicate proposal. An OPEN_ITEM_LINK row without an existing settlement remains evidence for a separately governed proposal. CLEARING_ONLY rows preserve anonymous/POS evidence and optional consolidation metadata without fabricating a counterparty or open item. For customer evidence, the candidate amount uses grossAmount when supplied; payout/bank evidence continues to use netAmount. VALIDATE_ONLY executes the same reference checks and rolls every write back. AUTO commits source rows, the requestReference claim, completed creation snapshot and audit together. Failed new attempts do not bind the reference; successful changed-body replays remain 409. Historical retained claims require review. AMOUNT deductions use negative normalizedSignedAmount, additions positive; EXPLICIT_ZERO requires supplied 0. Batch fee/refund/chargeback controls equal signed component totals. BASE evidence must be INFORMATIONAL. Legacy batch/line writers do not establish governed intake provenance.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["requestReference","merchantSettlement"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid data. VALIDATE_ONLY validates references and duplicate policy without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate provider settlement, payout, merchant-account, or transaction references."},"requestReference":{"type":"string","minLength":1,"maxLength":200,"description":"Stable caller reference used for traceability and idempotent replay."},"openItems":{"type":"array","maxItems":2000,"default":[],"items":{"type":"object","additionalProperties":false,"required":["clientRef","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200},"data":{"type":"object","additionalProperties":false,"required":["openItemType","entityId","invoiceNumber","invoiceDate","dueDate","originalAmount"],"properties":{"processingMode":{"type":["string","null"],"enum":["AUTO","VALIDATE_ONLY",null]},"conflictPolicy":{"type":["string","null"],"enum":["BLOCK",null]},"loadMode":{"type":["string","null"],"enum":["UPSERT_CURRENT","SNAPSHOT_CURRENT",null]},"openItemType":{"type":"string","enum":["AP","AR"]},"entityId":{"type":"string","format":"uuid"},"erpDocumentId":{"type":["string","null"],"format":"uuid"},"externalSystem":{"type":["string","null"]},"externalOpenItemId":{"type":["string","null"]},"documentExternalSystem":{"type":["string","null"]},"externalDocumentId":{"type":["string","null"]},"docType":{"type":["string","null"]},"docNo":{"type":["string","null"]},"counterpartyId":{"type":["string","null"],"format":"uuid"},"counterpartyExternalSystem":{"type":["string","null"]},"externalCounterpartyId":{"type":["string","null"]},"counterpartyExternalId":{"type":["string","null"]},"invoiceNumber":{"type":"string"},"invoiceDate":{"type":"string","format":"date"},"dueDate":{"type":"string","format":"date"},"originalAmount":{"type":["number","string"]},"openAmount":{"type":["number","string","null"]},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"currencyCode":{"type":["string","null"],"minLength":3,"maxLength":3},"expectedSettlementDate":{"type":["string","null"],"format":"date"},"asOfDate":{"type":["string","null"],"format":"date"},"sourceBatchId":{"type":["string","null"]},"status":{"type":["string","null"]},"source":{"type":["string","null"]},"metadata":{"type":["object","null"],"additionalProperties":true}}}}}},"openItemSettlements":{"type":"array","maxItems":2000,"default":[],"description":"Optional source-owned AP/AR settlement rows. Use openItemClientRef to settle an open item created in the same request.","items":{"type":"object","additionalProperties":false,"required":["clientRef","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200},"openItemClientRef":{"type":["string","null"],"maxLength":200},"data":{"type":"object","additionalProperties":false,"required":["entityId","openItemType","settlementSourceType","settlementDate","amount"],"properties":{"entityId":{"type":"string","format":"uuid"},"openItemType":{"type":"string","enum":["AP","AR"]},"openItemId":{"type":["string","null"],"format":"uuid"},"externalOpenItemId":{"type":["string","null"]},"invoiceNumber":{"type":["string","null"]},"erpDocumentId":{"type":["string","null"],"format":"uuid"},"documentExternalSystem":{"type":["string","null"]},"externalDocumentId":{"type":["string","null"]},"docType":{"type":["string","null"],"enum":["AP_INVOICE","AR_INVOICE",null]},"docNo":{"type":["string","null"]},"counterpartyId":{"type":["string","null"],"format":"uuid"},"counterpartyExternalSystem":{"type":["string","null"]},"externalCounterpartyId":{"type":["string","null"]},"counterpartyExternalId":{"type":["string","null"]},"settlementSourceType":{"type":"string","enum":["BANK_AUXILIARY","ERP_DOCUMENT","ERP_DOCUMENT_LINE","PAYMENT_JOURNAL_LINE","BANK_TRANSACTION","CASH_POSITION_ENTRY","MANUAL"]},"settlementSourceId":{"type":["string","null"],"format":"uuid"},"sourceErpDocumentId":{"type":["string","null"],"format":"uuid"},"sourceDocumentExternalSystem":{"type":["string","null"]},"sourceExternalSystem":{"type":["string","null"]},"sourceExternalDocumentId":{"type":["string","null"]},"sourceDocType":{"type":["string","null"]},"sourceDocNo":{"type":["string","null"]},"sourceErpDocumentLineId":{"type":["string","null"],"format":"uuid"},"sourceErpLineId":{"type":["string","null"],"format":"uuid"},"sourceLineNo":{"type":["integer","string","null"]},"bankAuxiliaryEntryId":{"type":["string","null"],"format":"uuid"},"bankAuxiliaryExternalSystem":{"type":["string","null"]},"bankAuxiliaryExternalId":{"type":["string","null"]},"settlementType":{"type":["string","null"],"enum":["PAYMENT","RECEIPT","CREDIT_NOTE","DEBIT_NOTE","ADJUSTMENT","REVERSAL","WRITE_OFF",null]},"settlementDate":{"type":"string","format":"date"},"amount":{"type":["number","string"]},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"currencyCode":{"type":["string","null"],"minLength":3,"maxLength":3},"status":{"type":["string","null"],"enum":["PROPOSED","APPLIED","REVERSED","CANCELLED",null],"default":"APPLIED"},"assertionType":{"type":["string","null"],"enum":["RELATIONSHIP","APPLICATION",null],"default":"RELATIONSHIP"},"linkSource":{"type":["string","null"],"enum":["ERP","MANUAL","IMPORT","INTEGRATION_API","RECONCILIA_MATCH","AI_REVIEW","SYSTEM",null]},"externalSystem":{"type":["string","null"]},"externalId":{"type":["string","null"]},"metadata":{"type":["object","null"],"additionalProperties":true}}}}}},"merchantSettlement":{"type":"object","additionalProperties":false,"required":["data","lines"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["entityId","settlementDate"],"properties":{"entityId":{"type":"string","format":"uuid"},"merchantAccountId":{"type":["string","null"],"format":"uuid"},"providerCode":{"type":["string","null"],"enum":["STRIPE","ADYEN","PAYPAL","FIRST_DATA","GENERIC_CSV","OTHER",null],"description":"MVP provider families are STRIPE, ADYEN, PAYPAL, and FIRST_DATA. GENERIC_CSV and OTHER support file/API intake before native connectors exist."},"merchantAccountRef":{"type":["string","null"]},"bankAccountId":{"type":["string","null"],"format":"uuid"},"accountCode":{"type":["string","null"]},"statementAccountNumber":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"settlementId":{"type":["string","null"]},"payoutId":{"type":["string","null"]},"settlementDate":{"type":"string","format":"date"},"payoutDate":{"type":["string","null"],"format":"date"},"arrivalDate":{"type":["string","null"],"format":"date"},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"grossAmount":{"type":["number","string","null"]},"feeAmount":{"type":["number","string","null"]},"refundAmount":{"type":["number","string","null"]},"chargebackAmount":{"type":["number","string","null"]},"adjustmentAmount":{"type":["number","string","null"]},"reserveAmount":{"type":["number","string","null"]},"netAmount":{"type":["number","string","null"]},"status":{"type":["string","null"],"enum":["RECEIVED","PROCESSING","READY_FOR_RECONCILIATION","PARTIALLY_MATCHED","MATCHED","IGNORED","ERROR",null]},"externalSystem":{"type":["string","null"]},"externalId":{"type":["string","null"]},"sourceBatchId":{"type":["string","null"]},"rawPayload":{"type":["object","null"],"additionalProperties":true},"metadata":{"type":["object","null"],"additionalProperties":true}}},"lines":{"type":"array","minItems":1,"maxItems":2000,"items":{"type":"object","additionalProperties":false,"required":["clientRef","handlingMode","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200},"handlingMode":{"type":"string","enum":["OPEN_ITEM_LINK","CLEARING_ONLY"],"description":"OPEN_ITEM_LINK stores a candidate AP/AR evidence link. CLEARING_ONLY preserves processor/POS evidence without creating a customer or open-item candidate."},"openItemClientRef":{"type":["string","null"],"maxLength":200},"openItemSettlementClientRef":{"type":["string","null"],"maxLength":200,"description":"Links this merchant line to a source-owned open-item settlement included in openItemSettlements. No new AP/AR proposal is created."},"sourcePartyKind":{"type":["string","null"],"enum":["CUSTOMER","POS","ANONYMOUS","OTHER",null]},"consolidationKey":{"type":["string","null"],"maxLength":200},"consolidationLabel":{"type":["string","null"],"maxLength":300},"components":{"type":["array","null"],"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["componentRef","componentCode","componentKind","valueState","payoutEffect"],"properties":{"componentRef":{"type":"string","minLength":1,"maxLength":300,"description":"Stable source component reference, unique within one merchant transaction."},"componentCode":{"type":"string","minLength":1,"maxLength":200,"description":"Stable source/business component code used by the separate component-to-COA registry."},"componentKind":{"type":"string","enum":["GROSS","FEE","TAX","REFUND","CHARGEBACK","ADJUSTMENT","RESERVE","FX","NET","OTHER"]},"normalizedSignedAmount":{"type":["number","string","null"],"description":"Signed normalized amount. Omit for MISSING; use zero only with EXPLICIT_ZERO. Multiple fee or tax components remain separate rows."},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"valueState":{"type":"string","enum":["VALUE","EXPLICIT_ZERO","MISSING","UNKNOWN"]},"payoutEffect":{"type":"string","enum":["INCLUDED_IN_GROSS","ADDS_TO_NET","DEDUCTS_FROM_NET","INFORMATIONAL","UNKNOWN"],"description":"Defines whether the component is included in gross, adds to net, deducts from net, is informational, or is unresolved."},"measureType":{"type":["string","null"],"enum":["AMOUNT","BASE",null],"default":"AMOUNT","description":"BASE is informational calculation evidence and cannot be posted as an amount."},"sourceField":{"type":["string","null"],"maxLength":500},"sourcePath":{"type":["string","null"],"maxLength":500},"providerSemantic":{"type":["string","null"],"maxLength":500},"reportingCategory":{"type":["string","null"],"maxLength":200},"taxMeaning":{"type":["string","null"],"maxLength":200},"jurisdiction":{"type":["string","null"],"maxLength":100},"required":{"type":["boolean","null"],"description":"Whether a missing value blocks accounting. Omitted MISSING components default to optional; supplied values default to required."}},"anyOf":[{"required":["sourceField"]},{"required":["sourcePath"]}]},"description":"Optional transaction-level monetary evidence. Keep every fee, tax, reserve, FX, adjustment, and other source field as a separate component; account aggregation is governed later by the component-to-COA mapping."},"data":{"type":"object","additionalProperties":false,"required":["lineType","netAmount"],"properties":{"openItemLinkMode":{"type":["string","null"],"enum":["AUTO","EXPLICIT_ONLY","NONE",null],"description":"AUTO may resolve invoice references, EXPLICIT_ONLY uses explicit open-item identifiers, and NONE preserves invoice/customer text without creating an AP/AR candidate link."},"lineType":{"type":"string","enum":["CHARGE","PAYMENT","REFUND","DISPUTE","CHARGEBACK","FEE","TAX","ADJUSTMENT","RESERVE","PAYOUT","OTHER"]},"lineStatus":{"type":["string","null"],"enum":["UNMATCHED","CANDIDATE","MATCHED","NEEDS_REVIEW","IGNORED","REVERSED",null]},"transactionDate":{"type":["string","null"],"format":"date"},"payoutDate":{"type":["string","null"],"format":"date"},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"grossAmount":{"type":["number","string","null"]},"feeAmount":{"type":["number","string","null"]},"netAmount":{"type":["number","string"]},"providerTransactionId":{"type":["string","null"]},"providerBalanceTransactionId":{"type":["string","null"]},"providerChargeId":{"type":["string","null"]},"providerPaymentId":{"type":["string","null"]},"providerRefundId":{"type":["string","null"]},"providerDisputeId":{"type":["string","null"]},"authorizationCode":{"type":["string","null"]},"cardBrand":{"type":["string","null"]},"paymentMethod":{"type":["string","null"]},"sourceSystem":{"type":["string","null"],"maxLength":100},"sourceTransactionId":{"type":["string","null"],"maxLength":300},"storeRef":{"type":["string","null"],"maxLength":200},"locationRef":{"type":["string","null"],"maxLength":200},"departmentRef":{"type":["string","null"],"maxLength":200},"channel":{"type":["string","null"],"maxLength":100},"terminalRef":{"type":["string","null"],"maxLength":200},"registerRef":{"type":["string","null"],"maxLength":200},"posBatchRef":{"type":["string","null"],"maxLength":200},"shiftRef":{"type":["string","null"],"maxLength":200},"businessDate":{"type":["string","null"],"format":"date"},"receiptRef":{"type":["string","null"],"maxLength":300},"orderRef":{"type":["string","null"],"maxLength":300},"tenderRef":{"type":["string","null"],"maxLength":300},"merchantReference":{"type":["string","null"],"maxLength":300},"transactionOccurredAt":{"type":["string","null"],"format":"date-time","description":"Business/source transaction timestamp with an explicit UTC offset."},"sourceTimezone":{"type":["string","null"],"maxLength":100},"cardNetwork":{"type":["string","null"],"maxLength":100},"maskedCardLast4":{"type":["string","null"],"pattern":"^[0-9]{4}$","description":"Accountant-safe final four digits only. Never send PAN, CVV/CVC, PIN, or track data."},"providerCardFingerprint":{"type":["string","null"],"maxLength":300},"providerCardToken":{"type":["string","null"],"maxLength":300},"acquirerReferenceNumber":{"type":["string","null"],"maxLength":300},"networkTransactionId":{"type":["string","null"],"maxLength":300},"walletType":{"type":["string","null"],"maxLength":100},"cardPresent":{"type":["boolean","null"]},"originalProviderTransactionId":{"type":["string","null"],"maxLength":300,"description":"Original provider transaction for a refund, dispute, chargeback, or reversal."},"disputeReason":{"type":["string","null"],"maxLength":300},"disputeStage":{"type":["string","null"],"maxLength":100},"disputeStatus":{"type":["string","null"],"maxLength":100},"disputeResponseDueAt":{"type":["string","null"],"format":"date-time"},"disputeOutcome":{"type":["string","null"],"maxLength":100},"fieldProvenance":{"type":["object","null"],"additionalProperties":true,"description":"Field-keyed source provenance for normalized accountant-facing evidence."},"invoiceNumber":{"type":["string","null"],"description":"Invoice number from the processor or ERP. May resolve a current open item or a historical open-item snapshot."},"customerRef":{"type":["string","null"]},"description":{"type":["string","null"]},"counterpartyId":{"type":["string","null"],"format":"uuid"},"externalCounterpartyId":{"type":["string","null"]},"counterpartyExternalSystem":{"type":["string","null"]},"erpDocumentId":{"type":["string","null"],"format":"uuid"},"erpDocumentLineId":{"type":["string","null"],"format":"uuid"},"documentExternalSystem":{"type":["string","null"]},"externalDocumentId":{"type":["string","null"]},"docType":{"type":["string","null"]},"docNo":{"type":["string","null"]},"lineNo":{"type":["integer","null"],"minimum":1},"openItemType":{"type":["string","null"],"enum":["AP","AR",null]},"openItemId":{"type":["string","null"],"format":"uuid"},"externalOpenItemId":{"type":["string","null"]},"openItemSnapshotId":{"type":["string","null"],"format":"uuid"},"bankTransactionId":{"type":["string","null"],"format":"uuid"},"bankAuxiliaryEntryId":{"type":["string","null"],"format":"uuid"},"rawPayload":{"type":["object","null"],"additionalProperties":true},"metadata":{"type":["object","null"],"additionalProperties":true}}}}}}}}}}}},"required":true},"parameters":[{"schema":{"type":"string","maxLength":200},"in":"header","name":"idempotency-key","required":false,"description":"Optional caller key. merchant-settlement-intake uses requestReference as its primary idempotency key."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["processingMode","requestReference","accepted","valid","record","preview","idMap","lifecycle"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":"string"},"accepted":{"type":"boolean"},"valid":{"type":"boolean"},"record":{"type":["null","object"],"additionalProperties":true},"preview":{"type":"object","additionalProperties":true},"idMap":{"type":"object","additionalProperties":true},"lifecycle":{"type":"object","additionalProperties":true},"idempotency":{"type":"object","additionalProperties":true}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}},"/integration/v1/merchant-settlement-intake/supersede":{"post":{"summary":"Replace one governed Merchant Settlement source batch before downstream use","tags":["Integration - Merchant Settlements"],"description":"Stores merchant processor settlement and payout evidence for credit-card/POS reconciliation. It does not move money, submit payments, post accounting, or apply open-item settlements by itself. Lines may link to current AP/AR open items, historical open-item snapshots, ERP documents, bank transactions, bank auxiliary rows, or unresolved external references. This correction command accepts the complete replacement settlement under a new requestReference distinct from the original. It verifies the original completed governed intake snapshot and preserves its rows, successful request claim and hashes as soft-retired history. AUTO atomically retires the original active batch, lines and source-only unresolved links, creates the corrected generation, and records immutable old-to-new lineage. The entity, provider connection, payout bank, currency and at least one business source identity must remain the same. Any Bank case, review, AP/AR application, POS/open-item link, treatment, action, generated ERP document, direct source reference or active job returns a typed 409; this route never reverses accounting or impersonates an app user. VALIDATE_ONLY executes the same checks and rolls every write back.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["requestReference","supersededBatchId","reason","merchantSettlement"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid data. VALIDATE_ONLY validates references and duplicate policy without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate provider settlement, payout, merchant-account, or transaction references."},"requestReference":{"type":"string","minLength":1,"maxLength":200,"description":"New immutable correction reference. The original successful reference is never reused or released."},"supersededBatchId":{"type":"string","format":"uuid"},"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Factual reason why the received source generation is being replaced."},"merchantSettlement":{"type":"object","additionalProperties":false,"required":["data","lines"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["entityId","settlementDate"],"properties":{"entityId":{"type":"string","format":"uuid"},"merchantAccountId":{"type":["string","null"],"format":"uuid"},"providerCode":{"type":["string","null"],"enum":["STRIPE","ADYEN","PAYPAL","FIRST_DATA","GENERIC_CSV","OTHER",null],"description":"MVP provider families are STRIPE, ADYEN, PAYPAL, and FIRST_DATA. GENERIC_CSV and OTHER support file/API intake before native connectors exist."},"merchantAccountRef":{"type":["string","null"]},"bankAccountId":{"type":["string","null"],"format":"uuid"},"accountCode":{"type":["string","null"]},"statementAccountNumber":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"settlementId":{"type":["string","null"]},"payoutId":{"type":["string","null"]},"settlementDate":{"type":"string","format":"date"},"payoutDate":{"type":["string","null"],"format":"date"},"arrivalDate":{"type":["string","null"],"format":"date"},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"grossAmount":{"type":["number","string","null"]},"feeAmount":{"type":["number","string","null"]},"refundAmount":{"type":["number","string","null"]},"chargebackAmount":{"type":["number","string","null"]},"adjustmentAmount":{"type":["number","string","null"]},"reserveAmount":{"type":["number","string","null"]},"netAmount":{"type":["number","string","null"]},"status":{"type":["string","null"],"enum":["RECEIVED","PROCESSING","READY_FOR_RECONCILIATION","PARTIALLY_MATCHED","MATCHED","IGNORED","ERROR",null]},"externalSystem":{"type":["string","null"]},"externalId":{"type":["string","null"]},"sourceBatchId":{"type":["string","null"]},"rawPayload":{"type":["object","null"],"additionalProperties":true},"metadata":{"type":["object","null"],"additionalProperties":true}}},"lines":{"type":"array","minItems":1,"maxItems":2000,"items":{"type":"object","additionalProperties":false,"required":["clientRef","handlingMode","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200},"handlingMode":{"type":"string","enum":["OPEN_ITEM_LINK","CLEARING_ONLY"],"description":"OPEN_ITEM_LINK stores a candidate AP/AR evidence link. CLEARING_ONLY preserves processor/POS evidence without creating a customer or open-item candidate."},"openItemClientRef":{"type":["string","null"],"maxLength":200},"openItemSettlementClientRef":{"type":["string","null"],"maxLength":200,"description":"Links this merchant line to a source-owned open-item settlement included in openItemSettlements. No new AP/AR proposal is created."},"sourcePartyKind":{"type":["string","null"],"enum":["CUSTOMER","POS","ANONYMOUS","OTHER",null]},"consolidationKey":{"type":["string","null"],"maxLength":200},"consolidationLabel":{"type":["string","null"],"maxLength":300},"components":{"type":["array","null"],"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["componentRef","componentCode","componentKind","valueState","payoutEffect"],"properties":{"componentRef":{"type":"string","minLength":1,"maxLength":300,"description":"Stable source component reference, unique within one merchant transaction."},"componentCode":{"type":"string","minLength":1,"maxLength":200,"description":"Stable source/business component code used by the separate component-to-COA registry."},"componentKind":{"type":"string","enum":["GROSS","FEE","TAX","REFUND","CHARGEBACK","ADJUSTMENT","RESERVE","FX","NET","OTHER"]},"normalizedSignedAmount":{"type":["number","string","null"],"description":"Signed normalized amount. Omit for MISSING; use zero only with EXPLICIT_ZERO. Multiple fee or tax components remain separate rows."},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"valueState":{"type":"string","enum":["VALUE","EXPLICIT_ZERO","MISSING","UNKNOWN"]},"payoutEffect":{"type":"string","enum":["INCLUDED_IN_GROSS","ADDS_TO_NET","DEDUCTS_FROM_NET","INFORMATIONAL","UNKNOWN"],"description":"Defines whether the component is included in gross, adds to net, deducts from net, is informational, or is unresolved."},"measureType":{"type":["string","null"],"enum":["AMOUNT","BASE",null],"default":"AMOUNT","description":"BASE is informational calculation evidence and cannot be posted as an amount."},"sourceField":{"type":["string","null"],"maxLength":500},"sourcePath":{"type":["string","null"],"maxLength":500},"providerSemantic":{"type":["string","null"],"maxLength":500},"reportingCategory":{"type":["string","null"],"maxLength":200},"taxMeaning":{"type":["string","null"],"maxLength":200},"jurisdiction":{"type":["string","null"],"maxLength":100},"required":{"type":["boolean","null"],"description":"Whether a missing value blocks accounting. Omitted MISSING components default to optional; supplied values default to required."}},"anyOf":[{"required":["sourceField"]},{"required":["sourcePath"]}]},"description":"Optional transaction-level monetary evidence. Keep every fee, tax, reserve, FX, adjustment, and other source field as a separate component; account aggregation is governed later by the component-to-COA mapping."},"data":{"type":"object","additionalProperties":false,"required":["lineType","netAmount"],"properties":{"openItemLinkMode":{"type":["string","null"],"enum":["AUTO","EXPLICIT_ONLY","NONE",null],"description":"AUTO may resolve invoice references, EXPLICIT_ONLY uses explicit open-item identifiers, and NONE preserves invoice/customer text without creating an AP/AR candidate link."},"lineType":{"type":"string","enum":["CHARGE","PAYMENT","REFUND","DISPUTE","CHARGEBACK","FEE","TAX","ADJUSTMENT","RESERVE","PAYOUT","OTHER"]},"lineStatus":{"type":["string","null"],"enum":["UNMATCHED","CANDIDATE","MATCHED","NEEDS_REVIEW","IGNORED","REVERSED",null]},"transactionDate":{"type":["string","null"],"format":"date"},"payoutDate":{"type":["string","null"],"format":"date"},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"grossAmount":{"type":["number","string","null"]},"feeAmount":{"type":["number","string","null"]},"netAmount":{"type":["number","string"]},"providerTransactionId":{"type":["string","null"]},"providerBalanceTransactionId":{"type":["string","null"]},"providerChargeId":{"type":["string","null"]},"providerPaymentId":{"type":["string","null"]},"providerRefundId":{"type":["string","null"]},"providerDisputeId":{"type":["string","null"]},"authorizationCode":{"type":["string","null"]},"cardBrand":{"type":["string","null"]},"paymentMethod":{"type":["string","null"]},"sourceSystem":{"type":["string","null"],"maxLength":100},"sourceTransactionId":{"type":["string","null"],"maxLength":300},"storeRef":{"type":["string","null"],"maxLength":200},"locationRef":{"type":["string","null"],"maxLength":200},"departmentRef":{"type":["string","null"],"maxLength":200},"channel":{"type":["string","null"],"maxLength":100},"terminalRef":{"type":["string","null"],"maxLength":200},"registerRef":{"type":["string","null"],"maxLength":200},"posBatchRef":{"type":["string","null"],"maxLength":200},"shiftRef":{"type":["string","null"],"maxLength":200},"businessDate":{"type":["string","null"],"format":"date"},"receiptRef":{"type":["string","null"],"maxLength":300},"orderRef":{"type":["string","null"],"maxLength":300},"tenderRef":{"type":["string","null"],"maxLength":300},"merchantReference":{"type":["string","null"],"maxLength":300},"transactionOccurredAt":{"type":["string","null"],"format":"date-time","description":"Business/source transaction timestamp with an explicit UTC offset."},"sourceTimezone":{"type":["string","null"],"maxLength":100},"cardNetwork":{"type":["string","null"],"maxLength":100},"maskedCardLast4":{"type":["string","null"],"pattern":"^[0-9]{4}$","description":"Accountant-safe final four digits only. Never send PAN, CVV/CVC, PIN, or track data."},"providerCardFingerprint":{"type":["string","null"],"maxLength":300},"providerCardToken":{"type":["string","null"],"maxLength":300},"acquirerReferenceNumber":{"type":["string","null"],"maxLength":300},"networkTransactionId":{"type":["string","null"],"maxLength":300},"walletType":{"type":["string","null"],"maxLength":100},"cardPresent":{"type":["boolean","null"]},"originalProviderTransactionId":{"type":["string","null"],"maxLength":300,"description":"Original provider transaction for a refund, dispute, chargeback, or reversal."},"disputeReason":{"type":["string","null"],"maxLength":300},"disputeStage":{"type":["string","null"],"maxLength":100},"disputeStatus":{"type":["string","null"],"maxLength":100},"disputeResponseDueAt":{"type":["string","null"],"format":"date-time"},"disputeOutcome":{"type":["string","null"],"maxLength":100},"fieldProvenance":{"type":["object","null"],"additionalProperties":true,"description":"Field-keyed source provenance for normalized accountant-facing evidence."},"invoiceNumber":{"type":["string","null"],"description":"Invoice number from the processor or ERP. May resolve a current open item or a historical open-item snapshot."},"customerRef":{"type":["string","null"]},"description":{"type":["string","null"]},"counterpartyId":{"type":["string","null"],"format":"uuid"},"externalCounterpartyId":{"type":["string","null"]},"counterpartyExternalSystem":{"type":["string","null"]},"erpDocumentId":{"type":["string","null"],"format":"uuid"},"erpDocumentLineId":{"type":["string","null"],"format":"uuid"},"documentExternalSystem":{"type":["string","null"]},"externalDocumentId":{"type":["string","null"]},"docType":{"type":["string","null"]},"docNo":{"type":["string","null"]},"lineNo":{"type":["integer","null"],"minimum":1},"openItemType":{"type":["string","null"],"enum":["AP","AR",null]},"openItemId":{"type":["string","null"],"format":"uuid"},"externalOpenItemId":{"type":["string","null"]},"openItemSnapshotId":{"type":["string","null"],"format":"uuid"},"bankTransactionId":{"type":["string","null"],"format":"uuid"},"bankAuxiliaryEntryId":{"type":["string","null"],"format":"uuid"},"rawPayload":{"type":["object","null"],"additionalProperties":true},"metadata":{"type":["object","null"],"additionalProperties":true}}}}}}}}}}}},"required":true},"parameters":[{"schema":{"type":"string","maxLength":200},"in":"header","name":"idempotency-key","required":false,"description":"Optional caller key. merchant-settlement-intake uses requestReference as its primary idempotency key."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["processingMode","requestReference","accepted","valid","record","preview","idMap","lifecycle","supersession"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":"string"},"accepted":{"type":"boolean"},"valid":{"type":"boolean"},"record":{"type":["null","object"],"additionalProperties":true},"preview":{"type":"object","additionalProperties":true},"idMap":{"type":"object","additionalProperties":true},"lifecycle":{"type":"object","additionalProperties":true},"idempotency":{"type":"object","additionalProperties":true},"supersession":{"type":"object","additionalProperties":true}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}},"/integration/v1/merchant-settlement-intake/supersessions/{batchId}":{"get":{"summary":"Read Merchant Settlement source-correction lineage","tags":["Integration - Merchant Settlements"],"description":"Returns the immutable predecessor/successor edges for one original or replacement batch. It exposes safe request references and SHA-256 hashes, never request bodies or credentials.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"batchId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}},"/integration/v1/pos-transactions":{"post":{"summary":"Record independent source-owned POS tender transactions","tags":["Integration - Merchant Settlements"],"description":"Stores immutable POS source facts even before Card lines arrive. Source identity is entity + sourceSystem + externalId, not terminal number. Identical records are replay-safe; conflicting evidence returns 409. Does not create Card lines, allocations, accounting, or money movement. Requires the separately provisioned POS schema.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["transactions"],"properties":{"transactions":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["entityId","sourceSystem","externalId","transactionType","businessDate","currencyCode","amount"],"properties":{"entityId":{"type":"string","format":"uuid"},"sourceSystem":{"type":"string","minLength":1,"maxLength":200},"externalId":{"type":"string","minLength":1,"maxLength":200},"transactionType":{"type":"string","enum":["SALE","REFUND"]},"businessDate":{"type":"string","format":"date"},"currencyCode":{"type":"string","pattern":"^[A-Z]{3}$"},"amount":{"type":"string","pattern":"^-?[0-9]{1,14}(\\.[0-9]{1,6})?$"},"storeRef":{"type":["string","null"],"maxLength":200},"locationRef":{"type":["string","null"],"maxLength":200},"terminalRef":{"type":["string","null"],"maxLength":200},"registerRef":{"type":["string","null"],"maxLength":200},"posBatchRef":{"type":["string","null"],"maxLength":200},"receiptRef":{"type":["string","null"],"maxLength":200},"tenderRef":{"type":["string","null"],"maxLength":200},"sourceStatus":{"type":["string","null"],"maxLength":200},"description":{"type":["string","null"],"maxLength":1000}}}}}}}},"required":true},"parameters":[{"schema":{"type":"string","maxLength":200},"in":"header","name":"idempotency-key","required":false,"description":"Optional caller key. merchant-settlement-intake uses requestReference as its primary idempotency key."}],"responses":{"200":{"description":"Default Response"}}}},"/integration/v1/merchant-settlement-lines/business-evidence":{"post":{"summary":"Enrich existing merchant lines with business and safe-card evidence","tags":["Integration - Merchant Settlements"],"description":"Stores merchant processor settlement and payout evidence for credit-card/POS reconciliation. It does not move money, submit payments, post accounting, or apply open-item settlements by itself. Lines may link to current AP/AR open items, historical open-item snapshots, ERP documents, bank transactions, bank auxiliary rows, or unresolved external references. This bounded, idempotent endpoint locates existing lines by tenant-scoped provider transaction identity and fills previously missing normalized POS, commerce, ERP, safe-card, original-transaction, or dispute evidence. Existing non-null evidence returns a conflict when the requested value differs. Processor monetary values and component evidence cannot be submitted or changed. The endpoint does not create accounting, Bank matches, AP/AR mutations, ERP postings, or money movement.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["requestReference","items"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid data. VALIDATE_ONLY validates references and duplicate policy without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate provider settlement, payout, merchant-account, or transaction references."},"requestReference":{"type":"string","minLength":1,"maxLength":200,"description":"Stable caller reference used for idempotent evidence enrichment."},"items":{"type":"array","minItems":1,"maxItems":2000,"items":{"type":"object","additionalProperties":false,"required":["clientRef","sourceSystem","selector","evidence"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200},"sourceSystem":{"type":"string","minLength":1,"maxLength":100},"sourceRecordId":{"type":["string","null"],"maxLength":300},"observedAt":{"type":["string","null"],"format":"date-time"},"selector":{"type":"object","additionalProperties":false,"required":["entityId","providerCode","providerTransactionId"],"properties":{"entityId":{"type":"string","format":"uuid"},"providerCode":{"type":"string","enum":["STRIPE","ADYEN","PAYPAL","FIRST_DATA","GENERIC_CSV","OTHER"]},"providerTransactionId":{"type":"string","minLength":1,"maxLength":300},"merchantAccountId":{"type":["string","null"],"format":"uuid"},"merchantAccountRef":{"type":["string","null"],"maxLength":300},"settlementId":{"type":["string","null"],"maxLength":300},"payoutId":{"type":["string","null"],"maxLength":300}}},"evidence":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"sourceTransactionId":{"type":["string","null"],"maxLength":300},"storeRef":{"type":["string","null"],"maxLength":200},"locationRef":{"type":["string","null"],"maxLength":200},"departmentRef":{"type":["string","null"],"maxLength":200},"channel":{"type":["string","null"],"maxLength":100},"terminalRef":{"type":["string","null"],"maxLength":200},"registerRef":{"type":["string","null"],"maxLength":200},"posBatchRef":{"type":["string","null"],"maxLength":200},"shiftRef":{"type":["string","null"],"maxLength":200},"businessDate":{"type":["string","null"],"format":"date"},"receiptRef":{"type":["string","null"],"maxLength":300},"orderRef":{"type":["string","null"],"maxLength":300},"tenderRef":{"type":["string","null"],"maxLength":300},"merchantReference":{"type":["string","null"],"maxLength":300},"transactionOccurredAt":{"type":["string","null"],"format":"date-time"},"sourceTimezone":{"type":["string","null"],"maxLength":100},"authorizationCode":{"type":["string","null"],"maxLength":300},"cardBrand":{"type":["string","null"],"maxLength":100},"paymentMethod":{"type":["string","null"],"maxLength":100},"cardNetwork":{"type":["string","null"],"maxLength":100},"maskedCardLast4":{"type":["string","null"],"pattern":"^[0-9]{4}$"},"providerCardFingerprint":{"type":["string","null"],"maxLength":300},"providerCardToken":{"type":["string","null"],"maxLength":300},"acquirerReferenceNumber":{"type":["string","null"],"maxLength":300},"networkTransactionId":{"type":["string","null"],"maxLength":300},"walletType":{"type":["string","null"],"maxLength":100},"cardPresent":{"type":["boolean","null"]},"originalProviderTransactionId":{"type":["string","null"],"maxLength":300},"disputeReason":{"type":["string","null"],"maxLength":300},"disputeStage":{"type":["string","null"],"maxLength":100},"disputeStatus":{"type":["string","null"],"maxLength":100},"disputeResponseDueAt":{"type":["string","null"],"format":"date-time"},"disputeOutcome":{"type":["string","null"],"maxLength":100},"customerRef":{"type":["string","null"],"maxLength":300},"invoiceNumber":{"type":["string","null"],"maxLength":300}}},"fieldSources":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"additionalProperties":false,"properties":{"sourceField":{"type":["string","null"],"maxLength":500},"sourcePath":{"type":["string","null"],"maxLength":500}}}}}}}}}}},"required":true},"parameters":[{"schema":{"type":"string","maxLength":200},"in":"header","name":"idempotency-key","required":false,"description":"Optional caller key. merchant-settlement-intake uses requestReference as its primary idempotency key."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["processingMode","requestReference","accepted","valid","summary","outcomes","lifecycle"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":"string"},"accepted":{"type":"boolean"},"valid":{"type":"boolean"},"summary":{"type":"object","additionalProperties":true},"outcomes":{"type":"array","items":{"type":"object","additionalProperties":true}},"lifecycle":{"type":"object","additionalProperties":true},"idempotency":{"type":"object","additionalProperties":true}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}},"/integration/v1/merchant-settlement-actions":{"get":{"summary":"List outbound Merchant Settlement actions","tags":["Integration - Merchant Settlements"],"description":"Stores merchant processor settlement and payout evidence for credit-card/POS reconciliation. It does not move money, submit payments, post accounting, or apply open-item settlements by itself. Lines may link to current AP/AR open items, historical open-item snapshots, ERP documents, bank transactions, bank auxiliary rows, or unresolved external references. Returns governed refund, dispute, chargeback, and reversal actions that Reconcilia has explicitly marked for an external system. The default filter is READY. Source monetary values, original-payment identity, normalized business evidence, safe masked-card evidence, owner/deadline, decision, and outbound state are read-only. This endpoint does not push a webhook, create an AP/AR item, post accounting, mutate Bank matching, contact a provider, or move money.","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"in":"query","name":"pageSize","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"entityId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"settlementBatchId","required":false},{"schema":{"type":"string","enum":["REFUND","DISPUTE","CHARGEBACK","REVERSAL"]},"in":"query","name":"actionType","required":false},{"schema":{"type":"string","enum":["ACTION_REQUIRED","ASSIGNED","IN_PROGRESS","RESOLVED","WAIVED"]},"in":"query","name":"actionState","required":false},{"schema":{"type":"string","enum":["READY","DELIVERED","ACKNOWLEDGED","FAILED","CANCELLED"],"default":"READY"},"in":"query","name":"outboundState","required":false},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"dueBefore","required":false},{"schema":{"type":"string","maxLength":200},"in":"query","name":"search","required":false},{"schema":{"type":"boolean","default":false},"in":"query","name":"includeHistory","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}},"/integration/v1/merchant-settlement-actions/{actionId}":{"get":{"summary":"Get one outbound Merchant Settlement action","tags":["Integration - Merchant Settlements"],"description":"Stores merchant processor settlement and payout evidence for credit-card/POS reconciliation. It does not move money, submit payments, post accounting, or apply open-item settlements by itself. Lines may link to current AP/AR open items, historical open-item snapshots, ERP documents, bank transactions, bank auxiliary rows, or unresolved external references. Returns one tenant-scoped action and immutable history so an ERP, POS, commerce, tax, or recovery system can process it idempotently. The response contains masked/safe card evidence only.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"actionId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}},"/integration/v1/merchant-settlement-actions/{actionId}/acknowledgements":{"post":{"summary":"Acknowledge an outbound Merchant Settlement action","tags":["Integration - Merchant Settlements"],"description":"Stores merchant processor settlement and payout evidence for credit-card/POS reconciliation. It does not move money, submit payments, post accounting, or apply open-item settlements by itself. Lines may link to current AP/AR open items, historical open-item snapshots, ERP documents, bank transactions, bank auxiliary rows, or unresolved external references. Records an idempotent delivered, acknowledged, or failed outcome for an action previously marked READY. requestReference is the replay key. A customer-recovery AR open-item identifier may be supplied only with ACKNOWLEDGED and must already exist authoritatively in this tenant. Reconcilia never fabricates the AR item, never applies it, never changes processor source amounts, never posts accounting, and never moves money.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["requestReference","status","externalSystem"],"properties":{"requestReference":{"type":"string","minLength":1,"maxLength":200},"status":{"type":"string","enum":["DELIVERED","ACKNOWLEDGED","FAILED"]},"externalSystem":{"type":"string","minLength":1,"maxLength":200},"externalReference":{"type":["string","null"],"maxLength":300},"recoveryOpenItemType":{"type":["string","null"],"enum":["AR",null],"description":"Only authoritative AR recovery is supported; AP is never inferred from a chargeback."},"recoveryOpenItemId":{"type":["string","null"],"format":"uuid"},"recoveryStatus":{"type":["string","null"],"maxLength":100},"message":{"type":["string","null"],"maxLength":2000}}}}},"required":true},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"actionId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}},"/integration/v1/merchant-settlement-lines":{"get":{"summary":"List merchant settlement detail lines","tags":["Integration - Merchant Settlements"],"description":"Stores merchant processor settlement and payout evidence for credit-card/POS reconciliation. It does not move money, submit payments, post accounting, or apply open-item settlements by itself. Lines may link to current AP/AR open items, historical open-item snapshots, ERP documents, bank transactions, bank auxiliary rows, or unresolved external references. Lines preserve processor-level gross, fee, net, invoice/customer references, and matching state.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"entityId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"batchId","required":false},{"schema":{"type":"string","enum":["STRIPE","ADYEN","PAYPAL","FIRST_DATA","GENERIC_CSV","OTHER"]},"in":"query","name":"providerCode","required":false},{"schema":{"type":"string","enum":["CHARGE","PAYMENT","REFUND","DISPUTE","CHARGEBACK","FEE","TAX","ADJUSTMENT","RESERVE","PAYOUT","OTHER"]},"in":"query","name":"lineType","required":false},{"schema":{"type":"string","enum":["UNMATCHED","CANDIDATE","MATCHED","NEEDS_REVIEW","IGNORED","REVERSED"]},"in":"query","name":"lineStatus","required":false},{"schema":{"type":"string"},"in":"query","name":"invoiceNumber","required":false},{"schema":{"type":"string"},"in":"query","name":"customerRef","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["items","nextPageToken","total"],"properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}},"nextPageToken":{"type":["null","string"]},"total":{"type":"integer"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"post":{"summary":"Create a merchant settlement detail line","tags":["Integration - Merchant Settlements"],"description":"Creates one evidence-only processor detail line under an existing merchant settlement batch. This legacy writer does not establish governed intake provenance or structured components for Card accounting. Prefer POST /integration/v1/merchant-settlement-intake for governed normalized payout ingestion; use batch POST with nested lines only for legacy evidence ingestion.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["lineType","netAmount"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid data. VALIDATE_ONLY validates references and duplicate policy without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate provider settlement, payout, merchant-account, or transaction references."},"batchId":{"type":["string","null"],"format":"uuid"},"entityId":{"type":["string","null"],"format":"uuid"},"providerCode":{"type":["string","null"],"enum":["STRIPE","ADYEN","PAYPAL","FIRST_DATA","GENERIC_CSV","OTHER",null]},"settlementId":{"type":["string","null"]},"payoutId":{"type":["string","null"]},"externalSystem":{"type":["string","null"]},"externalId":{"type":["string","null"]},"openItemLinkMode":{"type":["string","null"],"enum":["AUTO","EXPLICIT_ONLY","NONE",null],"description":"AUTO may resolve invoice references, EXPLICIT_ONLY uses explicit open-item identifiers, and NONE preserves invoice/customer text without creating an AP/AR candidate link."},"lineType":{"type":"string","enum":["CHARGE","PAYMENT","REFUND","DISPUTE","CHARGEBACK","FEE","TAX","ADJUSTMENT","RESERVE","PAYOUT","OTHER"]},"lineStatus":{"type":["string","null"],"enum":["UNMATCHED","CANDIDATE","MATCHED","NEEDS_REVIEW","IGNORED","REVERSED",null]},"transactionDate":{"type":["string","null"],"format":"date"},"payoutDate":{"type":["string","null"],"format":"date"},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"grossAmount":{"type":["number","string","null"]},"feeAmount":{"type":["number","string","null"]},"netAmount":{"type":["number","string"]},"providerTransactionId":{"type":["string","null"]},"providerBalanceTransactionId":{"type":["string","null"]},"providerChargeId":{"type":["string","null"]},"providerPaymentId":{"type":["string","null"]},"providerRefundId":{"type":["string","null"]},"providerDisputeId":{"type":["string","null"]},"authorizationCode":{"type":["string","null"]},"cardBrand":{"type":["string","null"]},"paymentMethod":{"type":["string","null"]},"sourceSystem":{"type":["string","null"],"maxLength":100},"sourceTransactionId":{"type":["string","null"],"maxLength":300},"storeRef":{"type":["string","null"],"maxLength":200},"locationRef":{"type":["string","null"],"maxLength":200},"departmentRef":{"type":["string","null"],"maxLength":200},"channel":{"type":["string","null"],"maxLength":100},"terminalRef":{"type":["string","null"],"maxLength":200},"registerRef":{"type":["string","null"],"maxLength":200},"posBatchRef":{"type":["string","null"],"maxLength":200},"shiftRef":{"type":["string","null"],"maxLength":200},"businessDate":{"type":["string","null"],"format":"date"},"receiptRef":{"type":["string","null"],"maxLength":300},"orderRef":{"type":["string","null"],"maxLength":300},"tenderRef":{"type":["string","null"],"maxLength":300},"merchantReference":{"type":["string","null"],"maxLength":300},"transactionOccurredAt":{"type":["string","null"],"format":"date-time","description":"Business/source transaction timestamp with an explicit UTC offset."},"sourceTimezone":{"type":["string","null"],"maxLength":100},"cardNetwork":{"type":["string","null"],"maxLength":100},"maskedCardLast4":{"type":["string","null"],"pattern":"^[0-9]{4}$","description":"Accountant-safe final four digits only. Never send PAN, CVV/CVC, PIN, or track data."},"providerCardFingerprint":{"type":["string","null"],"maxLength":300},"providerCardToken":{"type":["string","null"],"maxLength":300},"acquirerReferenceNumber":{"type":["string","null"],"maxLength":300},"networkTransactionId":{"type":["string","null"],"maxLength":300},"walletType":{"type":["string","null"],"maxLength":100},"cardPresent":{"type":["boolean","null"]},"originalProviderTransactionId":{"type":["string","null"],"maxLength":300,"description":"Original provider transaction for a refund, dispute, chargeback, or reversal."},"disputeReason":{"type":["string","null"],"maxLength":300},"disputeStage":{"type":["string","null"],"maxLength":100},"disputeStatus":{"type":["string","null"],"maxLength":100},"disputeResponseDueAt":{"type":["string","null"],"format":"date-time"},"disputeOutcome":{"type":["string","null"],"maxLength":100},"fieldProvenance":{"type":["object","null"],"additionalProperties":true,"description":"Field-keyed source provenance for normalized accountant-facing evidence."},"invoiceNumber":{"type":["string","null"],"description":"Invoice number from the processor or ERP. May resolve a current open item or a historical open-item snapshot."},"customerRef":{"type":["string","null"]},"description":{"type":["string","null"]},"counterpartyId":{"type":["string","null"],"format":"uuid"},"externalCounterpartyId":{"type":["string","null"]},"counterpartyExternalSystem":{"type":["string","null"]},"erpDocumentId":{"type":["string","null"],"format":"uuid"},"erpDocumentLineId":{"type":["string","null"],"format":"uuid"},"documentExternalSystem":{"type":["string","null"]},"externalDocumentId":{"type":["string","null"]},"docType":{"type":["string","null"]},"docNo":{"type":["string","null"]},"lineNo":{"type":["integer","null"],"minimum":1},"openItemType":{"type":["string","null"],"enum":["AP","AR",null]},"openItemId":{"type":["string","null"],"format":"uuid"},"externalOpenItemId":{"type":["string","null"]},"openItemSnapshotId":{"type":["string","null"],"format":"uuid"},"bankTransactionId":{"type":["string","null"],"format":"uuid"},"bankAuxiliaryEntryId":{"type":["string","null"],"format":"uuid"},"rawPayload":{"type":["object","null"],"additionalProperties":true},"metadata":{"type":["object","null"],"additionalProperties":true}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["processingMode","record","preview"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"record":{"type":["null","object"],"additionalProperties":true},"preview":{"type":"object","additionalProperties":true}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}},"/integration/v1/open-items":{"get":{"summary":"List AP/AR open items","tags":["Integration - Open Items"],"description":"Returns AP vendor payables or AR customer receivables linked to ERP source documents. Requires any integration API scope.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string","enum":["AP","AR"]},"in":"query","name":"openItemType","required":true,"description":"Allowed values: AP = vendor payable open item; AR = customer receivable open item."},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"entityId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"counterpartyId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"erpDocumentId","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false,"description":"Allowed values: OPEN, PARTIALLY_SETTLED, SETTLED, CLOSED, PAID, DISPUTED, ON_HOLD, CANCELLED/CANCELED, VOID/VOIDED, or REVERSED."},{"schema":{"type":"string","format":"date"},"in":"query","name":"invoiceDateFrom","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"invoiceDateTo","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"dueDateFrom","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"dueDateTo","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"expectedSettlementDateFrom","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"expectedSettlementDateTo","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","counterpartyId","invoiceNumber","invoiceDate","dueDate","originalAmount","openAmount","currencyCode","status","source","createdAt","updatedAt","openItemType"],"properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"openItemType":{"type":"string","enum":["AP","AR"],"description":"Allowed values: AP = vendor payable open item; AR = customer receivable open item."},"entityId":{"type":"string","format":"uuid"},"erpDocumentId":{"type":["null","string"],"format":"uuid"},"counterpartyId":{"type":"string","format":"uuid"},"externalSystem":{"type":["null","string"]},"externalOpenItemId":{"type":["null","string"]},"invoiceNumber":{"type":"string"},"invoiceDate":{"type":"string","format":"date"},"dueDate":{"type":"string","format":"date"},"originalAmount":{"type":["number","string"]},"openAmount":{"type":["number","string"]},"currencyCode":{"type":"string","minLength":3,"maxLength":3},"expectedSettlementDate":{"type":["null","string"],"format":"date"},"asOfDate":{"type":["null","string"],"format":"date"},"sourceBatchId":{"type":["null","string"]},"paymentTermProfileId":{"type":["null","string"],"format":"uuid"},"settlementProfileId":{"type":["null","string"],"format":"uuid"},"status":{"type":"string","description":"Allowed values: OPEN, PARTIALLY_SETTLED, SETTLED, CLOSED, PAID, DISPUTED, ON_HOLD, CANCELLED/CANCELED, VOID/VOIDED, or REVERSED."},"source":{"type":"string"},"metadata":{"type":["null","object"],"additionalProperties":true},"integrationMutation":{"type":["null","string"],"enum":["CREATED","UPDATED","UNCHANGED",null],"description":"Present on write responses. Shows whether the current open-item row was created, updated, or already current."},"openItemBatchId":{"type":["null","string"],"format":"uuid","description":"Present when an asOfDate/source snapshot batch was recorded."},"openItemSnapshotId":{"type":["null","string"],"format":"uuid","description":"Present when the write recorded a daily source snapshot."},"cardApplicationConvergence":{"type":["null","object"],"additionalProperties":true,"description":"Present when this PATCH authoritatively confirms the APPLIED Card application remainder for the supplied applicationGroupId."},"cardApplicationReversal":{"type":["null","object"],"additionalProperties":true,"description":"Present when this PATCH authoritatively restores the frozen pre-application AP/AR balance after a REVERSED Card application acknowledgement."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"entities":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":"string"}}},"counterparties":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["CUSTOMER","VENDOR","EMPLOYEE","BANK","OTHER"]}}},"erpDocuments":{"type":["null","object"],"additionalProperties":true,"properties":{"docType":{"type":"string"},"docNo":{"type":"string"},"docDate":{"type":["null","string"],"format":"date"},"postingDate":{"type":["null","string"],"format":"date"},"lifecycleStatus":{"type":"string"},"externalSystem":{"type":["null","string"]},"externalDocumentId":{"type":["null","string"]}}}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Create or update an AP/AR open item","tags":["Integration - Open Items"],"description":"Creates or updates invoice receivable/payable source state only. It does not execute settlement, move money, approve reconciliation, or post back to the ERP. The current AP/AR row is upserted by ERP document, externalOpenItemId, or counterparty invoice number. When asOfDate is supplied, a dated source snapshot is retained for audit and next-day reconciliation. VALIDATE_ONLY checks references without writes. Requires full_access or transactions.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["openItemType","entityId","invoiceNumber","invoiceDate","dueDate","originalAmount"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO creates or updates the current open item. VALIDATE_ONLY checks payload shape, references, and document compatibility without writing."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK is retained for compatibility. Matching rows are upserted instead of rejected unless more than one current row matches."},"loadMode":{"type":["string","null"],"enum":["UPSERT_CURRENT","SNAPSHOT_CURRENT","FULL_REPLACEMENT",null],"default":"UPSERT_CURRENT","description":"UPSERT_CURRENT updates the current AP/AR row. SNAPSHOT_CURRENT also requires asOfDate and records a dated source snapshot. FULL_REPLACEMENT is reserved for explicit current-feed replacement and currently keeps missing rows open."},"openItemType":{"type":"string","enum":["AP","AR"],"description":"Allowed values: AP = vendor payable open item; AR = customer receivable open item."},"entityId":{"type":"string","format":"uuid"},"erpDocumentId":{"type":["string","null"],"format":"uuid","description":"Optional Reconcilia ERP document UUID. Use only when a real AP/AR invoice ERP document already exists; open items can be loaded as AP/AR auxiliary source data without it."},"externalSystem":{"type":["string","null"],"description":"Source system for this open item. Also used as the default system for counterparty and document external references when their specific external system is omitted."},"externalOpenItemId":{"type":["string","null"],"description":"Source-owned AP/AR open-item id used for idempotency and future settlement reference resolution."},"documentExternalSystem":{"type":["string","null"],"description":"External system for externalDocumentId. Defaults to externalSystem when omitted."},"externalDocumentId":{"type":["string","null"],"description":"External ERP invoice document id. Used with externalSystem/documentExternalSystem to resolve the Reconcilia ERP document id."},"docType":{"type":["string","null"],"enum":["AP_INVOICE","AR_INVOICE",null],"description":"Optional ERP invoice document type used with docNo when a linked Reconcilia ERP document already exists."},"docNo":{"type":["string","null"],"description":"ERP invoice document number used with docType when no Reconcilia ERP document UUID is supplied."},"counterpartyId":{"type":["string","null"],"format":"uuid","description":"Reconcilia internal vendor/customer UUID. Optional when externalSystem + externalCounterpartyId resolves it, or when the linked ERP document has a header counterparty."},"counterpartyExternalSystem":{"type":["string","null"],"description":"External system for externalCounterpartyId. Defaults to externalSystem when omitted."},"externalCounterpartyId":{"type":["string","null"],"description":"External vendor/customer id. Used with externalSystem/counterpartyExternalSystem to resolve the Reconcilia counterparty id."},"counterpartyExternalId":{"type":["string","null"],"description":"Alias for externalCounterpartyId."},"invoiceNumber":{"type":"string","minLength":1},"invoiceDate":{"type":"string","format":"date"},"dueDate":{"type":"string","format":"date"},"originalAmount":{"type":["number","string"]},"openAmount":{"type":["number","string","null"],"description":"Current unpaid/uncollected amount. Defaults to originalAmount on create. Use 0 with a terminal status to close."},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"currencyCode":{"type":["string","null"],"minLength":3,"maxLength":3},"expectedSettlementDate":{"type":["string","null"],"format":"date"},"asOfDate":{"type":["string","null"],"format":"date","description":"Snapshot/as-of date for externally supplied auxiliary rows."},"sourceBatchId":{"type":["string","null"],"description":"Optional source batch/snapshot id for audit and daily open-item loads."},"status":{"type":["string","null"],"description":"Allowed values: OPEN, PARTIALLY_SETTLED, SETTLED, CLOSED, PAID, DISPUTED, ON_HOLD, CANCELLED/CANCELED, VOID/VOIDED, or REVERSED."},"source":{"type":["string","null"],"enum":["ERP","MANUAL","IMPORT","SYSTEM",null],"default":"ERP"},"metadata":{"type":["null","object"],"additionalProperties":true}}},"example":{"processingMode":"VALIDATE_ONLY","conflictPolicy":"BLOCK","openItemType":"AP","entityId":"00000000-0000-0000-0000-000000000000","externalSystem":"example-erp","externalOpenItemId":"ERP-OI-AP-2026-0001","externalCounterpartyId":"VEND-001","invoiceNumber":"AP-INV-2026-0001","invoiceDate":"2026-04-25","dueDate":"2026-05-25","originalAmount":"1250.00","openAmount":"1250.00","currency":"USD","expectedSettlementDate":"2026-05-25","asOfDate":"2026-05-19","status":"OPEN","source":"ERP","sourceBatchId":"ap-open-items-2026-05-19","metadata":{"sourceBatch":"ap-open-items-2026-04"}}}},"required":true},"parameters":[{"schema":{"type":"string","maxLength":200},"in":"header","name":"idempotency-key","required":false,"description":"Optional caller idempotency key. Open-item writes prefer externalSystem + externalOpenItemId, then optional resolved invoice document identity, then openItemType + counterparty + invoiceNumber natural keys when present."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true},"idempotency":{"type":"object","additionalProperties":false,"required":["key","replayed","requestBodyHash"],"properties":{"key":{"type":"string"},"replayed":{"type":"boolean"},"requestBodyHash":{"type":"string"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/open-items/bulk":{"post":{"summary":"Create or update AP/AR open items in bulk","tags":["Integration - Open Items"],"description":"Creates or updates invoice receivable/payable source state only. It does not execute settlement, move money, approve reconciliation, or post back to the ERP. Validates or upserts many AP/AR current open items in one all-or-nothing request and records dated snapshots when asOfDate is supplied. Requires full_access or transactions. Bulk requests use requestReference/clientRef for tracing and idMap building; per-row idempotency-key headers are not used.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid rows. VALIDATE_ONLY checks all rows without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects invalid references and ambiguous matches; matching current rows are upserted."},"loadMode":{"type":"string","enum":["UPSERT_CURRENT","SNAPSHOT_CURRENT","FULL_REPLACEMENT"],"default":"UPSERT_CURRENT","description":"UPSERT_CURRENT updates the current AP/AR row. SNAPSHOT_CURRENT also requires asOfDate and records a dated source snapshot. FULL_REPLACEMENT is reserved for explicit current-feed replacement and currently keeps missing rows open."},"closeMissingPolicy":{"type":"string","enum":["KEEP_OPEN","CLOSE_MISSING"],"default":"KEEP_OPEN","description":"KEEP_OPEN preserves current open items missing from this load. CLOSE_MISSING is reserved and currently rejected until replacement semantics are enabled."},"requestReference":{"type":["string","null"],"maxLength":255,"description":"Caller batch reference echoed in the response for audit and troubleshooting."},"rows":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["clientRef","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200,"description":"Caller-supplied stable reference echoed in row results and idMap."},"data":{"type":"object","additionalProperties":false,"required":["openItemType","entityId","invoiceNumber","invoiceDate","dueDate","originalAmount"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO creates or updates the current open item. VALIDATE_ONLY checks payload shape, references, and document compatibility without writing."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK is retained for compatibility. Matching rows are upserted instead of rejected unless more than one current row matches."},"loadMode":{"type":["string","null"],"enum":["UPSERT_CURRENT","SNAPSHOT_CURRENT","FULL_REPLACEMENT",null],"default":"UPSERT_CURRENT","description":"UPSERT_CURRENT updates the current AP/AR row. SNAPSHOT_CURRENT also requires asOfDate and records a dated source snapshot. FULL_REPLACEMENT is reserved for explicit current-feed replacement and currently keeps missing rows open."},"openItemType":{"type":"string","enum":["AP","AR"],"description":"Allowed values: AP = vendor payable open item; AR = customer receivable open item."},"entityId":{"type":"string","format":"uuid"},"erpDocumentId":{"type":["string","null"],"format":"uuid","description":"Optional Reconcilia ERP document UUID. Use only when a real AP/AR invoice ERP document already exists; open items can be loaded as AP/AR auxiliary source data without it."},"externalSystem":{"type":["string","null"],"description":"Source system for this open item. Also used as the default system for counterparty and document external references when their specific external system is omitted."},"externalOpenItemId":{"type":["string","null"],"description":"Source-owned AP/AR open-item id used for idempotency and future settlement reference resolution."},"documentExternalSystem":{"type":["string","null"],"description":"External system for externalDocumentId. Defaults to externalSystem when omitted."},"externalDocumentId":{"type":["string","null"],"description":"External ERP invoice document id. Used with externalSystem/documentExternalSystem to resolve the Reconcilia ERP document id."},"docType":{"type":["string","null"],"enum":["AP_INVOICE","AR_INVOICE",null],"description":"Optional ERP invoice document type used with docNo when a linked Reconcilia ERP document already exists."},"docNo":{"type":["string","null"],"description":"ERP invoice document number used with docType when no Reconcilia ERP document UUID is supplied."},"counterpartyId":{"type":["string","null"],"format":"uuid","description":"Reconcilia internal vendor/customer UUID. Optional when externalSystem + externalCounterpartyId resolves it, or when the linked ERP document has a header counterparty."},"counterpartyExternalSystem":{"type":["string","null"],"description":"External system for externalCounterpartyId. Defaults to externalSystem when omitted."},"externalCounterpartyId":{"type":["string","null"],"description":"External vendor/customer id. Used with externalSystem/counterpartyExternalSystem to resolve the Reconcilia counterparty id."},"counterpartyExternalId":{"type":["string","null"],"description":"Alias for externalCounterpartyId."},"invoiceNumber":{"type":"string","minLength":1},"invoiceDate":{"type":"string","format":"date"},"dueDate":{"type":"string","format":"date"},"originalAmount":{"type":["number","string"]},"openAmount":{"type":["number","string","null"],"description":"Current unpaid/uncollected amount. Defaults to originalAmount on create. Use 0 with a terminal status to close."},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"currencyCode":{"type":["string","null"],"minLength":3,"maxLength":3},"expectedSettlementDate":{"type":["string","null"],"format":"date"},"asOfDate":{"type":["string","null"],"format":"date","description":"Snapshot/as-of date for externally supplied auxiliary rows."},"sourceBatchId":{"type":["string","null"],"description":"Optional source batch/snapshot id for audit and daily open-item loads."},"status":{"type":["string","null"],"description":"Allowed values: OPEN, PARTIALLY_SETTLED, SETTLED, CLOSED, PAID, DISPUTED, ON_HOLD, CANCELLED/CANCELED, VOID/VOIDED, or REVERSED."},"source":{"type":["string","null"],"enum":["ERP","MANUAL","IMPORT","SYSTEM",null],"default":"ERP"},"metadata":{"type":["null","object"],"additionalProperties":true}},"example":{"processingMode":"VALIDATE_ONLY","conflictPolicy":"BLOCK","openItemType":"AP","entityId":"00000000-0000-0000-0000-000000000000","externalSystem":"example-erp","externalOpenItemId":"ERP-OI-AP-2026-0001","externalCounterpartyId":"VEND-001","invoiceNumber":"AP-INV-2026-0001","invoiceDate":"2026-04-25","dueDate":"2026-05-25","originalAmount":"1250.00","openAmount":"1250.00","currency":"USD","expectedSettlementDate":"2026-05-25","asOfDate":"2026-05-19","status":"OPEN","source":"ERP","sourceBatchId":"ap-open-items-2026-05-19","metadata":{"sourceBatch":"ap-open-items-2026-04"}}}}}}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["processingMode","requestReference","summary","rows","idMap"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":["null","string"]},"summary":{"type":"object","additionalProperties":false,"required":["received","valid","blocked","created","updated","unchanged","snapshots"],"properties":{"received":{"type":"integer"},"valid":{"type":"integer"},"blocked":{"type":"integer"},"created":{"type":"integer"},"updated":{"type":"integer"},"unchanged":{"type":"integer"},"snapshots":{"type":"integer"}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","clientRef","status","id","mutation","openItemBatchId","openItemSnapshotId","errors","warnings"],"properties":{"index":{"type":"integer"},"clientRef":{"type":"string"},"status":{"type":"string","enum":["VALID","BLOCKED","CREATED","UPDATED","UNCHANGED"]},"id":{"type":["null","string"]},"mutation":{"type":["null","string"],"enum":["CREATED","UPDATED","UNCHANGED",null]},"openItemBatchId":{"type":["null","string"],"format":"uuid"},"openItemSnapshotId":{"type":["null","string"],"format":"uuid"},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}},"idMap":{"type":"object","additionalProperties":{"type":"string"},"description":"Maps clientRef to the created or updated open-item id for AUTO requests."}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/open-items/{openItemType}/{id}":{"get":{"summary":"Get an AP/AR open item","tags":["Integration - Open Items"],"parameters":[{"schema":{"type":"string","enum":["AP","AR"]},"in":"path","name":"openItemType","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","counterpartyId","invoiceNumber","invoiceDate","dueDate","originalAmount","openAmount","currencyCode","status","source","createdAt","updatedAt","openItemType"],"properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"openItemType":{"type":"string","enum":["AP","AR"],"description":"Allowed values: AP = vendor payable open item; AR = customer receivable open item."},"entityId":{"type":"string","format":"uuid"},"erpDocumentId":{"type":["null","string"],"format":"uuid"},"counterpartyId":{"type":"string","format":"uuid"},"externalSystem":{"type":["null","string"]},"externalOpenItemId":{"type":["null","string"]},"invoiceNumber":{"type":"string"},"invoiceDate":{"type":"string","format":"date"},"dueDate":{"type":"string","format":"date"},"originalAmount":{"type":["number","string"]},"openAmount":{"type":["number","string"]},"currencyCode":{"type":"string","minLength":3,"maxLength":3},"expectedSettlementDate":{"type":["null","string"],"format":"date"},"asOfDate":{"type":["null","string"],"format":"date"},"sourceBatchId":{"type":["null","string"]},"paymentTermProfileId":{"type":["null","string"],"format":"uuid"},"settlementProfileId":{"type":["null","string"],"format":"uuid"},"status":{"type":"string","description":"Allowed values: OPEN, PARTIALLY_SETTLED, SETTLED, CLOSED, PAID, DISPUTED, ON_HOLD, CANCELLED/CANCELED, VOID/VOIDED, or REVERSED."},"source":{"type":"string"},"metadata":{"type":["null","object"],"additionalProperties":true},"integrationMutation":{"type":["null","string"],"enum":["CREATED","UPDATED","UNCHANGED",null],"description":"Present on write responses. Shows whether the current open-item row was created, updated, or already current."},"openItemBatchId":{"type":["null","string"],"format":"uuid","description":"Present when an asOfDate/source snapshot batch was recorded."},"openItemSnapshotId":{"type":["null","string"],"format":"uuid","description":"Present when the write recorded a daily source snapshot."},"cardApplicationConvergence":{"type":["null","object"],"additionalProperties":true,"description":"Present when this PATCH authoritatively confirms the APPLIED Card application remainder for the supplied applicationGroupId."},"cardApplicationReversal":{"type":["null","object"],"additionalProperties":true,"description":"Present when this PATCH authoritatively restores the frozen pre-application AP/AR balance after a REVERSED Card application acknowledgement."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"entities":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":"string"}}},"counterparties":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["CUSTOMER","VENDOR","EMPLOYEE","BANK","OTHER"]}}},"erpDocuments":{"type":["null","object"],"additionalProperties":true,"properties":{"docType":{"type":"string"},"docNo":{"type":"string"},"docDate":{"type":["null","string"],"format":"date"},"postingDate":{"type":["null","string"],"format":"date"},"lifecycleStatus":{"type":"string"},"externalSystem":{"type":["null","string"]},"externalDocumentId":{"type":["null","string"]}}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Update or close an AP/AR open item","tags":["Integration - Open Items"],"description":"Creates or updates invoice receivable/payable source state only. It does not execute settlement, move money, approve reconciliation, or post back to the ERP. To close, set openAmount to 0 and use a terminal status such as SETTLED, CLOSED, PAID, VOID, or REVERSED. For a reviewed Card application, first acknowledge the application group as APPLIED, then supply applicationGroupId with the exact authoritative remainder and status. If the source later acknowledges that group as REVERSED, PATCH every participating target again with the same applicationGroupId, its frozen pre-application balance, and a non-terminal source status. These calls record convergence without changing Card source rows. Requires full_access or transactions.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"counterpartyId":{"type":["string","null"],"format":"uuid","description":"Reconcilia internal vendor/customer UUID. Optional when externalSystem + externalCounterpartyId resolves it, or when the linked ERP document has a header counterparty."},"invoiceNumber":{"type":"string","minLength":1},"invoiceDate":{"type":"string","format":"date"},"dueDate":{"type":"string","format":"date"},"originalAmount":{"type":["number","string"]},"openAmount":{"type":["number","string","null"],"description":"Current unpaid/uncollected amount. Defaults to originalAmount on create. Use 0 with a terminal status to close."},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"currencyCode":{"type":["string","null"],"minLength":3,"maxLength":3},"expectedSettlementDate":{"type":["string","null"],"format":"date"},"status":{"type":["string","null"],"description":"Allowed values: OPEN, PARTIALLY_SETTLED, SETTLED, CLOSED, PAID, DISPUTED, ON_HOLD, CANCELLED/CANCELED, VOID/VOIDED, or REVERSED."},"source":{"type":["string","null"],"enum":["ERP","MANUAL","IMPORT","SYSTEM",null],"default":"ERP"},"metadata":{"type":["null","object"],"additionalProperties":true},"applicationGroupId":{"type":"string","pattern":"^[0-9a-fA-F]{64}$","description":"Optional Card application-group correlation. When supplied, openAmount and status are required. APPLIED groups must report the exact reviewed remainder; REVERSED groups must restore the frozen pre-application balance with a non-terminal source status."}}}}}},"parameters":[{"schema":{"type":"string","enum":["AP","AR"]},"in":"path","name":"openItemType","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","counterpartyId","invoiceNumber","invoiceDate","dueDate","originalAmount","openAmount","currencyCode","status","source","createdAt","updatedAt","openItemType"],"properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"openItemType":{"type":"string","enum":["AP","AR"],"description":"Allowed values: AP = vendor payable open item; AR = customer receivable open item."},"entityId":{"type":"string","format":"uuid"},"erpDocumentId":{"type":["null","string"],"format":"uuid"},"counterpartyId":{"type":"string","format":"uuid"},"externalSystem":{"type":["null","string"]},"externalOpenItemId":{"type":["null","string"]},"invoiceNumber":{"type":"string"},"invoiceDate":{"type":"string","format":"date"},"dueDate":{"type":"string","format":"date"},"originalAmount":{"type":["number","string"]},"openAmount":{"type":["number","string"]},"currencyCode":{"type":"string","minLength":3,"maxLength":3},"expectedSettlementDate":{"type":["null","string"],"format":"date"},"asOfDate":{"type":["null","string"],"format":"date"},"sourceBatchId":{"type":["null","string"]},"paymentTermProfileId":{"type":["null","string"],"format":"uuid"},"settlementProfileId":{"type":["null","string"],"format":"uuid"},"status":{"type":"string","description":"Allowed values: OPEN, PARTIALLY_SETTLED, SETTLED, CLOSED, PAID, DISPUTED, ON_HOLD, CANCELLED/CANCELED, VOID/VOIDED, or REVERSED."},"source":{"type":"string"},"metadata":{"type":["null","object"],"additionalProperties":true},"integrationMutation":{"type":["null","string"],"enum":["CREATED","UPDATED","UNCHANGED",null],"description":"Present on write responses. Shows whether the current open-item row was created, updated, or already current."},"openItemBatchId":{"type":["null","string"],"format":"uuid","description":"Present when an asOfDate/source snapshot batch was recorded."},"openItemSnapshotId":{"type":["null","string"],"format":"uuid","description":"Present when the write recorded a daily source snapshot."},"cardApplicationConvergence":{"type":["null","object"],"additionalProperties":true,"description":"Present when this PATCH authoritatively confirms the APPLIED Card application remainder for the supplied applicationGroupId."},"cardApplicationReversal":{"type":["null","object"],"additionalProperties":true,"description":"Present when this PATCH authoritatively restores the frozen pre-application AP/AR balance after a REVERSED Card application acknowledgement."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"entities":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":"string"}}},"counterparties":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["CUSTOMER","VENDOR","EMPLOYEE","BANK","OTHER"]}}},"erpDocuments":{"type":["null","object"],"additionalProperties":true,"properties":{"docType":{"type":"string"},"docNo":{"type":"string"},"docDate":{"type":["null","string"],"format":"date"},"postingDate":{"type":["null","string"],"format":"date"},"lifecycleStatus":{"type":"string"},"externalSystem":{"type":["null","string"]},"externalDocumentId":{"type":["null","string"]}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/open-item-settlements":{"get":{"summary":"List AP/AR open-item settlement links","tags":["Integration - Open Item Settlements"],"description":"Returns settlement evidence rows for AP/AR open items. Requires any integration API scope.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"id","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"focusId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"entityId","required":false},{"schema":{"type":"string","enum":["AP","AR"]},"in":"query","name":"openItemType","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"openItemId","required":false},{"schema":{"type":"string","enum":["BANK_AUXILIARY","ERP_DOCUMENT","ERP_DOCUMENT_LINE","PAYMENT_JOURNAL_LINE","BANK_TRANSACTION","CASH_POSITION_ENTRY","MERCHANT_SETTLEMENT_LINE","MANUAL"]},"in":"query","name":"settlementSourceType","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"settlementSourceId","required":false},{"schema":{"type":"string","enum":["PROPOSED","APPLIED","REVERSED","CANCELLED"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","enum":["RELATIONSHIP","APPLICATION"]},"in":"query","name":"assertionType","required":false},{"schema":{"type":"string"},"in":"query","name":"externalSystem","required":false},{"schema":{"type":"string"},"in":"query","name":"externalId","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","openItemType","openItemId","settlementSourceType","settlementDate","amount","currencyCode","status","linkSource","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"entityId":{"type":"string","format":"uuid"},"openItemType":{"type":"string","enum":["AP","AR"]},"openItemId":{"type":"string","format":"uuid"},"settlementSourceType":{"type":"string","enum":["BANK_AUXILIARY","ERP_DOCUMENT","ERP_DOCUMENT_LINE","PAYMENT_JOURNAL_LINE","BANK_TRANSACTION","CASH_POSITION_ENTRY","MERCHANT_SETTLEMENT_LINE","MANUAL"],"description":"Allowed write values: ERP_DOCUMENT, ERP_DOCUMENT_LINE, PAYMENT_JOURNAL_LINE, BANK_TRANSACTION, CASH_POSITION_ENTRY, BANK_AUXILIARY, or MANUAL. Reconciliation-generated Card applications are read as MERCHANT_SETTLEMENT_LINE."},"settlementSourceId":{"type":["null","string"],"format":"uuid","description":"Resolved source row UUID when the settlement source exists in Reconcilia; null is allowed for unresolved external evidence."},"settlementType":{"type":"string","enum":["PAYMENT","RECEIPT","CREDIT_NOTE","DEBIT_NOTE","ADJUSTMENT","REVERSAL","WRITE_OFF"]},"settlementDate":{"type":"string","format":"date"},"amount":{"type":["number","string"]},"currencyCode":{"type":"string","minLength":3,"maxLength":3},"status":{"type":"string","enum":["PROPOSED","APPLIED","REVERSED","CANCELLED"]},"assertionType":{"type":"string","enum":["RELATIONSHIP","APPLICATION"]},"linkSource":{"type":"string","enum":["ERP","MANUAL","IMPORT","INTEGRATION_API","RECONCILIA_MATCH","AI_REVIEW","SYSTEM"]},"externalSystem":{"type":["null","string"]},"externalId":{"type":["null","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"createdByUserId":{"type":["null","string"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["null","string"],"format":"date-time"},"entities":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":"string"}}}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Create an AP/AR open-item settlement link","tags":["Integration - Open Item Settlements"],"description":"Records source evidence that a payment, receipt, bank movement, or manual event settles an AP/AR open item. It does not move money, approve reconciliation, or post accounting entries. Use PATCH /integration/v1/open-items/{openItemType}/{id} when the ERP/source also changes the open item balance or status. Requires full_access or transactions.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["entityId","openItemType","settlementSourceType","settlementDate","amount"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO creates the settlement link. VALIDATE_ONLY checks payload shape, references, amount, currency, and duplicates without writing."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate externalSystem/externalId or duplicate openItem/source links."},"entityId":{"type":"string","format":"uuid"},"openItemType":{"type":"string","enum":["AP","AR"]},"openItemId":{"type":["string","null"],"format":"uuid","description":"Reconcilia open-item UUID. Optional when invoiceNumber or an ERP invoice document reference resolves the open item."},"invoiceNumber":{"type":["string","null"],"description":"AP/AR invoice number used to resolve the open item when openItemId is not supplied."},"externalOpenItemId":{"type":["string","null"],"description":"Source-owned AP/AR open-item id used with externalSystem to resolve the open item when openItemId is not supplied."},"erpDocumentId":{"type":["string","null"],"format":"uuid","description":"Reconcilia ERP invoice document UUID used to resolve the open item."},"documentExternalSystem":{"type":["string","null"],"description":"External system for externalDocumentId when resolving the open item invoice. Defaults to externalSystem."},"externalDocumentId":{"type":["string","null"],"description":"External ERP invoice document id used to resolve the open item."},"docType":{"type":["string","null"],"enum":["AP_INVOICE","AR_INVOICE",null],"description":"ERP invoice document type used with docNo to resolve the open item."},"docNo":{"type":["string","null"],"description":"ERP invoice document number used with docType to resolve the open item."},"counterpartyId":{"type":["string","null"],"format":"uuid"},"counterpartyExternalSystem":{"type":["string","null"],"description":"External system for externalCounterpartyId when resolving the open item."},"externalCounterpartyId":{"type":["string","null"],"description":"External vendor/customer id used with externalSystem/counterpartyExternalSystem to narrow open-item resolution."},"counterpartyExternalId":{"type":["string","null"],"description":"Alias for externalCounterpartyId."},"settlementSourceType":{"type":"string","enum":["BANK_AUXILIARY","ERP_DOCUMENT","ERP_DOCUMENT_LINE","PAYMENT_JOURNAL_LINE","BANK_TRANSACTION","CASH_POSITION_ENTRY","MANUAL"],"description":"Allowed write values: ERP_DOCUMENT, ERP_DOCUMENT_LINE, PAYMENT_JOURNAL_LINE, BANK_TRANSACTION, CASH_POSITION_ENTRY, BANK_AUXILIARY, or MANUAL. Reconciliation-generated Card applications are read as MERCHANT_SETTLEMENT_LINE."},"settlementSourceId":{"type":["string","null"],"format":"uuid","description":"Internal source UUID. Optional when source natural/external references are supplied; unresolved external settlement evidence is allowed."},"sourceErpDocumentId":{"type":["string","null"],"format":"uuid","description":"Reconcilia ERP payment/receipt/source document UUID for settlementSourceType ERP_DOCUMENT or ERP_DOCUMENT_LINE."},"sourceDocumentExternalSystem":{"type":["string","null"],"description":"External system for sourceExternalDocumentId. Defaults to sourceExternalSystem/externalSystem."},"sourceExternalSystem":{"type":["string","null"],"description":"External system for the settlement source document or bank auxiliary source."},"sourceExternalDocumentId":{"type":["string","null"],"description":"External ERP payment/receipt/source document id used to resolve settlementSourceId."},"sourceDocType":{"type":["string","null"],"description":"Source ERP document type used with sourceDocNo."},"sourceDocNo":{"type":["string","null"],"description":"Source ERP document number used with sourceDocType."},"sourceErpDocumentLineId":{"type":["string","null"],"format":"uuid","description":"Reconcilia ERP source line UUID for settlementSourceType ERP_DOCUMENT_LINE."},"sourceErpLineId":{"type":["string","null"],"format":"uuid","description":"Alias for sourceErpDocumentLineId."},"sourceLineNo":{"type":["integer","string","null"],"description":"Source ERP line number used with a resolved source document for settlementSourceType ERP_DOCUMENT_LINE."},"bankAuxiliaryEntryId":{"type":["string","null"],"format":"uuid","description":"Reconcilia bank auxiliary entry UUID for settlementSourceType BANK_AUXILIARY."},"bankAuxiliaryExternalSystem":{"type":["string","null"],"description":"External system for bankAuxiliaryExternalId. Defaults to sourceExternalSystem/externalSystem."},"bankAuxiliaryExternalId":{"type":["string","null"],"description":"External bank auxiliary source id used to resolve settlementSourceId."},"settlementType":{"type":["string","null"],"enum":["PAYMENT","RECEIPT","CREDIT_NOTE","DEBIT_NOTE","ADJUSTMENT","REVERSAL","WRITE_OFF",null],"description":"Business meaning of the settlement evidence. Defaults to PAYMENT for AP and RECEIPT for AR."},"settlementDate":{"type":"string","format":"date"},"amount":{"type":["number","string"]},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"currencyCode":{"type":["string","null"],"minLength":3,"maxLength":3},"status":{"type":["string","null"],"enum":["PROPOSED","APPLIED","REVERSED","CANCELLED",null],"default":"APPLIED"},"assertionType":{"type":["string","null"],"enum":["RELATIONSHIP","APPLICATION",null],"default":"RELATIONSHIP","description":"RELATIONSHIP links supporting evidence. APPLICATION asserts a proposed or applied AP/AR settlement action."},"linkSource":{"type":["string","null"],"enum":["ERP","MANUAL","IMPORT","INTEGRATION_API","RECONCILIA_MATCH","AI_REVIEW","SYSTEM",null],"default":"INTEGRATION_API"},"externalSystem":{"type":["string","null"]},"externalId":{"type":["string","null"]},"metadata":{"type":["null","object"],"additionalProperties":true}}},"example":{"processingMode":"VALIDATE_ONLY","conflictPolicy":"BLOCK","entityId":"00000000-0000-0000-0000-000000000000","openItemType":"AP","invoiceNumber":"AP-INV-2026-0001","externalOpenItemId":"ERP-OI-AP-2026-0001","settlementSourceType":"ERP_DOCUMENT","sourceExternalSystem":"example-erp","sourceExternalDocumentId":"ERP-PAY-2026-0001","settlementType":"PAYMENT","settlementDate":"2026-04-27","amount":"1250.00","currency":"USD","status":"APPLIED","linkSource":"INTEGRATION_API","externalSystem":"example-erp","externalId":"PAY-2026-0001","metadata":{"paymentReference":"PAY-2026-0001"}}}},"required":true},"parameters":[{"schema":{"type":"string","maxLength":200},"in":"header","name":"idempotency-key","required":false,"description":"Optional caller idempotency key. Settlement writes prefer externalSystem + externalId, then resolved open-item/source natural keys."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true},"idempotency":{"type":"object","additionalProperties":false,"required":["key","replayed","requestBodyHash"],"properties":{"key":{"type":"string"},"replayed":{"type":"boolean"},"requestBodyHash":{"type":"string"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/open-item-settlements/bulk":{"post":{"summary":"Create AP/AR open-item settlement links in bulk","tags":["Integration - Open Item Settlements"],"description":"Records source evidence that a payment, receipt, bank movement, or manual event settles an AP/AR open item. It does not move money, approve reconciliation, or post accounting entries. Use PATCH /integration/v1/open-items/{openItemType}/{id} when the ERP/source also changes the open item balance or status. Validates or creates many settlement evidence rows in one all-or-nothing request. Requires full_access or transactions. Bulk requests use requestReference/clientRef for tracing and idMap building; per-row idempotency-key headers are not used.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid rows. VALIDATE_ONLY checks all rows without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting rows."},"requestReference":{"type":["string","null"],"maxLength":255,"description":"Caller batch reference echoed in the response for audit and troubleshooting."},"rows":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["clientRef","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200,"description":"Caller-supplied stable reference echoed in row results and idMap."},"data":{"type":"object","additionalProperties":false,"required":["entityId","openItemType","settlementSourceType","settlementDate","amount"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO creates the settlement link. VALIDATE_ONLY checks payload shape, references, amount, currency, and duplicates without writing."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate externalSystem/externalId or duplicate openItem/source links."},"entityId":{"type":"string","format":"uuid"},"openItemType":{"type":"string","enum":["AP","AR"]},"openItemId":{"type":["string","null"],"format":"uuid","description":"Reconcilia open-item UUID. Optional when invoiceNumber or an ERP invoice document reference resolves the open item."},"invoiceNumber":{"type":["string","null"],"description":"AP/AR invoice number used to resolve the open item when openItemId is not supplied."},"externalOpenItemId":{"type":["string","null"],"description":"Source-owned AP/AR open-item id used with externalSystem to resolve the open item when openItemId is not supplied."},"erpDocumentId":{"type":["string","null"],"format":"uuid","description":"Reconcilia ERP invoice document UUID used to resolve the open item."},"documentExternalSystem":{"type":["string","null"],"description":"External system for externalDocumentId when resolving the open item invoice. Defaults to externalSystem."},"externalDocumentId":{"type":["string","null"],"description":"External ERP invoice document id used to resolve the open item."},"docType":{"type":["string","null"],"enum":["AP_INVOICE","AR_INVOICE",null],"description":"ERP invoice document type used with docNo to resolve the open item."},"docNo":{"type":["string","null"],"description":"ERP invoice document number used with docType to resolve the open item."},"counterpartyId":{"type":["string","null"],"format":"uuid"},"counterpartyExternalSystem":{"type":["string","null"],"description":"External system for externalCounterpartyId when resolving the open item."},"externalCounterpartyId":{"type":["string","null"],"description":"External vendor/customer id used with externalSystem/counterpartyExternalSystem to narrow open-item resolution."},"counterpartyExternalId":{"type":["string","null"],"description":"Alias for externalCounterpartyId."},"settlementSourceType":{"type":"string","enum":["BANK_AUXILIARY","ERP_DOCUMENT","ERP_DOCUMENT_LINE","PAYMENT_JOURNAL_LINE","BANK_TRANSACTION","CASH_POSITION_ENTRY","MANUAL"],"description":"Allowed write values: ERP_DOCUMENT, ERP_DOCUMENT_LINE, PAYMENT_JOURNAL_LINE, BANK_TRANSACTION, CASH_POSITION_ENTRY, BANK_AUXILIARY, or MANUAL. Reconciliation-generated Card applications are read as MERCHANT_SETTLEMENT_LINE."},"settlementSourceId":{"type":["string","null"],"format":"uuid","description":"Internal source UUID. Optional when source natural/external references are supplied; unresolved external settlement evidence is allowed."},"sourceErpDocumentId":{"type":["string","null"],"format":"uuid","description":"Reconcilia ERP payment/receipt/source document UUID for settlementSourceType ERP_DOCUMENT or ERP_DOCUMENT_LINE."},"sourceDocumentExternalSystem":{"type":["string","null"],"description":"External system for sourceExternalDocumentId. Defaults to sourceExternalSystem/externalSystem."},"sourceExternalSystem":{"type":["string","null"],"description":"External system for the settlement source document or bank auxiliary source."},"sourceExternalDocumentId":{"type":["string","null"],"description":"External ERP payment/receipt/source document id used to resolve settlementSourceId."},"sourceDocType":{"type":["string","null"],"description":"Source ERP document type used with sourceDocNo."},"sourceDocNo":{"type":["string","null"],"description":"Source ERP document number used with sourceDocType."},"sourceErpDocumentLineId":{"type":["string","null"],"format":"uuid","description":"Reconcilia ERP source line UUID for settlementSourceType ERP_DOCUMENT_LINE."},"sourceErpLineId":{"type":["string","null"],"format":"uuid","description":"Alias for sourceErpDocumentLineId."},"sourceLineNo":{"type":["integer","string","null"],"description":"Source ERP line number used with a resolved source document for settlementSourceType ERP_DOCUMENT_LINE."},"bankAuxiliaryEntryId":{"type":["string","null"],"format":"uuid","description":"Reconcilia bank auxiliary entry UUID for settlementSourceType BANK_AUXILIARY."},"bankAuxiliaryExternalSystem":{"type":["string","null"],"description":"External system for bankAuxiliaryExternalId. Defaults to sourceExternalSystem/externalSystem."},"bankAuxiliaryExternalId":{"type":["string","null"],"description":"External bank auxiliary source id used to resolve settlementSourceId."},"settlementType":{"type":["string","null"],"enum":["PAYMENT","RECEIPT","CREDIT_NOTE","DEBIT_NOTE","ADJUSTMENT","REVERSAL","WRITE_OFF",null],"description":"Business meaning of the settlement evidence. Defaults to PAYMENT for AP and RECEIPT for AR."},"settlementDate":{"type":"string","format":"date"},"amount":{"type":["number","string"]},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"currencyCode":{"type":["string","null"],"minLength":3,"maxLength":3},"status":{"type":["string","null"],"enum":["PROPOSED","APPLIED","REVERSED","CANCELLED",null],"default":"APPLIED"},"assertionType":{"type":["string","null"],"enum":["RELATIONSHIP","APPLICATION",null],"default":"RELATIONSHIP","description":"RELATIONSHIP links supporting evidence. APPLICATION asserts a proposed or applied AP/AR settlement action."},"linkSource":{"type":["string","null"],"enum":["ERP","MANUAL","IMPORT","INTEGRATION_API","RECONCILIA_MATCH","AI_REVIEW","SYSTEM",null],"default":"INTEGRATION_API"},"externalSystem":{"type":["string","null"]},"externalId":{"type":["string","null"]},"metadata":{"type":["null","object"],"additionalProperties":true}},"example":{"processingMode":"VALIDATE_ONLY","conflictPolicy":"BLOCK","entityId":"00000000-0000-0000-0000-000000000000","openItemType":"AP","invoiceNumber":"AP-INV-2026-0001","externalOpenItemId":"ERP-OI-AP-2026-0001","settlementSourceType":"ERP_DOCUMENT","sourceExternalSystem":"example-erp","sourceExternalDocumentId":"ERP-PAY-2026-0001","settlementType":"PAYMENT","settlementDate":"2026-04-27","amount":"1250.00","currency":"USD","status":"APPLIED","linkSource":"INTEGRATION_API","externalSystem":"example-erp","externalId":"PAY-2026-0001","metadata":{"paymentReference":"PAY-2026-0001"}}}}}}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["processingMode","requestReference","summary","rows","idMap"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":["null","string"]},"summary":{"type":"object","additionalProperties":false,"required":["received","valid","blocked","created"],"properties":{"received":{"type":"integer"},"valid":{"type":"integer"},"blocked":{"type":"integer"},"created":{"type":"integer"}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","clientRef","status","id","errors","warnings"],"properties":{"index":{"type":"integer"},"clientRef":{"type":"string"},"status":{"type":"string","enum":["VALID","BLOCKED","CREATED"]},"id":{"type":["null","string"]},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}},"idMap":{"type":"object","additionalProperties":{"type":"string"},"description":"Maps clientRef to created settlement id for AUTO requests."}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/open-item-settlements/applications/{applicationGroupId}/acknowledge":{"post":{"summary":"Acknowledge a governed Card AP/AR application group","tags":["Integration - Open Item Settlements"],"description":"Moves every allocation edge in one Reconcilia-prepared Card application group from PROPOSED to APPLIED, or records a governed reversal/cancellation. This acknowledgement is idempotent and does not modify source Card rows or AP/AR balances/statuses. After APPLIED, send each authoritative remainder through the existing open-item endpoint. After REVERSED, use the same endpoint and applicationGroupId to restore every participating open item to its frozen pre-application balance.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["status","acknowledgementReference"],"properties":{"status":{"type":"string","enum":["APPLIED","REVERSED","CANCELLED"]},"acknowledgementReference":{"type":"string","minLength":1,"maxLength":200},"acknowledgedAt":{"type":["string","null"],"format":"date-time"},"metadata":{"type":["null","object"],"additionalProperties":true}}}}},"required":true},"parameters":[{"schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"},"in":"path","name":"applicationGroupId","required":true},{"schema":{"type":"string","maxLength":200},"in":"header","name":"idempotency-key","required":false,"description":"Optional caller idempotency key. Settlement writes prefer externalSystem + externalId, then resolved open-item/source natural keys."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["applicationGroupId","status","acknowledgementReference","acknowledgedAt","allocationCount","openItemBalanceChanged","sourceDataChanged","authoritativeOpenItemUpdateRequired"],"properties":{"applicationGroupId":{"type":"string"},"status":{"type":"string","enum":["APPLIED","REVERSED","CANCELLED"]},"acknowledgementReference":{"type":"string"},"acknowledgedAt":{"type":"string","format":"date-time"},"allocationCount":{"type":"integer"},"openItemBalanceChanged":{"type":"boolean","enum":[false]},"sourceDataChanged":{"type":"boolean","enum":[false]},"authoritativeOpenItemUpdateRequired":{"type":"boolean","description":"True for APPLIED or REVERSED because acknowledgement alone never changes the source-owned AP/AR balance."},"nextAction":{"type":["null","string"]}}},"idempotency":{"type":"object","additionalProperties":false,"required":["key","replayed","requestBodyHash"],"properties":{"key":{"type":"string"},"replayed":{"type":"boolean"},"requestBodyHash":{"type":"string"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/open-item-settlements/{id}":{"get":{"summary":"Get an AP/AR open-item settlement link","tags":["Integration - Open Item Settlements"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","openItemType","openItemId","settlementSourceType","settlementDate","amount","currencyCode","status","linkSource","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"entityId":{"type":"string","format":"uuid"},"openItemType":{"type":"string","enum":["AP","AR"]},"openItemId":{"type":"string","format":"uuid"},"settlementSourceType":{"type":"string","enum":["BANK_AUXILIARY","ERP_DOCUMENT","ERP_DOCUMENT_LINE","PAYMENT_JOURNAL_LINE","BANK_TRANSACTION","CASH_POSITION_ENTRY","MERCHANT_SETTLEMENT_LINE","MANUAL"],"description":"Allowed write values: ERP_DOCUMENT, ERP_DOCUMENT_LINE, PAYMENT_JOURNAL_LINE, BANK_TRANSACTION, CASH_POSITION_ENTRY, BANK_AUXILIARY, or MANUAL. Reconciliation-generated Card applications are read as MERCHANT_SETTLEMENT_LINE."},"settlementSourceId":{"type":["null","string"],"format":"uuid","description":"Resolved source row UUID when the settlement source exists in Reconcilia; null is allowed for unresolved external evidence."},"settlementType":{"type":"string","enum":["PAYMENT","RECEIPT","CREDIT_NOTE","DEBIT_NOTE","ADJUSTMENT","REVERSAL","WRITE_OFF"]},"settlementDate":{"type":"string","format":"date"},"amount":{"type":["number","string"]},"currencyCode":{"type":"string","minLength":3,"maxLength":3},"status":{"type":"string","enum":["PROPOSED","APPLIED","REVERSED","CANCELLED"]},"assertionType":{"type":"string","enum":["RELATIONSHIP","APPLICATION"]},"linkSource":{"type":"string","enum":["ERP","MANUAL","IMPORT","INTEGRATION_API","RECONCILIA_MATCH","AI_REVIEW","SYSTEM"]},"externalSystem":{"type":["null","string"]},"externalId":{"type":["null","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"createdByUserId":{"type":["null","string"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["null","string"],"format":"date-time"},"entities":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":"string"}}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"delete":{"summary":"Cancel an AP/AR open-item settlement link","tags":["Integration - Open Item Settlements"],"description":"Soft-cancels the settlement link by marking it CANCELLED and deleted. It does not reverse money movement, post accounting entries, or automatically reopen an open item.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["success"],"properties":{"success":{"type":"boolean"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/bank-auxiliary-entries":{"get":{"summary":"List bank auxiliary entries","tags":["Integration - Bank Auxiliary"],"description":"Returns ERP/source expected bank-ledger movements used for reconciliation, Cash Position, and Forecast evidence. Requires any integration API scope.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"id","required":false},{"schema":{"type":"string"},"in":"query","name":"focusId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"entityId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"bankAccountId","required":false},{"schema":{"type":"string"},"in":"query","name":"accountCode","required":false},{"schema":{"type":"string"},"in":"query","name":"statementAccountNumber","required":false},{"schema":{"type":"string"},"in":"query","name":"accountNumber","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"counterpartyId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"erpDocumentId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"erpDocumentLineId","required":false},{"schema":{"type":"string"},"in":"query","name":"externalSystem","required":false},{"schema":{"type":"string"},"in":"query","name":"externalId","required":false},{"schema":{"type":"string","enum":["DRAFT","READY_TO_SEND","SENT","ACKNOWLEDGED","POSTED","REJECTED","CANCELLED"]},"in":"query","name":"lifecycleStatus","required":false},{"schema":{"type":"string","enum":["INFLOW","OUTFLOW"]},"in":"query","name":"direction","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"dateFrom","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"dateTo","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"expectedDateFrom","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"expectedDateTo","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","entryDate","direction","amount","currencyCode","lifecycleStatus","source","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"entityId":{"type":"string","format":"uuid"},"bankAccountId":{"type":["null","string"],"format":"uuid"},"counterpartyId":{"type":["null","string"],"format":"uuid"},"erpDocumentId":{"type":["null","string"],"format":"uuid"},"erpDocumentLineId":{"type":["null","string"],"format":"uuid"},"externalSystem":{"type":["null","string"]},"externalId":{"type":["null","string"]},"entryDate":{"type":"string","format":"date"},"expectedSettlementDate":{"type":["null","string"],"format":"date"},"direction":{"type":"string","enum":["INFLOW","OUTFLOW"]},"amount":{"type":["number","string"]},"currencyCode":{"type":"string","minLength":3,"maxLength":3},"lifecycleStatus":{"type":"string","enum":["DRAFT","READY_TO_SEND","SENT","ACKNOWLEDGED","POSTED","REJECTED","CANCELLED"]},"externalStatus":{"type":["null","string"]},"sourceBatchId":{"type":["null","string"]},"sourceVersion":{"type":["null","string"]},"sourceUpdatedAt":{"type":["null","string"],"format":"date-time"},"asOfDate":{"type":["null","string"],"format":"date"},"generatedFromType":{"type":["null","string"]},"generatedFromId":{"type":["null","string"]},"submittedAt":{"type":["null","string"],"format":"date-time"},"acknowledgedAt":{"type":["null","string"],"format":"date-time"},"postedAt":{"type":["null","string"],"format":"date-time"},"rejectedAt":{"type":["null","string"],"format":"date-time"},"lastSyncAt":{"type":["null","string"],"format":"date-time"},"lastError":{"type":["null","string"]},"source":{"type":"string","enum":["ERP","MANUAL","IMPORT","INTEGRATION_API","SYSTEM"]},"description":{"type":["null","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["null","string"],"format":"date-time"}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Create a bank auxiliary entry","tags":["Integration - Bank Auxiliary"],"description":"Creates expected bank-ledger source data in finance.bank_auxiliary_entries. Supports account resolution by bankAccountId, accountCode, statementAccountNumber, or accountNumber. It does not move money, approve reconciliation, or create actual bank statement rows.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["entityId","entryDate","direction","amount"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO creates the bank auxiliary row. VALIDATE_ONLY checks references and duplicate policy without writing."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate active rows by externalSystem/externalId or linked ERP document line."},"entityId":{"type":"string","format":"uuid"},"bankAccountId":{"type":["string","null"],"format":"uuid","description":"Reconcilia bank-account UUID. Optional when accountCode, statementAccountNumber, or accountNumber resolves uniquely."},"accountCode":{"type":["string","null"],"description":"User-facing Account ID configured on the Reconcilia bank account."},"statementAccountNumber":{"type":["string","null"],"description":"Bank statement account identifier configured on the Reconcilia bank account. Preferred external account reference."},"accountNumber":{"type":["string","null"],"description":"Bank account number configured in Reconcilia. Used only when it resolves to exactly one account."},"counterpartyId":{"type":["string","null"],"format":"uuid"},"counterpartyExternalSystem":{"type":["string","null"],"description":"Source system for externalCounterpartyId. Defaults to externalSystem when omitted."},"externalCounterpartyId":{"type":["string","null"]},"counterpartyExternalId":{"type":["string","null"],"description":"Alias for externalCounterpartyId."},"erpDocumentId":{"type":["string","null"],"format":"uuid"},"erpDocumentLineId":{"type":["string","null"],"format":"uuid"},"externalDocumentId":{"type":["string","null"],"description":"ERP/source document id resolved together with externalSystem."},"docType":{"type":["string","null"]},"docNo":{"type":["string","null"]},"lineNo":{"type":["integer","null"],"minimum":1},"externalSystem":{"type":["string","null"],"description":"Source ERP/integration system for this bank auxiliary row and default external-reference resolution."},"externalId":{"type":["string","null"],"description":"Source-owned bank auxiliary movement id."},"entryDate":{"type":"string","format":"date"},"expectedSettlementDate":{"type":["string","null"],"format":"date"},"direction":{"type":"string","enum":["INFLOW","OUTFLOW"]},"amount":{"type":["number","string"]},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"currencyCode":{"type":["string","null"],"minLength":3,"maxLength":3},"lifecycleStatus":{"type":["string","null"],"enum":["DRAFT","READY_TO_SEND","SENT","ACKNOWLEDGED","POSTED","REJECTED","CANCELLED",null]},"externalStatus":{"type":["string","null"],"description":"Raw status from the source system. It is retained without becoming reconciliation state."},"sourceBatchId":{"type":["string","null"]},"sourceVersion":{"type":["string","null"],"description":"Caller-owned immutable source version used to reject conflicting retries."},"sourceUpdatedAt":{"type":["string","null"],"format":"date-time","description":"Caller source modification time used to reject stale updates."},"asOfDate":{"type":["string","null"],"format":"date"},"generatedFromType":{"type":["string","null"]},"generatedFromId":{"type":["string","null"]},"source":{"type":["string","null"],"enum":["ERP","MANUAL","IMPORT","INTEGRATION_API","SYSTEM",null]},"description":{"type":["string","null"]},"metadata":{"type":["null","object"],"additionalProperties":true,"description":"Optional source evidence. bankTransactionId may identify an already-reserved Bank transaction; when the row becomes POSTED, Reconcilia adopts it into that pending Merchant Settlement case only after entity, account, currency, direction, and amount controls agree."}}},"example":{"processingMode":"VALIDATE_ONLY","conflictPolicy":"BLOCK","entityId":"00000000-0000-0000-0000-000000000000","accountCode":"US01-OPER-001","externalSystem":"example-erp","externalId":"ERP-BANK-MOVE-0001","externalCounterpartyId":"VEND-001","externalDocumentId":"ERP-PAY-2026-0001","lineNo":1,"entryDate":"2026-04-27","expectedSettlementDate":"2026-04-28","direction":"OUTFLOW","amount":"1250.00","currency":"USD","description":"Vendor payment"}}},"required":true},"parameters":[{"schema":{"type":"string","maxLength":200},"in":"header","name":"idempotency-key","required":false,"description":"Optional caller idempotency key. Bank auxiliary writes prefer externalSystem + externalId when supplied."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true},"idempotency":{"type":"object","additionalProperties":false,"required":["key","replayed","requestBodyHash"],"properties":{"key":{"type":"string"},"replayed":{"type":"boolean"},"requestBodyHash":{"type":"string"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/bank-auxiliary-entries/bulk":{"post":{"summary":"Create bank auxiliary entries in bulk","tags":["Integration - Bank Auxiliary"],"description":"Validates or creates many expected bank-ledger rows in one all-or-nothing request. Requires full_access or transactions. Bulk requests use requestReference/clientRef for tracing and idMap building.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO persists valid rows. VALIDATE_ONLY checks all rows without writes."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate/conflicting rows."},"requestReference":{"type":["string","null"],"maxLength":255,"description":"Caller batch reference echoed in the response for audit and troubleshooting."},"rows":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["clientRef","data"],"properties":{"clientRef":{"type":"string","minLength":1,"maxLength":200,"description":"Caller-supplied stable reference echoed in row results and idMap."},"data":{"type":"object","additionalProperties":false,"required":["entityId","entryDate","direction","amount"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO creates the bank auxiliary row. VALIDATE_ONLY checks references and duplicate policy without writing."},"conflictPolicy":{"type":"string","enum":["BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate active rows by externalSystem/externalId or linked ERP document line."},"entityId":{"type":"string","format":"uuid"},"bankAccountId":{"type":["string","null"],"format":"uuid","description":"Reconcilia bank-account UUID. Optional when accountCode, statementAccountNumber, or accountNumber resolves uniquely."},"accountCode":{"type":["string","null"],"description":"User-facing Account ID configured on the Reconcilia bank account."},"statementAccountNumber":{"type":["string","null"],"description":"Bank statement account identifier configured on the Reconcilia bank account. Preferred external account reference."},"accountNumber":{"type":["string","null"],"description":"Bank account number configured in Reconcilia. Used only when it resolves to exactly one account."},"counterpartyId":{"type":["string","null"],"format":"uuid"},"counterpartyExternalSystem":{"type":["string","null"],"description":"Source system for externalCounterpartyId. Defaults to externalSystem when omitted."},"externalCounterpartyId":{"type":["string","null"]},"counterpartyExternalId":{"type":["string","null"],"description":"Alias for externalCounterpartyId."},"erpDocumentId":{"type":["string","null"],"format":"uuid"},"erpDocumentLineId":{"type":["string","null"],"format":"uuid"},"externalDocumentId":{"type":["string","null"],"description":"ERP/source document id resolved together with externalSystem."},"docType":{"type":["string","null"]},"docNo":{"type":["string","null"]},"lineNo":{"type":["integer","null"],"minimum":1},"externalSystem":{"type":["string","null"],"description":"Source ERP/integration system for this bank auxiliary row and default external-reference resolution."},"externalId":{"type":["string","null"],"description":"Source-owned bank auxiliary movement id."},"entryDate":{"type":"string","format":"date"},"expectedSettlementDate":{"type":["string","null"],"format":"date"},"direction":{"type":"string","enum":["INFLOW","OUTFLOW"]},"amount":{"type":["number","string"]},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"currencyCode":{"type":["string","null"],"minLength":3,"maxLength":3},"lifecycleStatus":{"type":["string","null"],"enum":["DRAFT","READY_TO_SEND","SENT","ACKNOWLEDGED","POSTED","REJECTED","CANCELLED",null]},"externalStatus":{"type":["string","null"],"description":"Raw status from the source system. It is retained without becoming reconciliation state."},"sourceBatchId":{"type":["string","null"]},"sourceVersion":{"type":["string","null"],"description":"Caller-owned immutable source version used to reject conflicting retries."},"sourceUpdatedAt":{"type":["string","null"],"format":"date-time","description":"Caller source modification time used to reject stale updates."},"asOfDate":{"type":["string","null"],"format":"date"},"generatedFromType":{"type":["string","null"]},"generatedFromId":{"type":["string","null"]},"source":{"type":["string","null"],"enum":["ERP","MANUAL","IMPORT","INTEGRATION_API","SYSTEM",null]},"description":{"type":["string","null"]},"metadata":{"type":["null","object"],"additionalProperties":true,"description":"Optional source evidence. bankTransactionId may identify an already-reserved Bank transaction; when the row becomes POSTED, Reconcilia adopts it into that pending Merchant Settlement case only after entity, account, currency, direction, and amount controls agree."}},"example":{"processingMode":"VALIDATE_ONLY","conflictPolicy":"BLOCK","entityId":"00000000-0000-0000-0000-000000000000","accountCode":"US01-OPER-001","externalSystem":"example-erp","externalId":"ERP-BANK-MOVE-0001","externalCounterpartyId":"VEND-001","externalDocumentId":"ERP-PAY-2026-0001","lineNo":1,"entryDate":"2026-04-27","expectedSettlementDate":"2026-04-28","direction":"OUTFLOW","amount":"1250.00","currency":"USD","description":"Vendor payment"}}}}}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["processingMode","requestReference","summary","rows","idMap"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"]},"requestReference":{"type":["null","string"]},"summary":{"type":"object","additionalProperties":false,"required":["received","valid","blocked","created"],"properties":{"received":{"type":"integer"},"valid":{"type":"integer"},"blocked":{"type":"integer"},"created":{"type":"integer"}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","clientRef","status","id","errors","warnings"],"properties":{"index":{"type":"integer"},"clientRef":{"type":"string"},"status":{"type":"string","enum":["VALID","BLOCKED","CREATED"]},"id":{"type":["null","string"]},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}},"idMap":{"type":"object","additionalProperties":{"type":"string"},"description":"Maps clientRef to created bank auxiliary entry id for AUTO requests."}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/bank-auxiliary-entries/{id}":{"get":{"summary":"Get a bank auxiliary entry","tags":["Integration - Bank Auxiliary"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","entryDate","direction","amount","currencyCode","lifecycleStatus","source","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"entityId":{"type":"string","format":"uuid"},"bankAccountId":{"type":["null","string"],"format":"uuid"},"counterpartyId":{"type":["null","string"],"format":"uuid"},"erpDocumentId":{"type":["null","string"],"format":"uuid"},"erpDocumentLineId":{"type":["null","string"],"format":"uuid"},"externalSystem":{"type":["null","string"]},"externalId":{"type":["null","string"]},"entryDate":{"type":"string","format":"date"},"expectedSettlementDate":{"type":["null","string"],"format":"date"},"direction":{"type":"string","enum":["INFLOW","OUTFLOW"]},"amount":{"type":["number","string"]},"currencyCode":{"type":"string","minLength":3,"maxLength":3},"lifecycleStatus":{"type":"string","enum":["DRAFT","READY_TO_SEND","SENT","ACKNOWLEDGED","POSTED","REJECTED","CANCELLED"]},"externalStatus":{"type":["null","string"]},"sourceBatchId":{"type":["null","string"]},"sourceVersion":{"type":["null","string"]},"sourceUpdatedAt":{"type":["null","string"],"format":"date-time"},"asOfDate":{"type":["null","string"],"format":"date"},"generatedFromType":{"type":["null","string"]},"generatedFromId":{"type":["null","string"]},"submittedAt":{"type":["null","string"],"format":"date-time"},"acknowledgedAt":{"type":["null","string"],"format":"date-time"},"postedAt":{"type":["null","string"],"format":"date-time"},"rejectedAt":{"type":["null","string"],"format":"date-time"},"lastSyncAt":{"type":["null","string"],"format":"date-time"},"lastError":{"type":["null","string"]},"source":{"type":"string","enum":["ERP","MANUAL","IMPORT","INTEGRATION_API","SYSTEM"]},"description":{"type":["null","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["null","string"],"format":"date-time"}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Update a bank auxiliary entry","tags":["Integration - Bank Auxiliary"],"description":"Updates source-owned expected bank-ledger state. Use status changes for lifecycle updates. It does not approve reconciliation or mutate actual bank statements.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"entityId":{"type":["string","null"],"format":"uuid","description":"Optional guard only; changing entityId is not supported."},"bankAccountId":{"type":["string","null"],"format":"uuid","description":"Reconcilia bank-account UUID. Optional when accountCode, statementAccountNumber, or accountNumber resolves uniquely."},"accountCode":{"type":["string","null"],"description":"User-facing Account ID configured on the Reconcilia bank account."},"statementAccountNumber":{"type":["string","null"],"description":"Bank statement account identifier configured on the Reconcilia bank account. Preferred external account reference."},"accountNumber":{"type":["string","null"],"description":"Bank account number configured in Reconcilia. Used only when it resolves to exactly one account."},"counterpartyId":{"type":["string","null"],"format":"uuid"},"counterpartyExternalSystem":{"type":["string","null"],"description":"Source system for externalCounterpartyId. Defaults to externalSystem when omitted."},"externalCounterpartyId":{"type":["string","null"]},"counterpartyExternalId":{"type":["string","null"],"description":"Alias for externalCounterpartyId."},"erpDocumentId":{"type":["string","null"],"format":"uuid"},"erpDocumentLineId":{"type":["string","null"],"format":"uuid"},"externalDocumentId":{"type":["string","null"],"description":"ERP/source document id resolved together with externalSystem."},"docType":{"type":["string","null"]},"docNo":{"type":["string","null"]},"lineNo":{"type":["integer","null"],"minimum":1},"externalSystem":{"type":["string","null"],"description":"Source ERP/integration system for this bank auxiliary row and default external-reference resolution."},"externalId":{"type":["string","null"],"description":"Source-owned bank auxiliary movement id."},"entryDate":{"type":"string","format":"date"},"expectedSettlementDate":{"type":["string","null"],"format":"date"},"direction":{"type":"string","enum":["INFLOW","OUTFLOW"]},"amount":{"type":["number","string"]},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"currencyCode":{"type":["string","null"],"minLength":3,"maxLength":3},"lifecycleStatus":{"type":["string","null"],"enum":["DRAFT","READY_TO_SEND","SENT","ACKNOWLEDGED","POSTED","REJECTED","CANCELLED",null]},"externalStatus":{"type":["string","null"],"description":"Raw status from the source system. It is retained without becoming reconciliation state."},"sourceBatchId":{"type":["string","null"]},"sourceVersion":{"type":["string","null"],"description":"Caller-owned immutable source version used to reject conflicting retries."},"sourceUpdatedAt":{"type":["string","null"],"format":"date-time","description":"Caller source modification time used to reject stale updates."},"asOfDate":{"type":["string","null"],"format":"date"},"generatedFromType":{"type":["string","null"]},"generatedFromId":{"type":["string","null"]},"source":{"type":["string","null"],"enum":["ERP","MANUAL","IMPORT","INTEGRATION_API","SYSTEM",null]},"description":{"type":["string","null"]},"metadata":{"type":["null","object"],"additionalProperties":true,"description":"Optional source evidence. bankTransactionId may identify an already-reserved Bank transaction; when the row becomes POSTED, Reconcilia adopts it into that pending Merchant Settlement case only after entity, account, currency, direction, and amount controls agree."}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["id","orgId","entityId","entryDate","direction","amount","currencyCode","lifecycleStatus","source","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"entityId":{"type":"string","format":"uuid"},"bankAccountId":{"type":["null","string"],"format":"uuid"},"counterpartyId":{"type":["null","string"],"format":"uuid"},"erpDocumentId":{"type":["null","string"],"format":"uuid"},"erpDocumentLineId":{"type":["null","string"],"format":"uuid"},"externalSystem":{"type":["null","string"]},"externalId":{"type":["null","string"]},"entryDate":{"type":"string","format":"date"},"expectedSettlementDate":{"type":["null","string"],"format":"date"},"direction":{"type":"string","enum":["INFLOW","OUTFLOW"]},"amount":{"type":["number","string"]},"currencyCode":{"type":"string","minLength":3,"maxLength":3},"lifecycleStatus":{"type":"string","enum":["DRAFT","READY_TO_SEND","SENT","ACKNOWLEDGED","POSTED","REJECTED","CANCELLED"]},"externalStatus":{"type":["null","string"]},"sourceBatchId":{"type":["null","string"]},"sourceVersion":{"type":["null","string"]},"sourceUpdatedAt":{"type":["null","string"],"format":"date-time"},"asOfDate":{"type":["null","string"],"format":"date"},"generatedFromType":{"type":["null","string"]},"generatedFromId":{"type":["null","string"]},"submittedAt":{"type":["null","string"],"format":"date-time"},"acknowledgedAt":{"type":["null","string"],"format":"date-time"},"postedAt":{"type":["null","string"],"format":"date-time"},"rejectedAt":{"type":["null","string"],"format":"date-time"},"lastSyncAt":{"type":["null","string"],"format":"date-time"},"lastError":{"type":["null","string"]},"source":{"type":"string","enum":["ERP","MANUAL","IMPORT","INTEGRATION_API","SYSTEM"]},"description":{"type":["null","string"]},"metadata":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["null","string"],"format":"date-time"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"delete":{"summary":"Cancel a bank auxiliary entry","tags":["Integration - Bank Auxiliary"],"description":"Soft-cancels the bank auxiliary entry by marking it CANCELLED and deleted. It does not reverse money movement, post accounting entries, or remove actual bank transactions.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["success"],"properties":{"success":{"type":"boolean"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/bank-auxiliary-entries/{id}/transmissions":{"post":{"summary":"Record a generated Bank Auxiliary lifecycle event","tags":["Integration - Bank Auxiliary"],"description":"Appends an inbound/outbound lifecycle event and updates the same Bank Auxiliary row. POSTED makes the row eligible for reconciliation. If metadata.bankTransactionId explicitly identifies a Bank transaction reserved by a pending Merchant Settlement case and the controlled fields agree, the posted row is adopted as that case book-side evidence. No event approves the reconciliation decision.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"direction":{"type":["string","null"],"enum":["OUTBOUND","INBOUND",null]},"transport":{"type":["string","null"],"enum":["API_PULL","API_PUSH","WEBHOOK","MANUAL",null]},"status":{"type":"string","enum":["PENDING","SENT","ACKNOWLEDGED","POSTED","REJECTED","FAILED","CANCELLED"]},"externalStatus":{"type":["string","null"]},"externalSystem":{"type":["string","null"]},"externalReference":{"type":["string","null"]},"requestPayload":{"type":["null","object"],"additionalProperties":true},"responsePayload":{"type":["null","object"],"additionalProperties":true},"errorMessage":{"type":["string","null"]}}}}},"required":true},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/reconciliation/suggestions":{"get":{"summary":"List reconciliation suggestions","tags":["Integration - Reconciliation"],"description":"Returns read-only bank-to-ERP reconciliation suggestions. This endpoint does not approve, reject, or create match decisions.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string"},"in":"query","name":"entityId","required":false},{"schema":{"type":"string"},"in":"query","name":"bankAccountId","required":false},{"schema":{"type":"string"},"in":"query","name":"bankTransactionId","required":false},{"schema":{"type":"string"},"in":"query","name":"erpDocumentId","required":false},{"schema":{"type":"string"},"in":"query","name":"erpLineId","required":false},{"schema":{"type":"string"},"in":"query","name":"batchId","required":false},{"schema":{"type":"number","minimum":0,"maximum":1},"in":"query","name":"minScore","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"dateFrom","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"dateTo","required":false},{"schema":{"type":"string","enum":["score","createdAt"]},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string","enum":["asc","desc"]},"in":"query","name":"sortDir","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"batchId":{"type":["null","string"]},"bankTxnId":{"type":"string"},"erpLineId":{"type":"string"},"score":{"type":"number"},"features":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"bankTransactions":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"bankAccountId":{"type":"string"},"entityId":{"type":["null","string"]},"txnDate":{"type":"string","format":"date"},"valueDate":{"type":["null","string"],"format":"date"},"amount":{"type":"number"},"currency":{"type":"string"},"description":{"type":["null","string"]},"externalId":{"type":["null","string"]},"bankRefNumber":{"type":["null","string"]},"customerRefNumber":{"type":["null","string"]},"direction":{"type":["null","string"]},"status":{"type":"string"},"sourceType":{"type":"string"},"bankAccounts":{"type":["null","object"],"additionalProperties":true}}},"erpDocumentLines":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"documentId":{"type":"string"},"lineNo":{"type":"integer"},"accountId":{"type":["null","string"]},"description":{"type":["null","string"]},"debit":{"type":"number"},"credit":{"type":"number"},"amount":{"type":["null","number"]},"metadata":{"type":["null","object"],"additionalProperties":true},"chartOfAccounts":{"type":["null","object"],"additionalProperties":true},"erpDocuments":{"type":["null","object"],"additionalProperties":true}}}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/reconciliation/suggestions/{id}":{"get":{"summary":"Get a reconciliation suggestion","tags":["Integration - Reconciliation"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"batchId":{"type":["null","string"]},"bankTxnId":{"type":"string"},"erpLineId":{"type":"string"},"score":{"type":"number"},"features":{"type":["null","object"],"additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"bankTransactions":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"bankAccountId":{"type":"string"},"entityId":{"type":["null","string"]},"txnDate":{"type":"string","format":"date"},"valueDate":{"type":["null","string"],"format":"date"},"amount":{"type":"number"},"currency":{"type":"string"},"description":{"type":["null","string"]},"externalId":{"type":["null","string"]},"bankRefNumber":{"type":["null","string"]},"customerRefNumber":{"type":["null","string"]},"direction":{"type":["null","string"]},"status":{"type":"string"},"sourceType":{"type":"string"},"bankAccounts":{"type":["null","object"],"additionalProperties":true}}},"erpDocumentLines":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"documentId":{"type":"string"},"lineNo":{"type":"integer"},"accountId":{"type":["null","string"]},"description":{"type":["null","string"]},"debit":{"type":"number"},"credit":{"type":"number"},"amount":{"type":["null","number"]},"metadata":{"type":["null","object"],"additionalProperties":true},"chartOfAccounts":{"type":["null","object"],"additionalProperties":true},"erpDocuments":{"type":["null","object"],"additionalProperties":true}}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/reconciliation/match-groups":{"get":{"summary":"List reconciliation match groups","tags":["Integration - Reconciliation"],"description":"Returns read-only reconciliation match groups and their bank/ERP lines. Decision approval is intentionally out of scope for this endpoint.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false},{"schema":{"type":"string"},"in":"query","name":"entityId","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"batchId","required":false},{"schema":{"type":"string"},"in":"query","name":"bankTransactionId","required":false},{"schema":{"type":"string"},"in":"query","name":"erpLineId","required":false},{"schema":{"type":"number","minimum":0,"maximum":1},"in":"query","name":"minConfidence","required":false},{"schema":{"type":"string","enum":["createdAt","updatedAt","confidence","diffAmount","status"]},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string","enum":["asc","desc"]},"in":"query","name":"sortDir","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"batchId":{"type":["null","string"]},"status":{"type":"string"},"totalBankAmount":{"type":["null","number"]},"totalErpAmount":{"type":["null","number"]},"diffAmount":{"type":["null","number"]},"confidence":{"type":["null","number"]},"explanation":{"type":["null","string"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"decidedBy":{"type":["null","string"]},"decidedAt":{"type":["null","string"],"format":"date-time"},"groupBankLines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"matchGroupId":{"type":"string"},"bankTxnId":{"type":"string"},"erpLineId":{"type":"string"},"amount":{"type":["null","number"]},"bankTransactions":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"bankAccountId":{"type":"string"},"entityId":{"type":["null","string"]},"txnDate":{"type":"string","format":"date"},"valueDate":{"type":["null","string"],"format":"date"},"amount":{"type":"number"},"currency":{"type":"string"},"description":{"type":["null","string"]},"externalId":{"type":["null","string"]},"bankRefNumber":{"type":["null","string"]},"customerRefNumber":{"type":["null","string"]},"direction":{"type":["null","string"]},"status":{"type":"string"},"sourceType":{"type":"string"},"bankAccounts":{"type":["null","object"],"additionalProperties":true}}},"erpDocumentLines":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"documentId":{"type":"string"},"lineNo":{"type":"integer"},"accountId":{"type":["null","string"]},"description":{"type":["null","string"]},"debit":{"type":"number"},"credit":{"type":"number"},"amount":{"type":["null","number"]},"metadata":{"type":["null","object"],"additionalProperties":true},"chartOfAccounts":{"type":["null","object"],"additionalProperties":true},"erpDocuments":{"type":["null","object"],"additionalProperties":true}}}}}},"groupErpLines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"matchGroupId":{"type":"string"},"bankTxnId":{"type":"string"},"erpLineId":{"type":"string"},"amount":{"type":["null","number"]},"bankTransactions":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"bankAccountId":{"type":"string"},"entityId":{"type":["null","string"]},"txnDate":{"type":"string","format":"date"},"valueDate":{"type":["null","string"],"format":"date"},"amount":{"type":"number"},"currency":{"type":"string"},"description":{"type":["null","string"]},"externalId":{"type":["null","string"]},"bankRefNumber":{"type":["null","string"]},"customerRefNumber":{"type":["null","string"]},"direction":{"type":["null","string"]},"status":{"type":"string"},"sourceType":{"type":"string"},"bankAccounts":{"type":["null","object"],"additionalProperties":true}}},"erpDocumentLines":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"documentId":{"type":"string"},"lineNo":{"type":"integer"},"accountId":{"type":["null","string"]},"description":{"type":["null","string"]},"debit":{"type":"number"},"credit":{"type":"number"},"amount":{"type":["null","number"]},"metadata":{"type":["null","object"],"additionalProperties":true},"chartOfAccounts":{"type":["null","object"],"additionalProperties":true},"erpDocuments":{"type":["null","object"],"additionalProperties":true}}}}}}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/reconciliation/match-groups/{id}":{"get":{"summary":"Get a reconciliation match group","tags":["Integration - Reconciliation"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"entityId":{"type":"string"},"batchId":{"type":["null","string"]},"status":{"type":"string"},"totalBankAmount":{"type":["null","number"]},"totalErpAmount":{"type":["null","number"]},"diffAmount":{"type":["null","number"]},"confidence":{"type":["null","number"]},"explanation":{"type":["null","string"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"decidedBy":{"type":["null","string"]},"decidedAt":{"type":["null","string"],"format":"date-time"},"groupBankLines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"matchGroupId":{"type":"string"},"bankTxnId":{"type":"string"},"erpLineId":{"type":"string"},"amount":{"type":["null","number"]},"bankTransactions":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"bankAccountId":{"type":"string"},"entityId":{"type":["null","string"]},"txnDate":{"type":"string","format":"date"},"valueDate":{"type":["null","string"],"format":"date"},"amount":{"type":"number"},"currency":{"type":"string"},"description":{"type":["null","string"]},"externalId":{"type":["null","string"]},"bankRefNumber":{"type":["null","string"]},"customerRefNumber":{"type":["null","string"]},"direction":{"type":["null","string"]},"status":{"type":"string"},"sourceType":{"type":"string"},"bankAccounts":{"type":["null","object"],"additionalProperties":true}}},"erpDocumentLines":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"documentId":{"type":"string"},"lineNo":{"type":"integer"},"accountId":{"type":["null","string"]},"description":{"type":["null","string"]},"debit":{"type":"number"},"credit":{"type":"number"},"amount":{"type":["null","number"]},"metadata":{"type":["null","object"],"additionalProperties":true},"chartOfAccounts":{"type":["null","object"],"additionalProperties":true},"erpDocuments":{"type":["null","object"],"additionalProperties":true}}}}}},"groupErpLines":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"matchGroupId":{"type":"string"},"bankTxnId":{"type":"string"},"erpLineId":{"type":"string"},"amount":{"type":["null","number"]},"bankTransactions":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"bankAccountId":{"type":"string"},"entityId":{"type":["null","string"]},"txnDate":{"type":"string","format":"date"},"valueDate":{"type":["null","string"],"format":"date"},"amount":{"type":"number"},"currency":{"type":"string"},"description":{"type":["null","string"]},"externalId":{"type":["null","string"]},"bankRefNumber":{"type":["null","string"]},"customerRefNumber":{"type":["null","string"]},"direction":{"type":["null","string"]},"status":{"type":"string"},"sourceType":{"type":"string"},"bankAccounts":{"type":["null","object"],"additionalProperties":true}}},"erpDocumentLines":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"documentId":{"type":"string"},"lineNo":{"type":"integer"},"accountId":{"type":["null","string"]},"description":{"type":["null","string"]},"debit":{"type":"number"},"credit":{"type":"number"},"amount":{"type":["null","number"]},"metadata":{"type":["null","object"],"additionalProperties":true},"chartOfAccounts":{"type":["null","object"],"additionalProperties":true},"erpDocuments":{"type":["null","object"],"additionalProperties":true}}}}}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/cash-position-entries":{"post":{"summary":"Create expected cash-position entries","tags":["Integration - Cash Position"],"description":"Validates or creates source-owned expected Cash Position rows for daily liquidity planning. VALIDATE_ONLY resolves account/category/counterparty references and duplicate policy without writes. AUTO creates INTEGRATION_API-owned rows only when every row is valid. This endpoint does not move money, execute payments, or approve reconciliation.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO creates source-owned Cash Position rows when every row is valid. VALIDATE_ONLY checks account, category, counterparty, duplicate, and idempotency rules without writes."},"conflictPolicy":{"type":"string","enum":["ALLOW","BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate external source references. ALLOW is available only for callers that intentionally submit non-unique expected-entry rows."},"requestReference":{"type":["string","null"],"description":"Optional batch reference used as the natural idempotency key when no idempotency-key header is supplied."},"sourceSystem":{"type":["string","null"],"description":"External system name. Defaults to the Integration API key name when omitted."},"metadata":{"type":["object","null"],"additionalProperties":true},"rows":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["valueDate","amount"],"properties":{"bankAccountId":{"type":["string","null"],"format":"uuid"},"bankAccountName":{"type":["string","null"]},"bankAccount":{"type":["string","null"]},"accountCode":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"statementAccountNumber":{"type":["string","null"]},"valueDate":{"type":["string","null"],"format":"date"},"date":{"type":["string","null"],"format":"date"},"direction":{"type":["string","null"],"enum":["INFLOW","OUTFLOW",null],"description":"Allowed values: INFLOW increases cash; OUTFLOW decreases cash. When omitted, Reconcilia infers direction from the sign of amount."},"amount":{"type":["number","string","null"]},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"sourceKind":{"type":["string","null"],"description":"Defaults to INTEGRATION_API. Use a more specific supported source kind only when the caller owns that lineage."},"sourceStatus":{"type":["string","null"],"enum":["ACTIVE","SUPERSEDED","REJECTED","ERROR",null]},"sourceSnapshot":{"type":["object","null"],"additionalProperties":true},"lockedBySource":{"type":["boolean","null"],"default":true},"status":{"type":["string","null"],"enum":["PLANNED","CONFIRMED","RECONCILED","CANCELED","CONSUMED","SUPERSEDED","ERROR",null]},"categoryDefinitionId":{"type":["string","null"],"format":"uuid"},"categoryCode":{"type":["string","null"]},"categoryName":{"type":["string","null"]},"category":{"type":["string","null"]},"counterpartyId":{"type":["string","null"],"format":"uuid"},"description":{"type":["string","null"]},"reference":{"type":["string","null"]},"externalSourceSystem":{"type":["string","null"]},"externalSourceId":{"type":["string","null"]},"metadata":{"type":["object","null"],"additionalProperties":true}}}}}},"example":{"processingMode":"VALIDATE_ONLY","conflictPolicy":"BLOCK","requestReference":"cash-position-expected-2026-05-11","sourceSystem":"example-erp","rows":[{"accountCode":"US01-OPER-001","valueDate":"2026-05-11","direction":"OUTFLOW","amount":"1250.00","currency":"USD","categoryCode":"SUPPLIER_PAYMENTS","description":"Vendor payment expected today","externalSourceId":"ERP-PAY-2026-0001"}]}}},"required":true},"parameters":[{"schema":{"type":"string","maxLength":200},"in":"header","name":"idempotency-key","required":false,"description":"Optional caller idempotency key. An explicit key takes precedence; requestReference, or externalSourceSystem + externalSourceId for single-row requests, is used only when it is absent. An identical request may retry after a server failure; reusing the key with a different body returns 409."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"properties":{"accepted":{"type":"boolean"},"processingMode":{"type":"string"},"validationDepth":{"type":"string"},"dryRun":{"type":"boolean"},"status":{"type":"string","enum":["READY","BLOCKED","IMPORTED"]},"rowCount":{"type":"integer"},"readyCount":{"type":"integer"},"createdCount":{"type":"integer"},"blockedCount":{"type":"integer"},"rows":{"type":"array","items":{"type":"object","additionalProperties":true}}}},"idempotency":{"type":"object","additionalProperties":false,"required":["key","replayed","requestBodyHash"],"properties":{"key":{"type":"string"},"replayed":{"type":"boolean"},"requestBodyHash":{"type":"string"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/forecast-inputs":{"post":{"summary":"Create Forecast manual inputs","tags":["Integration - Forecast"],"description":"Validates or creates source-owned Forecast manual input rows for liquidity planning. VALIDATE_ONLY resolves entity, account, hierarchy category, per-entity category activation, currency, and duplicate references without writes. AUTO writes rows that generated Forecast drafts can later consume as MANUAL_INPUT sources. This endpoint does not publish Forecasts, move money, or alter Cash Position.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"processingMode":{"type":"string","enum":["AUTO","VALIDATE_ONLY"],"default":"AUTO","description":"AUTO creates source-owned Forecast manual inputs when every row is valid. VALIDATE_ONLY also checks that each category definition is active for the target entity, along with entity, account, category, currency, duplicate, and idempotency rules, without writes."},"conflictPolicy":{"type":"string","enum":["ALLOW","BLOCK"],"default":"BLOCK","description":"BLOCK rejects duplicate external source references. ALLOW is available only for callers that intentionally submit non-unique planning rows."},"requestReference":{"type":["string","null"],"description":"Optional batch reference used as the preferred natural idempotency key."},"sourceSystem":{"type":["string","null"],"description":"External source name, such as an FP&A model, planning workbook, or ERP forecast feed."},"metadata":{"type":["object","null"],"additionalProperties":true},"rows":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["expectedDate","amount"],"properties":{"entityId":{"type":["string","null"],"format":"uuid"},"entityName":{"type":["string","null"]},"bankAccountId":{"type":["string","null"],"format":"uuid"},"bankAccountName":{"type":["string","null"]},"bankAccount":{"type":["string","null"]},"accountCode":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"statementAccountNumber":{"type":["string","null"]},"expectedDate":{"type":["string","null"],"format":"date"},"date":{"type":["string","null"],"format":"date"},"direction":{"type":["string","null"],"enum":["INFLOW","OUTFLOW",null],"description":"Allowed values: INFLOW increases projected cash; OUTFLOW decreases projected cash. When omitted, Reconcilia infers direction from the sign of amount."},"amount":{"type":["number","string","null"]},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"categoryNodeId":{"type":["string","null"],"format":"uuid","description":"Resolve the Forecast row to a liquidity-forecast category by categoryNodeId, categoryDefinitionId, categoryCode, categoryName, or category."},"categoryDefinitionId":{"type":["string","null"],"format":"uuid","description":"Resolve the Forecast row to a liquidity-forecast category by categoryNodeId, categoryDefinitionId, categoryCode, categoryName, or category."},"categoryCode":{"type":["string","null"],"description":"Resolve the Forecast row to a liquidity-forecast category by categoryNodeId, categoryDefinitionId, categoryCode, categoryName, or category."},"categoryName":{"type":["string","null"],"description":"Resolve the Forecast row to a liquidity-forecast category by categoryNodeId, categoryDefinitionId, categoryCode, categoryName, or category."},"category":{"type":["string","null"],"description":"Resolve the Forecast row to a liquidity-forecast category by categoryNodeId, categoryDefinitionId, categoryCode, categoryName, or category."},"hierarchyId":{"type":["string","null"],"format":"uuid"},"description":{"type":["string","null"]},"status":{"type":["string","null"],"enum":["PLANNED","CONFIRMED","RECONCILED","CANCELED","CANCELLED","CONSUMED","SUPERSEDED","ERROR",null]},"reference":{"type":["string","null"]},"externalSourceSystem":{"type":["string","null"]},"externalSourceId":{"type":["string","null"]},"metadata":{"type":["object","null"],"additionalProperties":true}}}}}},"example":{"processingMode":"VALIDATE_ONLY","conflictPolicy":"BLOCK","requestReference":"forecast-inputs-2026-05","sourceSystem":"fpna-model","rows":[{"entityName":"Sigerion ERP","accountCode":"US01-OPER-001","expectedDate":"2026-05-18","direction":"OUTFLOW","amount":"25000.00","currency":"USD","categoryCode":"PAYROLL","description":"Forecast payroll run","externalSourceId":"FPNA-2026-05-PAYROLL"}]}}},"required":true},"parameters":[{"schema":{"type":"string","maxLength":200},"in":"header","name":"idempotency-key","required":false,"description":"Optional caller idempotency key. Forecast inputs prefer requestReference, or externalSourceSystem + externalSourceId for single-row requests."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"properties":{"accepted":{"type":"boolean"},"processingMode":{"type":"string"},"validationDepth":{"type":"string"},"dryRun":{"type":"boolean"},"status":{"type":"string","enum":["READY","BLOCKED","IMPORTED"]},"rowCount":{"type":"integer"},"readyCount":{"type":"integer"},"createdCount":{"type":"integer"},"blockedCount":{"type":"integer"},"rows":{"type":"array","items":{"type":"object","additionalProperties":true}}}},"idempotency":{"type":"object","additionalProperties":false,"required":["key","replayed","requestBodyHash"],"properties":{"key":{"type":"string"},"replayed":{"type":"boolean"},"requestBodyHash":{"type":"string"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/statements":{"post":{"summary":"Submit one bank statement or transaction batch file","tags":["Integration - Statements"],"description":"Submits one CSV, MT940, MT942, CAMT.053, CAMT.052, or digital PDF payload. CSV-like files auto-detect comma, tab, semicolon, and pipe delimiters. Set processingMode=VALIDATE_ONLY for non-persisting contract/account/routing/parser validation.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["statementType","fileName","fileContent"],"properties":{"bankAccountId":{"type":["string","null"],"format":"uuid","description":"Reconcilia bank account UUID. Optional when accountCode, statementAccountNumber, accountNumber, or a deterministic account identifier inside the file resolves the account."},"accountCode":{"type":["string","null"],"description":"User-facing Account ID configured on the Reconcilia bank account."},"statementAccountNumber":{"type":["string","null"],"description":"Bank statement/source account number. Used to resolve bankAccountId without requiring Reconcilia UUIDs. For file uploads, this value can also come from account_id/statement_account_number in the file."},"accountNumber":{"type":["string","null"],"description":"Reconcilia bank account number. Used to resolve bankAccountId without requiring Reconcilia UUIDs. For file uploads, this value can also come from account_id/account_number in the file."},"statementType":{"type":"string","enum":["PRIOR_DAY","INTRADAY","TRANSACTION_BATCH"],"description":"Allowed values: PRIOR_DAY = report cadence normally used for end-of-day close evidence; INTRADAY = report cadence for same-day activity; TRANSACTION_BATCH = review-first transaction batch or historical backfill candidate. Report cadence does not override per-entry booking status."},"processingMode":{"type":["string","null"],"enum":["AUTO","REVIEW_REQUIRED","AUTO_OR_REVIEW","VALIDATE_ONLY",null],"default":"AUTO_OR_REVIEW","description":"AUTO persists or queues valid data. VALIDATE_ONLY performs contract, account, routing, parser, duplicate, and package validation without writes."},"importModeHint":{"type":["string","null"],"enum":["TRANSACTION_BATCH","HISTORICAL_BACKFILL",null]},"sourceFormat":{"type":["string","null"],"enum":["CSV","MT940","MT942","CAMT053","CAMT052","PDF",null],"description":"Allowed values: CSV = tabular statement rows; MT940 = SWIFT statement; MT942 = SWIFT interim report; CAMT053 = ISO 20022 statement; CAMT052 = ISO 20022 account report; PDF = digital PDF review-first extraction. CAMT message type and report cadence are independent from per-entry booking status."},"importProfileId":{"type":["string","null"],"format":"uuid"},"conflictPolicy":{"type":["string","null"],"enum":["BLOCK","SUPERSEDE",null],"default":"BLOCK","description":"BLOCK rejects duplicate or overlapping official statement data. SUPERSEDE intentionally replaces a supported corrected statement occurrence or backfill when the statement lifecycle allows it; canonical transaction evidence is retained. Intraday data cannot supersede an active prior-day statement for the same bank account and date and returns HTTP 409."},"fileName":{"type":"string","minLength":1},"fileContent":{"type":"string","minLength":1,"description":"Raw CSV/SWIFT/CAMT text, raw PDF data URL, or base64 PDF content. CSV-like payloads auto-detect comma, tab, semicolon, and pipe delimiters and ignore delimiters inside quoted fields."},"statementReference":{"type":["string","null"]}}},"example":{"accountCode":"US01-OPER-001","statementType":"TRANSACTION_BATCH","processingMode":"VALIDATE_ONLY","sourceFormat":"CSV","fileName":"statement.csv","statementReference":"statement-2026-04-27","fileContent":"account_id,transaction_date,value_date,amount,direction,currency,description,bank_transaction_reference,customer_ref_number,transaction_type\n1234567890,2026-04-27,2026-04-27,1250.00,INFLOW,USD,Customer payment,BNK-001,CUST-001,101054"}}},"required":true},"parameters":[{"schema":{"type":"string","maxLength":200},"in":"header","name":"idempotency-key","required":false,"description":"Optional caller idempotency key. Reusing the same key with the same body returns the original result; concurrent duplicate keys are rejected atomically. Statement writes that fail with a server error may be retried atomically with the same key and body, while client-error failures remain blocked. For statement writes this explicit header is authoritative; statementReference and externalReference are natural fallbacks when the header is absent."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"description":"Statement ingestion result or VALIDATE_ONLY validation result."}}}}}},"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"properties":{"ingestionMode":{"type":"string"},"effectiveStatementType":{"type":"string"},"balancePolicy":{"type":"string"},"balanceQuality":{"type":"string"},"duplicate":{"type":"boolean"},"importJob":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"source":{"type":"string"},"fileName":{"type":["null","string"]},"contentType":{"type":["null","string"]},"status":{"type":"string"},"rowCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]},"importPackageId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"statementType":{"type":["null","string"]},"statementDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"bankAccountId":{"type":["null","string"]},"bankAccountName":{"type":["null","string"]},"slices":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"sourceAccountIdentifier":{"type":["null","string"]},"resolvedEntityId":{"type":["null","string"]},"resolvedBankAccountId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"sourceFormat":{"type":["null","string"]},"currency":{"type":["null","string"]},"dateFrom":{"type":["null","string"],"format":"date"},"dateTo":{"type":["null","string"],"format":"date"},"rowCount":{"type":["null","integer"]},"activeRowCount":{"type":["null","integer"]},"promotedDayCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]}}}},"latestAsyncJob":{"type":["null","object"],"additionalProperties":true,"properties":{"id":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"bankStatement":{"type":["null","object"],"additionalProperties":true,"properties":{"id":{"type":"string"},"bankAccountId":{"type":"string"},"statementType":{"type":["null","string"]},"statementDate":{"type":["null","string"],"format":"date"},"periodStart":{"type":["null","string"],"format":"date"},"periodEnd":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"openingBalance":{"type":["null","string","number"]},"closingBalance":{"type":["null","string","number"]},"isAuthoritative":{"type":"boolean"},"lineCount":{"type":["null","integer"]}}},"importedCount":{"type":"integer"},"duplicateCount":{"type":"integer"},"supersededIntradayCount":{"type":"integer","deprecated":true,"description":"Legacy compatibility counter from the former row-supersession lifecycle. It never represents deleted canonical Bank Transactions; current canonical-preservation paths retain transaction identity and supersede only statement or import occurrences."},"categorizedLineCount":{"type":"integer"},"taggedLineCount":{"type":"integer"},"asyncJob":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"validation":{"type":"object","additionalProperties":false,"required":["valid","accepted","processingMode","validationDepth","checks","warnings","normalized"],"properties":{"valid":{"type":"boolean"},"accepted":{"type":"boolean","enum":[false]},"processingMode":{"type":"string","enum":["VALIDATE_ONLY"]},"validationDepth":{"type":"string"},"checks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","status","message"],"properties":{"code":{"type":"string"},"status":{"type":"string","enum":["PASSED","WARNING","FAILED"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}},"warnings":{"type":"array","items":{"type":"string"}},"normalized":{"type":"object","additionalProperties":true}}},"bankAuxiliaryAutomation":{"type":"object","additionalProperties":false,"required":["attemptedCount","confirmedCount","alreadyConfirmedCount","skippedCount","failedCount","warnings"],"properties":{"attemptedCount":{"type":"integer"},"confirmedCount":{"type":"integer"},"alreadyConfirmedCount":{"type":"integer"},"skippedCount":{"type":"integer"},"failedCount":{"type":"integer"},"warnings":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["bankTransactionId","code","message"],"properties":{"bankTransactionId":{"type":"string"},"code":{"type":"string","enum":["BANK_AUXILIARY_AUTO_CONFIRMATION_FAILED"]},"message":{"type":"string"}}}}}},"notes":{"type":"array","items":{"type":"string"}},"idempotency":{"type":"object","additionalProperties":false,"properties":{"key":{"type":"string"},"replayed":{"type":"boolean"},"requestBodyHash":{"type":"string"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/statements/direct":{"post":{"summary":"Submit a direct JSON statement or balance payload","tags":["Integration - Statements"],"description":"Accepts direct JSON prior-day, intraday, or transaction-batch payloads for API-first bank sources. Optional per-row bookingStatus is independent from report timing. Prior-day payloads without balances require an explicit risk balancePolicy and are not authoritative close anchors.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["statementType","statementDate"],"properties":{"bankAccountId":{"type":["string","null"],"format":"uuid","description":"Reconcilia bank account UUID. Optional when accountCode, statementAccountNumber, or accountNumber resolves the account."},"accountCode":{"type":["string","null"],"description":"User-facing Account ID configured on the Reconcilia bank account."},"statementAccountNumber":{"type":["string","null"],"description":"Bank statement/source account number. Used to resolve bankAccountId without requiring Reconcilia UUIDs."},"accountNumber":{"type":["string","null"],"description":"Reconcilia bank account number. Used to resolve bankAccountId without requiring Reconcilia UUIDs."},"statementType":{"type":"string","enum":["PRIOR_DAY","INTRADAY","TRANSACTION_BATCH"],"description":"Allowed values: PRIOR_DAY = report cadence normally used for end-of-day close evidence; INTRADAY = report cadence for same-day activity; TRANSACTION_BATCH = review-first transaction batch or historical backfill candidate. Report cadence does not override per-entry booking status."},"processingMode":{"type":["string","null"],"enum":["AUTO","REVIEW_REQUIRED","AUTO_OR_REVIEW","VALIDATE_ONLY",null],"default":"AUTO_OR_REVIEW","description":"AUTO persists or queues valid data. VALIDATE_ONLY performs contract, account, routing, parser, duplicate, and package validation without writes."},"balancePolicy":{"type":["string","null"],"enum":["REQUIRE_BALANCE","ALLOW_WITH_WARNING","FORCE_ACCEPT_WITH_RISK",null],"default":"REQUIRE_BALANCE"},"balanceQuality":{"type":["string","null"],"enum":["AUTHORITATIVE","PROVISIONAL","MISSING","FORCED_ACCEPTED",null]},"statementDate":{"type":"string","format":"date"},"asOf":{"type":["string","null"],"format":"date-time"},"currency":{"type":["string","null"]},"openingBalance":{"type":["number","string","null"]},"closingBalance":{"type":["number","string","null"]},"currentBalance":{"type":["number","string","null"]},"availableBalance":{"type":["number","string","null"]},"limitAmount":{"type":["number","string","null"]},"statementReference":{"type":["string","null"]},"externalReference":{"type":["string","null"]},"conflictPolicy":{"type":["string","null"],"enum":["BLOCK","SUPERSEDE",null],"default":"BLOCK","description":"BLOCK rejects duplicate or overlapping official statement data. SUPERSEDE intentionally replaces a supported corrected statement occurrence or backfill when the statement lifecycle allows it; canonical transaction evidence is retained. Intraday data cannot supersede an active prior-day statement for the same bank account and date and returns HTTP 409."},"transactions":{"type":"array","maxItems":10000,"items":{"type":"object","additionalProperties":false,"required":["amount","description"],"properties":{"transactionDate":{"type":["string","null"],"format":"date"},"valueDate":{"type":["string","null"],"format":"date"},"amount":{"type":["number","string"]},"direction":{"type":["string","null"],"enum":["INFLOW","OUTFLOW",null],"description":"Allowed values: INFLOW increases cash; OUTFLOW decreases cash. When direction is omitted, supported endpoints infer it from the sign of amount."},"currency":{"type":["string","null"]},"description":{"type":"string","minLength":1},"bankTransactionReference":{"type":["string","null"]},"customerRefNumber":{"type":["string","null"]},"bookingStatus":{"type":["string","null"],"enum":["PENDING","BOOKED","UNKNOWN",null],"description":"Booking evidence for this movement. BOOKED can make an intraday observation reconcilable; PENDING or UNKNOWN cannot demote a movement already booked."},"correctionOfReference":{"type":["string","null"],"description":"Bank reference of a corrected movement. The correction remains a linked event and does not delete prior evidence."},"reversalOfReference":{"type":["string","null"],"description":"Bank reference of a reversed movement. The reversal remains a linked event and does not delete prior evidence."},"transactionType":{"type":["string","null"],"description":"Canonical JSON field for the source bank transaction code or movement code. Stored as transaction_type and used by bank-account classification profiles when sourceField=transaction_type."},"bankCode":{"type":["string","null"],"description":"Optional input alias for transactionType. Prefer transactionType in JSON payloads."},"runningBalance":{"type":["number","string","null"]}}},"description":"Optional direct transaction rows. Rows reuse the same promotion rules as file imports."}}},"example":{"accountCode":"US01-OPER-001","statementType":"TRANSACTION_BATCH","processingMode":"VALIDATE_ONLY","statementDate":"2026-04-27","currency":"USD","statementReference":"direct-json-2026-04-27","transactions":[{"transactionDate":"2026-04-27","valueDate":"2026-04-27","amount":"1250.00","direction":"INFLOW","currency":"USD","description":"Customer payment","bankTransactionReference":"BNK-001","transactionType":"101054"}]}}},"required":true},"parameters":[{"schema":{"type":"string","maxLength":200},"in":"header","name":"idempotency-key","required":false,"description":"Optional caller idempotency key. Reusing the same key with the same body returns the original result; concurrent duplicate keys are rejected atomically. Statement writes that fail with a server error may be retried atomically with the same key and body, while client-error failures remain blocked. For statement writes this explicit header is authoritative; statementReference and externalReference are natural fallbacks when the header is absent."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"description":"Statement ingestion result or VALIDATE_ONLY validation result."}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/files":{"post":{"summary":"Submit a multi-file statement package","tags":["Integration - Files"],"description":"Queues an async package for multiple statement files. Set processingMode=VALIDATE_ONLY for non-persisting package contract/scope/routing/parser validation.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["files"],"properties":{"defaultEntityId":{"type":["string","null"]},"defaultBankAccountId":{"type":["string","null"],"format":"uuid","description":"Reconcilia bank account UUID used as package default. Optional when defaultAccountCode/defaultStatementAccountNumber/defaultAccountNumber resolves it."},"defaultAccountCode":{"type":["string","null"],"description":"Default user-facing Account ID for package routing."},"defaultStatementAccountNumber":{"type":["string","null"],"description":"Default bank statement/source account number for package routing."},"defaultAccountNumber":{"type":["string","null"],"description":"Default Reconcilia bank account number for package routing."},"processingMode":{"type":["string","null"],"enum":["AUTO","REVIEW_REQUIRED","AUTO_OR_REVIEW","VALIDATE_ONLY",null],"default":"AUTO_OR_REVIEW","description":"AUTO persists or queues valid data. VALIDATE_ONLY performs contract, account, routing, parser, duplicate, and package validation without writes."},"files":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","additionalProperties":false,"required":["fileName","fileContent","statementType"],"properties":{"fileName":{"type":"string","minLength":1},"fileContent":{"type":"string","minLength":1,"description":"Raw CSV/SWIFT/CAMT text, raw PDF data URL, or base64 PDF content. CSV-like payloads auto-detect comma, tab, semicolon, and pipe delimiters and ignore delimiters inside quoted fields."},"contentType":{"type":["string","null"]},"statementType":{"type":"string","enum":["PRIOR_DAY","INTRADAY","TRANSACTION_BATCH"],"description":"Allowed values: PRIOR_DAY = report cadence normally used for end-of-day close evidence; INTRADAY = report cadence for same-day activity; TRANSACTION_BATCH = review-first transaction batch or historical backfill candidate. Report cadence does not override per-entry booking status."},"importModeHint":{"type":["string","null"],"enum":["TRANSACTION_BATCH","HISTORICAL_BACKFILL",null]},"sourceFormat":{"type":["string","null"],"enum":["CSV","MT940","MT942","CAMT053","CAMT052","PDF",null],"description":"Allowed values: CSV = tabular statement rows; MT940 = SWIFT statement; MT942 = SWIFT interim report; CAMT053 = ISO 20022 statement; CAMT052 = ISO 20022 account report; PDF = digital PDF review-first extraction. CAMT message type and report cadence are independent from per-entry booking status."}}}}}},"example":{"defaultAccountCode":"US01-OPER-001","processingMode":"VALIDATE_ONLY","files":[{"fileName":"account-1234567890.csv","fileContent":"account_id,transaction_date,value_date,amount,direction,currency,description,bank_transaction_reference,customer_ref_number,transaction_type\n1234567890,2026-04-27,2026-04-27,1250.00,INFLOW,USD,Customer payment,BNK-001,CUST-001,101054","statementType":"TRANSACTION_BATCH","sourceFormat":"CSV"}]}}},"required":true},"parameters":[{"schema":{"type":"string","maxLength":200},"in":"header","name":"idempotency-key","required":false,"description":"Optional caller idempotency key. Reusing the same key with the same body returns the original result; concurrent duplicate keys are rejected atomically. Statement writes that fail with a server error may be retried atomically with the same key and body, while client-error failures remain blocked. For statement writes this explicit header is authoritative; statementReference and externalReference are natural fallbacks when the header is absent."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["valid","accepted","processingMode","validationDepth","checks","warnings","normalized"],"properties":{"valid":{"type":"boolean"},"accepted":{"type":"boolean","enum":[false]},"processingMode":{"type":"string","enum":["VALIDATE_ONLY"]},"validationDepth":{"type":"string"},"checks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","status","message"],"properties":{"code":{"type":"string"},"status":{"type":"string","enum":["PASSED","WARNING","FAILED"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}},"warnings":{"type":"array","items":{"type":"string"}},"normalized":{"type":"object","additionalProperties":true}}}}}}}},"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"source":{"type":"string"},"status":{"type":"string"},"defaultEntityId":{"type":["null","string"]},"defaultEntityName":{"type":["null","string"]},"defaultBankAccountId":{"type":["null","string"]},"defaultBankAccountName":{"type":["null","string"]},"fileCount":{"type":"integer"},"completedFileCount":{"type":"integer"},"failedFileCount":{"type":"integer"},"errorMessage":{"type":["null","string"]},"latestAsyncJob":{"type":["null","object"],"additionalProperties":true,"properties":{"id":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"files":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"source":{"type":"string"},"fileName":{"type":["null","string"]},"contentType":{"type":["null","string"]},"status":{"type":"string"},"rowCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]},"importPackageId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"statementType":{"type":["null","string"]},"statementDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"bankAccountId":{"type":["null","string"]},"bankAccountName":{"type":["null","string"]},"slices":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"sourceAccountIdentifier":{"type":["null","string"]},"resolvedEntityId":{"type":["null","string"]},"resolvedBankAccountId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"sourceFormat":{"type":["null","string"]},"currency":{"type":["null","string"]},"dateFrom":{"type":["null","string"],"format":"date"},"dateTo":{"type":["null","string"],"format":"date"},"rowCount":{"type":["null","integer"]},"activeRowCount":{"type":["null","integer"]},"promotedDayCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]}}}},"latestAsyncJob":{"type":["null","object"],"additionalProperties":true,"properties":{"id":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"get":{"summary":"List submitted file packages","tags":["Integration - Files"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false,"description":"Opaque cursor returned by the previous list response."},{"schema":{"type":"string"},"in":"query","name":"bankAccountId","required":false},{"schema":{"type":"string","enum":["QUEUED","RUNNING","COMPLETED","COMPLETED_WITH_ISSUES","FAILED"]},"in":"query","name":"status","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"source":{"type":"string"},"status":{"type":"string"},"defaultEntityId":{"type":["null","string"]},"defaultEntityName":{"type":["null","string"]},"defaultBankAccountId":{"type":["null","string"]},"defaultBankAccountName":{"type":["null","string"]},"fileCount":{"type":"integer"},"completedFileCount":{"type":"integer"},"failedFileCount":{"type":"integer"},"errorMessage":{"type":["null","string"]},"latestAsyncJob":{"type":["null","object"],"additionalProperties":true,"properties":{"id":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"files":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"source":{"type":"string"},"fileName":{"type":["null","string"]},"contentType":{"type":["null","string"]},"status":{"type":"string"},"rowCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]},"importPackageId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"statementType":{"type":["null","string"]},"statementDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"bankAccountId":{"type":["null","string"]},"bankAccountName":{"type":["null","string"]},"slices":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"sourceAccountIdentifier":{"type":["null","string"]},"resolvedEntityId":{"type":["null","string"]},"resolvedBankAccountId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"sourceFormat":{"type":["null","string"]},"currency":{"type":["null","string"]},"dateFrom":{"type":["null","string"],"format":"date"},"dateTo":{"type":["null","string"],"format":"date"},"rowCount":{"type":["null","integer"]},"activeRowCount":{"type":["null","integer"]},"promotedDayCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]}}}},"latestAsyncJob":{"type":["null","object"],"additionalProperties":true,"properties":{"id":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}}}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/files/{id}":{"get":{"summary":"Get a submitted file package","tags":["Integration - Files"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"source":{"type":"string"},"status":{"type":"string"},"defaultEntityId":{"type":["null","string"]},"defaultEntityName":{"type":["null","string"]},"defaultBankAccountId":{"type":["null","string"]},"defaultBankAccountName":{"type":["null","string"]},"fileCount":{"type":"integer"},"completedFileCount":{"type":"integer"},"failedFileCount":{"type":"integer"},"errorMessage":{"type":["null","string"]},"latestAsyncJob":{"type":["null","object"],"additionalProperties":true,"properties":{"id":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"files":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"source":{"type":"string"},"fileName":{"type":["null","string"]},"contentType":{"type":["null","string"]},"status":{"type":"string"},"rowCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]},"importPackageId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"statementType":{"type":["null","string"]},"statementDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"bankAccountId":{"type":["null","string"]},"bankAccountName":{"type":["null","string"]},"slices":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"sourceAccountIdentifier":{"type":["null","string"]},"resolvedEntityId":{"type":["null","string"]},"resolvedBankAccountId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"sourceFormat":{"type":["null","string"]},"currency":{"type":["null","string"]},"dateFrom":{"type":["null","string"],"format":"date"},"dateTo":{"type":["null","string"],"format":"date"},"rowCount":{"type":["null","integer"]},"activeRowCount":{"type":["null","integer"]},"promotedDayCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]}}}},"latestAsyncJob":{"type":["null","object"],"additionalProperties":true,"properties":{"id":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/jobs":{"get":{"summary":"List statement import jobs","tags":["Integration - Jobs"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false,"description":"Opaque cursor returned by the previous list response."},{"schema":{"type":"string"},"in":"query","name":"bankAccountId","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"string","enum":["PRIOR_DAY","INTRADAY","TRANSACTION_BATCH"]},"in":"query","name":"statementType","required":false},{"schema":{"type":"string","enum":["PRIOR_DAY","INTRADAY","TRANSACTION_BATCH","HISTORICAL_BACKFILL"]},"in":"query","name":"importMode","required":false},{"schema":{"type":"string","enum":["INGESTED","REVIEW","BLOCKED","READY","PROMOTED","SUPERSEDED","DELETED"]},"in":"query","name":"workflowState","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"source":{"type":"string"},"fileName":{"type":["null","string"]},"contentType":{"type":["null","string"]},"status":{"type":"string"},"rowCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]},"importPackageId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"statementType":{"type":["null","string"]},"statementDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"bankAccountId":{"type":["null","string"]},"bankAccountName":{"type":["null","string"]},"slices":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"sourceAccountIdentifier":{"type":["null","string"]},"resolvedEntityId":{"type":["null","string"]},"resolvedBankAccountId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"sourceFormat":{"type":["null","string"]},"currency":{"type":["null","string"]},"dateFrom":{"type":["null","string"],"format":"date"},"dateTo":{"type":["null","string"],"format":"date"},"rowCount":{"type":["null","integer"]},"activeRowCount":{"type":["null","integer"]},"promotedDayCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]}}}},"latestAsyncJob":{"type":["null","object"],"additionalProperties":true,"properties":{"id":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/jobs/{id}":{"get":{"summary":"Get one statement import job","tags":["Integration - Jobs"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"source":{"type":"string"},"fileName":{"type":["null","string"]},"contentType":{"type":["null","string"]},"status":{"type":"string"},"rowCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]},"importPackageId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"statementType":{"type":["null","string"]},"statementDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"bankAccountId":{"type":["null","string"]},"bankAccountName":{"type":["null","string"]},"slices":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"sourceAccountIdentifier":{"type":["null","string"]},"resolvedEntityId":{"type":["null","string"]},"resolvedBankAccountId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"sourceFormat":{"type":["null","string"]},"currency":{"type":["null","string"]},"dateFrom":{"type":["null","string"],"format":"date"},"dateTo":{"type":["null","string"],"format":"date"},"rowCount":{"type":["null","integer"]},"activeRowCount":{"type":["null","integer"]},"promotedDayCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]}}}},"latestAsyncJob":{"type":["null","object"],"additionalProperties":true,"properties":{"id":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/jobs/{id}/promote-async":{"post":{"summary":"Queue async promotion for a review job or slice","tags":["Integration - Jobs"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"anchorDate":{"type":["string","null"],"format":"date"},"anchorKind":{"type":["string","null"],"enum":["OPENING","CLOSING",null]},"anchorBalance":{"type":["number","string","null"]},"conflictPolicy":{"type":["string","null"],"enum":["BLOCK","SUPERSEDE",null]}}}}}},"parameters":[{"schema":{"type":"string"},"in":"query","name":"importSliceId","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"properties":{"importJob":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"source":{"type":"string"},"fileName":{"type":["null","string"]},"contentType":{"type":["null","string"]},"status":{"type":"string"},"rowCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]},"importPackageId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"statementType":{"type":["null","string"]},"statementDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"bankAccountId":{"type":["null","string"]},"bankAccountName":{"type":["null","string"]},"slices":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"sourceAccountIdentifier":{"type":["null","string"]},"resolvedEntityId":{"type":["null","string"]},"resolvedBankAccountId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"sourceFormat":{"type":["null","string"]},"currency":{"type":["null","string"]},"dateFrom":{"type":["null","string"],"format":"date"},"dateTo":{"type":["null","string"],"format":"date"},"rowCount":{"type":["null","integer"]},"activeRowCount":{"type":["null","integer"]},"promotedDayCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]}}}},"latestAsyncJob":{"type":["null","object"],"additionalProperties":true,"properties":{"id":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"asyncJob":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"notes":{"type":"array","items":{"type":"string"}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/jobs/{id}/retry":{"post":{"summary":"Retry failed file processing for an import job","tags":["Integration - Jobs"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"properties":{"importJob":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"source":{"type":"string"},"fileName":{"type":["null","string"]},"contentType":{"type":["null","string"]},"status":{"type":"string"},"rowCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]},"importPackageId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"statementType":{"type":["null","string"]},"statementDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"bankAccountId":{"type":["null","string"]},"bankAccountName":{"type":["null","string"]},"slices":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"sourceAccountIdentifier":{"type":["null","string"]},"resolvedEntityId":{"type":["null","string"]},"resolvedBankAccountId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"sourceFormat":{"type":["null","string"]},"currency":{"type":["null","string"]},"dateFrom":{"type":["null","string"],"format":"date"},"dateTo":{"type":["null","string"],"format":"date"},"rowCount":{"type":["null","integer"]},"activeRowCount":{"type":["null","integer"]},"promotedDayCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]}}}},"latestAsyncJob":{"type":["null","object"],"additionalProperties":true,"properties":{"id":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"asyncJob":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"notes":{"type":"array","items":{"type":"string"}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/jobs/{id}/slices/{sliceId}/retry-promotion":{"post":{"summary":"Retry failed async promotion for an import slice","tags":["Integration - Jobs"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"sliceId","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"properties":{"importJob":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"source":{"type":"string"},"fileName":{"type":["null","string"]},"contentType":{"type":["null","string"]},"status":{"type":"string"},"rowCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]},"importPackageId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"statementType":{"type":["null","string"]},"statementDate":{"type":["null","string"],"format":"date"},"currency":{"type":["null","string"]},"bankAccountId":{"type":["null","string"]},"bankAccountName":{"type":["null","string"]},"slices":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"sourceAccountIdentifier":{"type":["null","string"]},"resolvedEntityId":{"type":["null","string"]},"resolvedBankAccountId":{"type":["null","string"]},"importMode":{"type":["null","string"]},"workflowState":{"type":["null","string"]},"sourceFormat":{"type":["null","string"]},"currency":{"type":["null","string"]},"dateFrom":{"type":["null","string"],"format":"date"},"dateTo":{"type":["null","string"],"format":"date"},"rowCount":{"type":["null","integer"]},"activeRowCount":{"type":["null","integer"]},"promotedDayCount":{"type":["null","integer"]},"errorMessage":{"type":["null","string"]}}}},"latestAsyncJob":{"type":["null","object"],"additionalProperties":true,"properties":{"id":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"asyncJob":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"}}},"notes":{"type":"array","items":{"type":"string"}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/integration/v1/logs":{"get":{"summary":"List async processing logs for integration imports","tags":["Integration - Logs"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"pageToken","required":false,"description":"Opaque cursor returned by the previous list response."},{"schema":{"type":"string"},"in":"query","name":"jobId","required":false},{"schema":{"type":"string"},"in":"query","name":"packageId","required":false},{"schema":{"type":"string","enum":["QUEUED","RUNNING","SUCCEEDED","FAILED"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","enum":["IMPORT_PACKAGE_FILE_PROCESSING","PDF_STATEMENT_EXTRACTION","TRANSACTION_BATCH_PROMOTION","POST_IMPORT_CATEGORIZATION"]},"in":"query","name":"jobType","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","nextPageToken"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"orgId":{"type":"string"},"jobType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"errorMessage":{"type":["null","string"]},"runAfter":{"type":["null","string"],"format":"date-time"},"startedAt":{"type":["null","string"],"format":"date-time"},"finishedAt":{"type":["null","string"],"format":"date-time"},"importPackageId":{"type":["null","string"]},"importJobId":{"type":["null","string"]},"documentId":{"type":["null","string"]},"createdAt":{"type":["null","string"],"format":"date-time"},"updatedAt":{"type":["null","string"],"format":"date-time"}}}},"nextPageToken":{"type":["null","string"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}}},"servers":[{"url":"/"}],"security":[{"apiKeyAuth":[]}],"tags":[{"name":"Integration - Support","description":"OpenAPI JSON and bilingual support metadata for partners and implementers."},{"name":"Integration - Entities","description":"Tenant legal entities. Create these first so bank accounts, GL accounts, and source data can resolve entity scope."},{"name":"Integration - Bank Accounts","description":"Manual or API-managed bank accounts with deterministic account identifiers used by statement and planning feeds."},{"name":"Integration - GL","description":"Chart-of-account master data used by ERP documents, payment journals, generated journal entries, and rules."},{"name":"Integration - Counterparties","description":"Customers, vendors, employees, banks, and other parties used by ERP/payment source data and matching. Responses return Reconcilia UUIDs and first-class externalSystem/externalCounterpartyId mapping fields."},{"name":"Integration - Categories","description":"Category definitions, hierarchies, and nodes for controlled implementation setup, external category-code alignment, and Reconcilia category id lookup."},{"name":"Integration - ERP Documents","description":"ERP source documents, generated journal-entry pull, and ERP lifecycle transmission callbacks. Header counterparty identifies the document party; line counterparty identifies allocation/payment parties."},{"name":"Integration - Open Items","description":"AP vendor payables and AR customer receivables linked to ERP source documents. Create/update endpoints maintain invoice settlement state only; they do not move money or approve reconciliation."},{"name":"Integration - Open Item Settlements","description":"Settlement evidence links between AP/AR open items and payment, receipt, bank, Cash Position, or manual source rows. These endpoints do not move money, approve reconciliation, or post accounting entries."},{"name":"Integration - Bank Auxiliary","description":"ERP/TMS-owned expected bank-ledger movements used as reconciliation evidence against imported bank statements. These endpoints do not move money or create actual bank statement rows."},{"name":"Integration - Payment Journals","description":"Row-shaped payment source data and read endpoints for pending payment visibility."},{"name":"Integration - Statements","description":"Direct JSON and single-file bank statement ingestion with validation-only and write modes."},{"name":"Integration - Files","description":"Multi-file package submission for statement files, including partial resolution and package-level jobs."},{"name":"Integration - Jobs","description":"Import jobs, package file jobs, retry, review, and promotion lifecycle visibility."},{"name":"Integration - Logs","description":"Partner-visible processing logs for async ingestion and operational follow-up."},{"name":"Integration - Cash Position","description":"Expected Cash Position source rows owned by external systems."},{"name":"Integration - Forecast","description":"Forecast manual-input source rows owned by planning systems, workbooks, or external TMS feeds."},{"name":"Integration - Reconciliation","description":"Read-only reconciliation suggestions and match group visibility for external observability."}],"externalDocs":{"description":"Bilingual Integration API support metadata","url":"/integration/v1/support"}}