> For the complete documentation index, see [llms.txt](https://developer.celigo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.celigo.com/api/api-reference/b2b-manager/edi-transactions.md).

# EDI Transactions

Query the EDI transaction log surfaced by the B2B Manager dashboard.

Each record represents a single EDI document (one X12 transaction set or one EDIFACT message) that was processed through a Celigo flow. The envelope metadata (sender/receiver IDs, control numbers, document type, functional acknowledgement status) is extracted during flow execution and indexed so the B2B dashboard can render filterable activity lists.

Requires a B2B / EDI license on the account.

### EDI transaction schema

## The EDITransaction object

```json
{"openapi":"3.2.0","info":{"title":"EDI Transactions","version":"1.0.0"},"components":{"schemas":{"EDITransaction":{"type":"object","required":["_id","_userId","fileType","documentType","direction","faStatus","s3Key","lastModified","controlNumber"],"description":"A single EDI transaction record indexed by the B2B Manager dashboard.\n\nRepresents one EDI document — one X12 transaction set (e.g. a single 850\npurchase order) or one EDIFACT message (e.g. a single ORDERS message) —\nprocessed through a Celigo flow. Envelope metadata is extracted from the\nISA/GS (X12) or UNB/UNG (EDIFACT) segments at flow execution time.\nX12 and EDIFACT records share common fields (`_id`, `documentType`,\n`direction`, `faStatus`, etc.) but use different field names for\nsender/receiver IDs and control numbers — see individual field\ndescriptions.\n\nTransaction records are retained for the account's data retention period\n(`dataRetentionPeriod` on account settings: 30, 60, 90 or 180 days after\nlast modification; the license sets the ceiling) and then expire; expired\ntransactions no longer appear in query results. Unlike most resources, these records\nare not soft-deleted into the recycle bin, and `createdAt` / `deletedAt`\nare not returned.","properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the transaction record."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the record was last updated (e.g. by an faStatus\nchange). Also restarts the retention window — the record is kept for\nthe account's `dataRetentionPeriod` (30, 60, 90 or 180 days) after\nthis timestamp, so a record can outlive the raw file behind it, whose\nperiod counts from when the file was stored."},"_userId":{"type":"string","format":"objectId","description":"Owning account user ID."},"_integrationId":{"type":"string","format":"objectId","description":"Integration that processed this transaction. Omitted on records whose\nflow ran outside an integration context."},"_flowJobId":{"type":"string","format":"objectId","description":"Flow-run Job ID that produced this record. Combine with `s3Key` and\n`POST /v1/jobs/{_flowJobId}/files/signedURL` (body\n`{ \"fileIds\": [\"<s3Key>\"] }`) to download the raw EDI file."},"_faFlowJobId":{"type":"string","format":"objectId","description":"Job ID of the flow run that processed the functional acknowledgement\n(997 / CONTRL) for this transaction. Present only once an FA has been\nreceived and processed. Use this job — not `_flowJobId` — with\n`POST /v1/jobs/{_faFlowJobId}/files/signedURL` (body\n`{ \"fileIds\": [\"<faS3Key>\"] }`) to download the FA file."},"fileType":{"type":"string","enum":["X12","EDIFACT"],"description":"EDI standard family of this transaction."},"documentType":{"type":"string","description":"EDI document type. X12: usually the numeric transaction-set ID as a\nstring (`\"850\"`, `\"810\"`, `\"856\"`, `\"997\"`). EDIFACT: UNH01 message\ntype (`\"ORDERS\"`, `\"INVOIC\"`, `\"DESADV\"`, `\"CONTRL\"`). Not a closed\nset — file definitions can supply partner-specific document codes\ninstead (e.g. `\"PO\"`, `\"SH\"`, `\"IB\"`, `\"OSTRPT\"`), so treat this as a\nfree-form label."},"documentNumber":{"type":"string","description":"Business document number extracted from the transaction set\n(e.g. purchase-order number from BEG03 in an 850 / BGM02 in an\nORDERS). Omitted when the document carries no business number or the\nfile definition does not extract one — most functional\nacknowledgements (997 / CONTRL / FA) and many status or inventory\ndocuments. May also be an empty string."},"referenceDocumentNumber":{"type":"array","description":"Business documents this one refers back to, each as an upper-cased\n`<qualifier> <number>` string — for example the purchase order an\n856 ASN or 810 invoice fulfils. Links the documents of one order\nlifecycle together. Present only when the file definition extracted\nat least one reference.","items":{"type":"string"}},"lifecycleStatus":{"type":"string","enum":["PO received","PO sent","PO Ack received","PO Ack sent","PO change req received","PO change req sent","ASN received","ASN sent","Invoice received","Invoice sent","Payment received","Payment sent"],"description":"Order-lifecycle step this document represents, derived from\n`documentType` and `direction`. Absent when the document type is\noutside the order cycle (functional acknowledgements, inventory and\nstatus documents) and on records that predate lifecycle tracking."},"tradingPartnerName":{"type":"string","description":"Display name of the trading partner the document was exchanged with.\nPresent only when the flow resolved the partner; drives the partner\nfilter of the B2B Manager dashboard."},"partnerPairKey":{"type":"string","description":"Upper-cased key identifying the trading-partner pair that exchanged\nthe document, shared by every document of that pair so an order\nlifecycle can be followed across documents together with\n`referenceDocumentNumber`. Present only when the flow resolved the\npartner."},"direction":{"type":"string","enum":["Inbound","Outbound"],"description":"Whether the document was received from or sent to a trading partner."},"faStatus":{"type":"string","enum":["inProgress","notApplicable","notReceived","accepted","acceptedWithErrors","rejected","failed"],"description":"Latest known functional-acknowledgement status for the transaction set.\nUpdates asynchronously as 997 (X12) / CONTRL (EDIFACT) acknowledgements\narrive from the trading partner, so this value may change without a\nnew flow run."},"s3Key":{"type":"string","description":"Opaque file identifier for the raw EDI document in object storage.\nThe value may be a hex token or an EDI file name — treat it as\nopaque, not as an S3 path or a fixed format. Combine with\n`_flowJobId` and call\n`POST /v1/jobs/{_flowJobId}/files/signedURL` with body\n`{ \"fileIds\": [\"<s3Key>\"] }` to obtain a short-lived signed\ndownload URL."},"faS3Key":{"type":"string","description":"Opaque file identifier for the stored functional-acknowledgement\n(997 / CONTRL) file. Present only once an FA has been received.\nOne acknowledgement file can cover many transactions, which then\nshare the same `faS3Key`. To download the FA file, combine with\n`_faFlowJobId` (the FA-processing flow run — not `_flowJobId`) and\ncall `POST /v1/jobs/{_faFlowJobId}/files/signedURL` with body\n`{ \"fileIds\": [\"<faS3Key>\"] }`. For parsed FA failure details, use\n`GET /v1/ediTransactions/{_ediTransactionId}/faDetails?fileType=<X12|EDIFACT>`\n— pass the transaction's own `fileType`; the route answers 404 without it\n(available only for transactions with a rejected FA status)."},"mdnStatus":{"type":"string","enum":["received","sent"],"description":"AS2 Message Disposition Notification status. Present only on AS2\ntransactions. `received` appears on outbound transactions (the partner\nreturned an MDN); `sent` appears on inbound transactions (Celigo\nreturned an MDN to the partner)."},"mdnS3Key":{"type":"string","description":"Opaque file identifier for the stored AS2 MDN artifact. Received MDNs\n(`mdnStatus: received`) use a UUID; sent MDNs store the MDN file name\nor a hex token — treat the value as opaque. Present only on AS2\ntransactions that have an MDN. Retrieve the parsed MDN via\n`GET /v1/ediTransactions/{_ediTransactionId}/mdn`."},"isaSenderId":{"type":"string","description":"X12 only. ISA06 Interchange Sender ID. On inbound records this is the\nfixed-width 15-character value as received (space-padded); outbound\nrecords store the configured ID unpadded. Absent on EDIFACT records\n(see `unbSenderId`)."},"isaReceiverId":{"type":"string","description":"X12 only. ISA08 Interchange Receiver ID. On inbound records this is\nthe fixed-width 15-character value as received (space-padded);\noutbound records store the configured ID unpadded. Absent on EDIFACT\nrecords (see `unbReceiverId`)."},"gsSenderId":{"type":"string","description":"X12 only. GS02 Application Sender's Code."},"gsReceiverId":{"type":"string","description":"X12 only. GS03 Application Receiver's Code."},"unbSenderId":{"type":"string","description":"EDIFACT only. UNB02 sender identification. Absent on X12 records\n(see `isaSenderId`)."},"unbReceiverId":{"type":"string","description":"EDIFACT only. UNB03 receiver identification. Absent on X12 records\n(see `isaReceiverId`)."},"controlNumber":{"type":"object","description":"EDI control numbers extracted from the envelope. The property names\ndiffer by `fileType`: X12 records use `interchange`, `group`, and\n`transactionSet`; EDIFACT records use `unb` and `unh` (and `ung`\nwhen a UNG group is present).","properties":{"interchange":{"type":"string","description":"X12 only. ISA13 interchange control number."},"group":{"type":"string","description":"X12 only. GS06 group control number."},"transactionSet":{"type":"string","description":"X12 only. ST02 transaction-set control number. Occasionally\nstored with a trailing segment terminator and/or CR (e.g.\n`\"0004~\\r\"` instead of `\"0004\"`) — strip trailing non-alphanumeric\ncharacters when comparing."},"unb":{"type":"string","description":"EDIFACT only. UNB05 interchange control reference."},"ung":{"type":"string","description":"EDIFACT only. UNG05 group reference number. Absent when no UNG\ngroup is present in the interchange."},"unh":{"type":"string","description":"EDIFACT only. UNH01 message reference number."}}}}}}}}
```

## Update part of an EDI transaction

> Partially updates one or more EDI transaction records. Commonly used\
> to update the \`faStatus\` field (functional acknowledgment status).\
> \
> The endpoint is lenient — when the \`ediTransactions\` array is empty,\
> missing, or contains IDs that don't match any existing records, the\
> response is \`200\` with \`{"ediTransactions": \[]}\` rather than a 400.\
> Callers should always supply \`fileType\` and a non-empty\
> \`ediTransactions\` array for meaningful results.

```json
{"openapi":"3.2.0","info":{"title":"EDI Transactions","version":"1.0.0"},"tags":[{"name":"EDI Transactions","description":"Query the EDI transaction log surfaced by the B2B Manager dashboard.\n\nEach record represents a single EDI document (one X12 transaction set or\none EDIFACT message) that was processed through a Celigo flow. The envelope\nmetadata (sender/receiver IDs, control numbers, document type, functional\nacknowledgement status) is extracted during flow execution and indexed so\nthe B2B dashboard can render filterable activity lists.\n\nRequires a B2B / EDI license on the account.\n\n## EDI transaction schema\n\n{% openapi-schemas spec=\"editransaction\" schemas=\"EDITransaction\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"EDITransaction":{"type":"object","required":["_id","_userId","fileType","documentType","direction","faStatus","s3Key","lastModified","controlNumber"],"description":"A single EDI transaction record indexed by the B2B Manager dashboard.\n\nRepresents one EDI document — one X12 transaction set (e.g. a single 850\npurchase order) or one EDIFACT message (e.g. a single ORDERS message) —\nprocessed through a Celigo flow. Envelope metadata is extracted from the\nISA/GS (X12) or UNB/UNG (EDIFACT) segments at flow execution time.\nX12 and EDIFACT records share common fields (`_id`, `documentType`,\n`direction`, `faStatus`, etc.) but use different field names for\nsender/receiver IDs and control numbers — see individual field\ndescriptions.\n\nTransaction records are retained for the account's data retention period\n(`dataRetentionPeriod` on account settings: 30, 60, 90 or 180 days after\nlast modification; the license sets the ceiling) and then expire; expired\ntransactions no longer appear in query results. Unlike most resources, these records\nare not soft-deleted into the recycle bin, and `createdAt` / `deletedAt`\nare not returned.","properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the transaction record."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the record was last updated (e.g. by an faStatus\nchange). Also restarts the retention window — the record is kept for\nthe account's `dataRetentionPeriod` (30, 60, 90 or 180 days) after\nthis timestamp, so a record can outlive the raw file behind it, whose\nperiod counts from when the file was stored."},"_userId":{"type":"string","format":"objectId","description":"Owning account user ID."},"_integrationId":{"type":"string","format":"objectId","description":"Integration that processed this transaction. Omitted on records whose\nflow ran outside an integration context."},"_flowJobId":{"type":"string","format":"objectId","description":"Flow-run Job ID that produced this record. Combine with `s3Key` and\n`POST /v1/jobs/{_flowJobId}/files/signedURL` (body\n`{ \"fileIds\": [\"<s3Key>\"] }`) to download the raw EDI file."},"_faFlowJobId":{"type":"string","format":"objectId","description":"Job ID of the flow run that processed the functional acknowledgement\n(997 / CONTRL) for this transaction. Present only once an FA has been\nreceived and processed. Use this job — not `_flowJobId` — with\n`POST /v1/jobs/{_faFlowJobId}/files/signedURL` (body\n`{ \"fileIds\": [\"<faS3Key>\"] }`) to download the FA file."},"fileType":{"type":"string","enum":["X12","EDIFACT"],"description":"EDI standard family of this transaction."},"documentType":{"type":"string","description":"EDI document type. X12: usually the numeric transaction-set ID as a\nstring (`\"850\"`, `\"810\"`, `\"856\"`, `\"997\"`). EDIFACT: UNH01 message\ntype (`\"ORDERS\"`, `\"INVOIC\"`, `\"DESADV\"`, `\"CONTRL\"`). Not a closed\nset — file definitions can supply partner-specific document codes\ninstead (e.g. `\"PO\"`, `\"SH\"`, `\"IB\"`, `\"OSTRPT\"`), so treat this as a\nfree-form label."},"documentNumber":{"type":"string","description":"Business document number extracted from the transaction set\n(e.g. purchase-order number from BEG03 in an 850 / BGM02 in an\nORDERS). Omitted when the document carries no business number or the\nfile definition does not extract one — most functional\nacknowledgements (997 / CONTRL / FA) and many status or inventory\ndocuments. May also be an empty string."},"referenceDocumentNumber":{"type":"array","description":"Business documents this one refers back to, each as an upper-cased\n`<qualifier> <number>` string — for example the purchase order an\n856 ASN or 810 invoice fulfils. Links the documents of one order\nlifecycle together. Present only when the file definition extracted\nat least one reference.","items":{"type":"string"}},"lifecycleStatus":{"type":"string","enum":["PO received","PO sent","PO Ack received","PO Ack sent","PO change req received","PO change req sent","ASN received","ASN sent","Invoice received","Invoice sent","Payment received","Payment sent"],"description":"Order-lifecycle step this document represents, derived from\n`documentType` and `direction`. Absent when the document type is\noutside the order cycle (functional acknowledgements, inventory and\nstatus documents) and on records that predate lifecycle tracking."},"tradingPartnerName":{"type":"string","description":"Display name of the trading partner the document was exchanged with.\nPresent only when the flow resolved the partner; drives the partner\nfilter of the B2B Manager dashboard."},"partnerPairKey":{"type":"string","description":"Upper-cased key identifying the trading-partner pair that exchanged\nthe document, shared by every document of that pair so an order\nlifecycle can be followed across documents together with\n`referenceDocumentNumber`. Present only when the flow resolved the\npartner."},"direction":{"type":"string","enum":["Inbound","Outbound"],"description":"Whether the document was received from or sent to a trading partner."},"faStatus":{"type":"string","enum":["inProgress","notApplicable","notReceived","accepted","acceptedWithErrors","rejected","failed"],"description":"Latest known functional-acknowledgement status for the transaction set.\nUpdates asynchronously as 997 (X12) / CONTRL (EDIFACT) acknowledgements\narrive from the trading partner, so this value may change without a\nnew flow run."},"s3Key":{"type":"string","description":"Opaque file identifier for the raw EDI document in object storage.\nThe value may be a hex token or an EDI file name — treat it as\nopaque, not as an S3 path or a fixed format. Combine with\n`_flowJobId` and call\n`POST /v1/jobs/{_flowJobId}/files/signedURL` with body\n`{ \"fileIds\": [\"<s3Key>\"] }` to obtain a short-lived signed\ndownload URL."},"faS3Key":{"type":"string","description":"Opaque file identifier for the stored functional-acknowledgement\n(997 / CONTRL) file. Present only once an FA has been received.\nOne acknowledgement file can cover many transactions, which then\nshare the same `faS3Key`. To download the FA file, combine with\n`_faFlowJobId` (the FA-processing flow run — not `_flowJobId`) and\ncall `POST /v1/jobs/{_faFlowJobId}/files/signedURL` with body\n`{ \"fileIds\": [\"<faS3Key>\"] }`. For parsed FA failure details, use\n`GET /v1/ediTransactions/{_ediTransactionId}/faDetails?fileType=<X12|EDIFACT>`\n— pass the transaction's own `fileType`; the route answers 404 without it\n(available only for transactions with a rejected FA status)."},"mdnStatus":{"type":"string","enum":["received","sent"],"description":"AS2 Message Disposition Notification status. Present only on AS2\ntransactions. `received` appears on outbound transactions (the partner\nreturned an MDN); `sent` appears on inbound transactions (Celigo\nreturned an MDN to the partner)."},"mdnS3Key":{"type":"string","description":"Opaque file identifier for the stored AS2 MDN artifact. Received MDNs\n(`mdnStatus: received`) use a UUID; sent MDNs store the MDN file name\nor a hex token — treat the value as opaque. Present only on AS2\ntransactions that have an MDN. Retrieve the parsed MDN via\n`GET /v1/ediTransactions/{_ediTransactionId}/mdn`."},"isaSenderId":{"type":"string","description":"X12 only. ISA06 Interchange Sender ID. On inbound records this is the\nfixed-width 15-character value as received (space-padded); outbound\nrecords store the configured ID unpadded. Absent on EDIFACT records\n(see `unbSenderId`)."},"isaReceiverId":{"type":"string","description":"X12 only. ISA08 Interchange Receiver ID. On inbound records this is\nthe fixed-width 15-character value as received (space-padded);\noutbound records store the configured ID unpadded. Absent on EDIFACT\nrecords (see `unbReceiverId`)."},"gsSenderId":{"type":"string","description":"X12 only. GS02 Application Sender's Code."},"gsReceiverId":{"type":"string","description":"X12 only. GS03 Application Receiver's Code."},"unbSenderId":{"type":"string","description":"EDIFACT only. UNB02 sender identification. Absent on X12 records\n(see `isaSenderId`)."},"unbReceiverId":{"type":"string","description":"EDIFACT only. UNB03 receiver identification. Absent on X12 records\n(see `isaReceiverId`)."},"controlNumber":{"type":"object","description":"EDI control numbers extracted from the envelope. The property names\ndiffer by `fileType`: X12 records use `interchange`, `group`, and\n`transactionSet`; EDIFACT records use `unb` and `unh` (and `ung`\nwhen a UNG group is present).","properties":{"interchange":{"type":"string","description":"X12 only. ISA13 interchange control number."},"group":{"type":"string","description":"X12 only. GS06 group control number."},"transactionSet":{"type":"string","description":"X12 only. ST02 transaction-set control number. Occasionally\nstored with a trailing segment terminator and/or CR (e.g.\n`\"0004~\\r\"` instead of `\"0004\"`) — strip trailing non-alphanumeric\ncharacters when comparing."},"unb":{"type":"string","description":"EDIFACT only. UNB05 interchange control reference."},"ung":{"type":"string","description":"EDIFACT only. UNG05 group reference number. Absent when no UNG\ngroup is present in the interchange."},"unh":{"type":"string","description":"EDIFACT only. UNH01 message reference number."}}}}},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"400-bad-request":{"description":"Bad request. The server could not understand the request because of malformed syntax or invalid parameters.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/ediTransactions":{"patch":{"operationId":"patchEdiTransactions","tags":["EDI Transactions"],"summary":"Update part of an EDI transaction","description":"Partially updates one or more EDI transaction records. Commonly used\nto update the `faStatus` field (functional acknowledgment status).\n\nThe endpoint is lenient — when the `ediTransactions` array is empty,\nmissing, or contains IDs that don't match any existing records, the\nresponse is `200` with `{\"ediTransactions\": []}` rather than a 400.\nCallers should always supply `fileType` and a non-empty\n`ediTransactions` array for meaningful results.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ediTransactions","fileType"],"properties":{"ediTransactions":{"type":"array","items":{"type":"object","required":["_id"],"properties":{"_id":{"type":"string","description":"EDI transaction ID to update."},"faStatus":{"type":"string","description":"Functional acknowledgment status to set. Only `accepted`\nand `rejected` are valid via PATCH — other values\n(`inProgress`, `notApplicable`, etc.) are system-managed\nand cause the record to be silently skipped.","enum":["accepted","rejected"]}}},"description":"Array of partial transaction updates."},"fileType":{"type":"string","enum":["X12","EDIFACT"],"description":"EDI file type."}}}}}},"responses":{"200":{"description":"Updated transaction records.","content":{"application/json":{"schema":{"type":"object","properties":{"ediTransactions":{"type":"array","items":{"$ref":"#/components/schemas/EDITransaction"}}}}}}},"400":{"$ref":"#/components/responses/400-bad-request"},"401":{"$ref":"#/components/responses/401-unauthorized"}}}}}}
```

## Query the EDI transaction log

> Returns EDI documents processed through B2B Manager flows, with envelope\
> metadata (sender/receiver IDs, control numbers), document type, direction,\
> and functional acknowledgement status. This is the data source behind the\
> B2B Manager "Transactions" dashboard.\
> \
> Results are cursor-paginated — when more records exist beyond \`limit\`,\
> the response includes \`pageToken.next\`. Pass it back as \`pageToken\` in\
> the next request to get the next page. The server caps \`limit\` at 1000.\
> \
> Use \`fileType\` with a dated window (\`startDate\`/\`endDate\`) to keep\
> result sets bounded. \`faStatus\` must be passed as an array when\
> filtering. Unknown filter fields are silently ignored. To fetch the\
> raw EDI file for a returned record, use\
> \`POST /v1/jobs/{\_flowJobId}/files/signedURL\` with the record's\
> \`s3Key\`.

```json
{"openapi":"3.2.0","info":{"title":"EDI Transactions","version":"1.0.0"},"tags":[{"name":"EDI Transactions","description":"Query the EDI transaction log surfaced by the B2B Manager dashboard.\n\nEach record represents a single EDI document (one X12 transaction set or\none EDIFACT message) that was processed through a Celigo flow. The envelope\nmetadata (sender/receiver IDs, control numbers, document type, functional\nacknowledgement status) is extracted during flow execution and indexed so\nthe B2B dashboard can render filterable activity lists.\n\nRequires a B2B / EDI license on the account.\n\n## EDI transaction schema\n\n{% openapi-schemas spec=\"editransaction\" schemas=\"EDITransaction\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"EDITransactionsQueryRequest":{"type":"object","description":"Filter for `POST /v1/ediTransactions/query`. All fields are optional.\nResults are narrowed by `fileType`, `interchangeSenderId`,\n`interchangeReceiverId`, `documentNumber`, `faStatus`, and the\n`startDate`/`endDate` window. `direction`, `documentType`, and\n`_integrationId` are accepted but not applied server-side (filter on those\nclient-side). Records come back newest-first by `lastModified` and are\ncursor-paginated via `pageToken`.","properties":{"fileType":{"type":"string","enum":["X12","EDIFACT"],"description":"EDI standard family. Defaults to `X12` when omitted — set\n`fileType: EDIFACT` explicitly to query EDIFACT records."},"interchangeSenderId":{"type":"string","description":"Filter by interchange sender ID — exact match against the record's\n`isaSenderId` (X12 ISA06). Applied server-side."},"interchangeReceiverId":{"type":"string","description":"Filter by interchange receiver ID — exact match against the record's\n`isaReceiverId` (X12 ISA08). Applied server-side."},"direction":{"type":"string","enum":["Inbound","Outbound"],"description":"Transaction direction. Accepted by the endpoint but not applied as a\nserver-side filter — the result set is unaffected; filter client-side."},"documentType":{"type":"string","description":"EDI document type code. For X12 this is the numeric transaction-set ID\nas a string (e.g. `\"850\"`, `\"810\"`, `\"856\"`, `\"997\"`); for EDIFACT the\nUNH01 message type (e.g. `\"ORDERS\"`, `\"INVOIC\"`, `\"DESADV\"`, `\"CONTRL\"`).\nAccepted but not applied as a server-side filter — the result set is\nunaffected; filter client-side."},"documentNumber":{"type":"string","description":"Business document number to filter on — matches the `documentNumber`\nfield extracted from the transaction set (e.g. a purchase-order number\nfrom an 850's BEG03)."},"_integrationId":{"type":"string","format":"objectId","description":"Integration the transaction was processed by. Accepted but not applied\nas a server-side filter — the result set is unaffected; filter\nclient-side."},"faStatus":{"type":"array","items":{"type":"string","enum":["inProgress","notApplicable","notReceived","accepted","acceptedWithErrors","rejected","failed"]},"description":"Filter by functional acknowledgment status. Pass an array of one or\nmore values to match. Must be an array, not a bare string. Omit to\ninclude all statuses."},"startDate":{"type":"integer","format":"int64","description":"Lower bound of the `lastModified` window, as epoch milliseconds.\nThe CLI converts ISO-8601 date strings to epoch-ms before calling.\nWhen omitted, the server applies an internal default window."},"endDate":{"type":"integer","format":"int64","description":"Upper bound of the `lastModified` window, as epoch milliseconds.\nMust be greater than `startDate`."},"limit":{"type":"integer","minimum":1,"maximum":1000,"description":"Maximum number of records to return per page. Server-enforced\nrange is 1–1000.\nWhen more records exist beyond the limit, the response includes a\n`pageToken.next` cursor for the next page."},"pageToken":{"type":"string","description":"Opaque cursor from a previous response's `pageToken.next`. Pass\nthis value to retrieve the next page of results. Omit on the\nfirst call."}}},"EDITransactionsQueryResponse":{"type":"object","description":"One page of EDI transaction records matching the request filter. When\nmore records exist beyond the `limit`, `pageToken.next` contains an\nopaque cursor to pass back on the next request for the next page.","properties":{"ediTransactions":{"type":"array","description":"Matching EDI transaction records, newest first by `lastModified`.\nEmpty array when no records match — the endpoint does not switch to\n204 for empty results.","items":{"$ref":"#/components/schemas/EDITransaction"}},"pageToken":{"type":"object","description":"Pagination cursor. Present only when more records exist beyond\nthe current page. Absent on the last (or only) page.","properties":{"next":{"type":"string","description":"Opaque cursor string. Pass as `pageToken` in the next request\nbody to retrieve the next page."}}}}},"EDITransaction":{"type":"object","required":["_id","_userId","fileType","documentType","direction","faStatus","s3Key","lastModified","controlNumber"],"description":"A single EDI transaction record indexed by the B2B Manager dashboard.\n\nRepresents one EDI document — one X12 transaction set (e.g. a single 850\npurchase order) or one EDIFACT message (e.g. a single ORDERS message) —\nprocessed through a Celigo flow. Envelope metadata is extracted from the\nISA/GS (X12) or UNB/UNG (EDIFACT) segments at flow execution time.\nX12 and EDIFACT records share common fields (`_id`, `documentType`,\n`direction`, `faStatus`, etc.) but use different field names for\nsender/receiver IDs and control numbers — see individual field\ndescriptions.\n\nTransaction records are retained for the account's data retention period\n(`dataRetentionPeriod` on account settings: 30, 60, 90 or 180 days after\nlast modification; the license sets the ceiling) and then expire; expired\ntransactions no longer appear in query results. Unlike most resources, these records\nare not soft-deleted into the recycle bin, and `createdAt` / `deletedAt`\nare not returned.","properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the transaction record."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the record was last updated (e.g. by an faStatus\nchange). Also restarts the retention window — the record is kept for\nthe account's `dataRetentionPeriod` (30, 60, 90 or 180 days) after\nthis timestamp, so a record can outlive the raw file behind it, whose\nperiod counts from when the file was stored."},"_userId":{"type":"string","format":"objectId","description":"Owning account user ID."},"_integrationId":{"type":"string","format":"objectId","description":"Integration that processed this transaction. Omitted on records whose\nflow ran outside an integration context."},"_flowJobId":{"type":"string","format":"objectId","description":"Flow-run Job ID that produced this record. Combine with `s3Key` and\n`POST /v1/jobs/{_flowJobId}/files/signedURL` (body\n`{ \"fileIds\": [\"<s3Key>\"] }`) to download the raw EDI file."},"_faFlowJobId":{"type":"string","format":"objectId","description":"Job ID of the flow run that processed the functional acknowledgement\n(997 / CONTRL) for this transaction. Present only once an FA has been\nreceived and processed. Use this job — not `_flowJobId` — with\n`POST /v1/jobs/{_faFlowJobId}/files/signedURL` (body\n`{ \"fileIds\": [\"<faS3Key>\"] }`) to download the FA file."},"fileType":{"type":"string","enum":["X12","EDIFACT"],"description":"EDI standard family of this transaction."},"documentType":{"type":"string","description":"EDI document type. X12: usually the numeric transaction-set ID as a\nstring (`\"850\"`, `\"810\"`, `\"856\"`, `\"997\"`). EDIFACT: UNH01 message\ntype (`\"ORDERS\"`, `\"INVOIC\"`, `\"DESADV\"`, `\"CONTRL\"`). Not a closed\nset — file definitions can supply partner-specific document codes\ninstead (e.g. `\"PO\"`, `\"SH\"`, `\"IB\"`, `\"OSTRPT\"`), so treat this as a\nfree-form label."},"documentNumber":{"type":"string","description":"Business document number extracted from the transaction set\n(e.g. purchase-order number from BEG03 in an 850 / BGM02 in an\nORDERS). Omitted when the document carries no business number or the\nfile definition does not extract one — most functional\nacknowledgements (997 / CONTRL / FA) and many status or inventory\ndocuments. May also be an empty string."},"referenceDocumentNumber":{"type":"array","description":"Business documents this one refers back to, each as an upper-cased\n`<qualifier> <number>` string — for example the purchase order an\n856 ASN or 810 invoice fulfils. Links the documents of one order\nlifecycle together. Present only when the file definition extracted\nat least one reference.","items":{"type":"string"}},"lifecycleStatus":{"type":"string","enum":["PO received","PO sent","PO Ack received","PO Ack sent","PO change req received","PO change req sent","ASN received","ASN sent","Invoice received","Invoice sent","Payment received","Payment sent"],"description":"Order-lifecycle step this document represents, derived from\n`documentType` and `direction`. Absent when the document type is\noutside the order cycle (functional acknowledgements, inventory and\nstatus documents) and on records that predate lifecycle tracking."},"tradingPartnerName":{"type":"string","description":"Display name of the trading partner the document was exchanged with.\nPresent only when the flow resolved the partner; drives the partner\nfilter of the B2B Manager dashboard."},"partnerPairKey":{"type":"string","description":"Upper-cased key identifying the trading-partner pair that exchanged\nthe document, shared by every document of that pair so an order\nlifecycle can be followed across documents together with\n`referenceDocumentNumber`. Present only when the flow resolved the\npartner."},"direction":{"type":"string","enum":["Inbound","Outbound"],"description":"Whether the document was received from or sent to a trading partner."},"faStatus":{"type":"string","enum":["inProgress","notApplicable","notReceived","accepted","acceptedWithErrors","rejected","failed"],"description":"Latest known functional-acknowledgement status for the transaction set.\nUpdates asynchronously as 997 (X12) / CONTRL (EDIFACT) acknowledgements\narrive from the trading partner, so this value may change without a\nnew flow run."},"s3Key":{"type":"string","description":"Opaque file identifier for the raw EDI document in object storage.\nThe value may be a hex token or an EDI file name — treat it as\nopaque, not as an S3 path or a fixed format. Combine with\n`_flowJobId` and call\n`POST /v1/jobs/{_flowJobId}/files/signedURL` with body\n`{ \"fileIds\": [\"<s3Key>\"] }` to obtain a short-lived signed\ndownload URL."},"faS3Key":{"type":"string","description":"Opaque file identifier for the stored functional-acknowledgement\n(997 / CONTRL) file. Present only once an FA has been received.\nOne acknowledgement file can cover many transactions, which then\nshare the same `faS3Key`. To download the FA file, combine with\n`_faFlowJobId` (the FA-processing flow run — not `_flowJobId`) and\ncall `POST /v1/jobs/{_faFlowJobId}/files/signedURL` with body\n`{ \"fileIds\": [\"<faS3Key>\"] }`. For parsed FA failure details, use\n`GET /v1/ediTransactions/{_ediTransactionId}/faDetails?fileType=<X12|EDIFACT>`\n— pass the transaction's own `fileType`; the route answers 404 without it\n(available only for transactions with a rejected FA status)."},"mdnStatus":{"type":"string","enum":["received","sent"],"description":"AS2 Message Disposition Notification status. Present only on AS2\ntransactions. `received` appears on outbound transactions (the partner\nreturned an MDN); `sent` appears on inbound transactions (Celigo\nreturned an MDN to the partner)."},"mdnS3Key":{"type":"string","description":"Opaque file identifier for the stored AS2 MDN artifact. Received MDNs\n(`mdnStatus: received`) use a UUID; sent MDNs store the MDN file name\nor a hex token — treat the value as opaque. Present only on AS2\ntransactions that have an MDN. Retrieve the parsed MDN via\n`GET /v1/ediTransactions/{_ediTransactionId}/mdn`."},"isaSenderId":{"type":"string","description":"X12 only. ISA06 Interchange Sender ID. On inbound records this is the\nfixed-width 15-character value as received (space-padded); outbound\nrecords store the configured ID unpadded. Absent on EDIFACT records\n(see `unbSenderId`)."},"isaReceiverId":{"type":"string","description":"X12 only. ISA08 Interchange Receiver ID. On inbound records this is\nthe fixed-width 15-character value as received (space-padded);\noutbound records store the configured ID unpadded. Absent on EDIFACT\nrecords (see `unbReceiverId`)."},"gsSenderId":{"type":"string","description":"X12 only. GS02 Application Sender's Code."},"gsReceiverId":{"type":"string","description":"X12 only. GS03 Application Receiver's Code."},"unbSenderId":{"type":"string","description":"EDIFACT only. UNB02 sender identification. Absent on X12 records\n(see `isaSenderId`)."},"unbReceiverId":{"type":"string","description":"EDIFACT only. UNB03 receiver identification. Absent on X12 records\n(see `isaReceiverId`)."},"controlNumber":{"type":"object","description":"EDI control numbers extracted from the envelope. The property names\ndiffer by `fileType`: X12 records use `interchange`, `group`, and\n`transactionSet`; EDIFACT records use `unb` and `unh` (and `ung`\nwhen a UNG group is present).","properties":{"interchange":{"type":"string","description":"X12 only. ISA13 interchange control number."},"group":{"type":"string","description":"X12 only. GS06 group control number."},"transactionSet":{"type":"string","description":"X12 only. ST02 transaction-set control number. Occasionally\nstored with a trailing segment terminator and/or CR (e.g.\n`\"0004~\\r\"` instead of `\"0004\"`) — strip trailing non-alphanumeric\ncharacters when comparing."},"unb":{"type":"string","description":"EDIFACT only. UNB05 interchange control reference."},"ung":{"type":"string","description":"EDIFACT only. UNG05 group reference number. Absent when no UNG\ngroup is present in the interchange."},"unh":{"type":"string","description":"EDIFACT only. UNH01 message reference number."}}}}},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/ediTransactions/query":{"post":{"operationId":"queryEDITransactions","tags":["EDI Transactions"],"summary":"Query the EDI transaction log","description":"Returns EDI documents processed through B2B Manager flows, with envelope\nmetadata (sender/receiver IDs, control numbers), document type, direction,\nand functional acknowledgement status. This is the data source behind the\nB2B Manager \"Transactions\" dashboard.\n\nResults are cursor-paginated — when more records exist beyond `limit`,\nthe response includes `pageToken.next`. Pass it back as `pageToken` in\nthe next request to get the next page. The server caps `limit` at 1000.\n\nUse `fileType` with a dated window (`startDate`/`endDate`) to keep\nresult sets bounded. `faStatus` must be passed as an array when\nfiltering. Unknown filter fields are silently ignored. To fetch the\nraw EDI file for a returned record, use\n`POST /v1/jobs/{_flowJobId}/files/signedURL` with the record's\n`s3Key`.","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EDITransactionsQueryRequest"}}}},"responses":{"200":{"description":"One page of EDI transaction records. When more records exist beyond\n`limit`, `pageToken.next` is included for the next page.\n`ediTransactions` is `[]` when no records match — the endpoint does\n**not** return 204 on empty results.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EDITransactionsQueryResponse"}}}},"400":{"description":"The request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"}}}}}}
```

## Get signed URL to download EDI transactions CSV

> Exports EDI transaction-log records matching a \`lastModified\` date window\
> to a CSV file and returns a short-lived pre-signed S3 URL for downloading\
> it — the API equivalent of the B2B Manager dashboard's transaction\
> download.\
> \
> When \`startDate\` and \`endDate\` are both omitted, the export covers the\
> last 24 hours. When the window matches more records than the server-side\
> export cap, the request fails with \`exceeded\_max\_ediTransactions\` —\
> narrow the window and retry.\
> \
> CSV columns for X12 exports: Doc no., Doc type, FA status, File type,\
> Direction, Processed, ISA no., GS no., ST no., ISA sender, ISA receiver,\
> GS sender, GS receiver, FA details, MDN status. EDIFACT exports replace\
> FA status with ACK status and the ISA/GS/ST columns with UNB no.,\
> UNH no., UNB sender, UNB receiver. The Processed timestamp is rendered\
> in the account owner's timezone preference.\
> \
> The signed URL expires 15 minutes after generation (S3\
> \`X-Amz-Expires=900\`) — fetch it promptly and do not persist it. To browse\
> transaction records via the API instead, use\
> \`POST /v1/ediTransactions/query\`.

```json
{"openapi":"3.2.0","info":{"title":"EDI Transactions","version":"1.0.0"},"tags":[{"name":"EDI Transactions","description":"Query the EDI transaction log surfaced by the B2B Manager dashboard.\n\nEach record represents a single EDI document (one X12 transaction set or\none EDIFACT message) that was processed through a Celigo flow. The envelope\nmetadata (sender/receiver IDs, control numbers, document type, functional\nacknowledgement status) is extracted during flow execution and indexed so\nthe B2B dashboard can render filterable activity lists.\n\nRequires a B2B / EDI license on the account.\n\n## EDI transaction schema\n\n{% openapi-schemas spec=\"editransaction\" schemas=\"EDITransaction\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"EDITransactionsSignedUrlResponse":{"type":"object","description":"Location of the CSV export generated from the matching EDI transaction\nrecords.","properties":{"url":{"type":"string","format":"uri","description":"Pre-signed S3 URL that streams the CSV export when fetched with a\nplain GET (no auth headers needed). Expires 15 minutes after\ngeneration (S3 `X-Amz-Expires=900`) — fetch it promptly, do not\npersist it."}},"required":["url"]},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/ediTransactions/signedURL":{"get":{"operationId":"getEdiTransactionsSignedUrl","tags":["EDI Transactions"],"summary":"Get signed URL to download EDI transactions CSV","description":"Exports EDI transaction-log records matching a `lastModified` date window\nto a CSV file and returns a short-lived pre-signed S3 URL for downloading\nit — the API equivalent of the B2B Manager dashboard's transaction\ndownload.\n\nWhen `startDate` and `endDate` are both omitted, the export covers the\nlast 24 hours. When the window matches more records than the server-side\nexport cap, the request fails with `exceeded_max_ediTransactions` —\nnarrow the window and retry.\n\nCSV columns for X12 exports: Doc no., Doc type, FA status, File type,\nDirection, Processed, ISA no., GS no., ST no., ISA sender, ISA receiver,\nGS sender, GS receiver, FA details, MDN status. EDIFACT exports replace\nFA status with ACK status and the ISA/GS/ST columns with UNB no.,\nUNH no., UNB sender, UNB receiver. The Processed timestamp is rendered\nin the account owner's timezone preference.\n\nThe signed URL expires 15 minutes after generation (S3\n`X-Amz-Expires=900`) — fetch it promptly and do not persist it. To browse\ntransaction records via the API instead, use\n`POST /v1/ediTransactions/query`.","parameters":[{"name":"fileType","in":"query","required":false,"schema":{"type":"string","enum":["X12","EDIFACT"]},"description":"Which transaction log to export. Defaults to `X12` when omitted —\npass `fileType=EDIFACT` explicitly to export EDIFACT records. The\ntwo logs produce different CSV columns."},{"name":"startDate","in":"query","required":false,"schema":{"type":"integer","format":"int64"},"description":"Lower bound of the `lastModified` window, as epoch milliseconds\n(non-numeric values are rejected). When both `startDate` and\n`endDate` are omitted, the window defaults to the last 24 hours."},{"name":"endDate","in":"query","required":false,"schema":{"type":"integer","format":"int64"},"description":"Upper bound of the `lastModified` window, as epoch milliseconds\n(non-numeric values are rejected). Must be greater than `startDate`.\nDefaults to the current time when only `startDate` is provided —\nsending `endDate` without `startDate` fails with\n`start_time_or_end_time_missing`."}],"responses":{"200":{"description":"Signed URL for the generated CSV export. Returned even when zero\nrecords match the window — the CSV then contains only the header\nrow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EDITransactionsSignedUrlResponse"}}}},"400":{"description":"The request failed validation, or the date window matches more\nrecords than the server-side export cap.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"422":{"description":"The account's subscription does not include a B2B / EDI license.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Get FA details for an EDI transaction

> Returns functional acknowledgment (FA) details for a specific EDI\
> transaction. FA details are only available for transactions with a\
> "Rejected" status in B2B Manager.

```json
{"openapi":"3.2.0","info":{"title":"EDI Transactions","version":"1.0.0"},"tags":[{"name":"EDI Transactions","description":"Query the EDI transaction log surfaced by the B2B Manager dashboard.\n\nEach record represents a single EDI document (one X12 transaction set or\none EDIFACT message) that was processed through a Celigo flow. The envelope\nmetadata (sender/receiver IDs, control numbers, document type, functional\nacknowledgement status) is extracted during flow execution and indexed so\nthe B2B dashboard can render filterable activity lists.\n\nRequires a B2B / EDI license on the account.\n\n## EDI transaction schema\n\n{% openapi-schemas spec=\"editransaction\" schemas=\"EDITransaction\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/ediTransactions/{_ediTransactionId}/faDetails":{"get":{"operationId":"getEdiTransactionFaDetails","tags":["EDI Transactions"],"summary":"Get FA details for an EDI transaction","description":"Returns functional acknowledgment (FA) details for a specific EDI\ntransaction. FA details are only available for transactions with a\n\"Rejected\" status in B2B Manager.","parameters":[{"name":"_ediTransactionId","in":"path","required":true,"schema":{"type":"string"},"description":"The EDI transaction ID."},{"name":"fileType","in":"query","required":true,"schema":{"type":"string","enum":["X12","EDIFACT"]},"description":"EDI file type."}],"responses":{"200":{"description":"FA detail envelope.","content":{"application/json":{"schema":{"type":"object","properties":{"faDetails":{"type":"object","properties":{"Interchange Control Number":{"type":"string"},"Group":{"type":"array","items":{"type":"object","properties":{"Group Control Number":{"type":"string"},"Identifier Code":{"type":"string"},"Transaction":{"type":"array","items":{"type":"object","properties":{"Transaction set Control Number":{"type":"string"},"Document Type":{"type":"string"},"Errors":{"type":"array","items":{"type":"object","properties":{"Segment ID":{"type":"string"},"Element ID":{"type":"string"},"Error message":{"type":"string"},"Data in error":{"type":"string"},"Segment error":{"type":"string"}}}}}}}}}}}}}}}}},"400":{"description":"The `fileType` query parameter is present but not a valid value, or the\ntransaction's FA status is not `rejected` (FA details are only available\nfor rejected transactions).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"description":"The EDI transaction was not found, or the `fileType` query\nparameter was omitted entirely (the server treats a missing\n`fileType` as a lookup failure rather than a validation error).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Get a signed URL to download an EDI transaction file

> Returns a short-lived pre-signed S3 URL for the primary EDI document\
> (\`type=nonFa\`) or the functional-acknowledgement file (\`type=fa\`) of\
> one EDI transaction record. Fetch the URL with a plain GET right away\
> and never store it — request a new URL for a later download.\
> \
> Get \`\_id\` from a record returned by \`POST /v1/ediTransactions/query\`.\
> The id alone identifies the record for both X12 and EDIFACT; \`type\` is\
> the only query parameter.\
> \
> The acknowledgement file exists only once the trading partner's 997\
> (X12) or CONTRL (EDIFACT) was ingested — a record whose \`faStatus\` is\
> \`notReceived\`, \`inProgress\` or \`notApplicable\` has none. Files are kept\
> for the account's data retention period; afterwards the record is still\
> listed but the download answers \`edi\_transaction\_file\_unavailable\`.\
> \
> This is the only file-download route that an application acting for a\
> signed-in user can also reach; the document-number downloads under\
> \`/v1/edi/documents\` are public-API only.\
> \
> Downloads are rate limited per user.

```json
{"openapi":"3.2.0","info":{"title":"EDI Transactions","version":"1.0.0"},"tags":[{"name":"EDI Transactions","description":"Query the EDI transaction log surfaced by the B2B Manager dashboard.\n\nEach record represents a single EDI document (one X12 transaction set or\none EDIFACT message) that was processed through a Celigo flow. The envelope\nmetadata (sender/receiver IDs, control numbers, document type, functional\nacknowledgement status) is extracted during flow execution and indexed so\nthe B2B dashboard can render filterable activity lists.\n\nRequires a B2B / EDI license on the account.\n\n## EDI transaction schema\n\n{% openapi-schemas spec=\"editransaction\" schemas=\"EDITransaction\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"EDITransactionFileSignedUrlResponse":{"type":"object","description":"Pre-signed S3 URL for downloading an EDI transaction file. The URL is\nshort-lived — fetch it right away and request a new one for a later\ndownload rather than storing it.","properties":{"signedURL":{"type":"string","format":"uri","description":"Pre-signed S3 URL that streams the EDI file when fetched with a plain\nGET (no auth headers needed). Short-lived; never store it."}},"required":["signedURL"]},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/ediTransactions/{_ediTransactionId}/ediFile":{"get":{"operationId":"getEdiTransactionFileSignedUrl","tags":["EDI Transactions"],"summary":"Get a signed URL to download an EDI transaction file","description":"Returns a short-lived pre-signed S3 URL for the primary EDI document\n(`type=nonFa`) or the functional-acknowledgement file (`type=fa`) of\none EDI transaction record. Fetch the URL with a plain GET right away\nand never store it — request a new URL for a later download.\n\nGet `_id` from a record returned by `POST /v1/ediTransactions/query`.\nThe id alone identifies the record for both X12 and EDIFACT; `type` is\nthe only query parameter.\n\nThe acknowledgement file exists only once the trading partner's 997\n(X12) or CONTRL (EDIFACT) was ingested — a record whose `faStatus` is\n`notReceived`, `inProgress` or `notApplicable` has none. Files are kept\nfor the account's data retention period; afterwards the record is still\nlisted but the download answers `edi_transaction_file_unavailable`.\n\nThis is the only file-download route that an application acting for a\nsigned-in user can also reach; the document-number downloads under\n`/v1/edi/documents` are public-API only.\n\nDownloads are rate limited per user.","parameters":[{"name":"_ediTransactionId","in":"path","required":true,"schema":{"type":"string","format":"objectId"},"description":"The EDI transaction ID."},{"name":"type","in":"query","required":true,"schema":{"type":"string","enum":["nonFa","fa"]},"description":"Which file to download — the original EDI business document or the\nfunctional acknowledgement the trading partner returned for it."}],"responses":{"200":{"description":"Pre-signed download URL for the requested file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EDITransactionFileSignedUrlResponse"}}}},"400":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"description":"The EDI transaction was not found, or the requested file is not\navailable for it — no acknowledgement was ingested, the record\ncarries no file reference, or the object aged out of storage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The account has no B2B Manager (EDI) license.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected error occurred while generating the signed URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Get MDN details for an EDI transaction

> Returns AS2 Message Disposition Notification (MDN) metadata for a specific\
> EDI transaction record from the B2B Manager dashboard. The server reads the\
> stored MDN artifact associated with the transaction and returns its raw body\
> text together with a parsed disposition classification.\
> \
> Get \`\_id\` from a record returned by \`POST /v1/ediTransactions/query\`.

```json
{"openapi":"3.2.0","info":{"title":"EDI Transactions","version":"1.0.0"},"tags":[{"name":"EDI Transactions","description":"Query the EDI transaction log surfaced by the B2B Manager dashboard.\n\nEach record represents a single EDI document (one X12 transaction set or\none EDIFACT message) that was processed through a Celigo flow. The envelope\nmetadata (sender/receiver IDs, control numbers, document type, functional\nacknowledgement status) is extracted during flow execution and indexed so\nthe B2B dashboard can render filterable activity lists.\n\nRequires a B2B / EDI license on the account.\n\n## EDI transaction schema\n\n{% openapi-schemas spec=\"editransaction\" schemas=\"EDITransaction\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"EDITransactionMdnResponse":{"type":"object","description":"AS2 Message Disposition Notification (MDN) metadata for an EDI transaction.\nThe server reads the stored MDN artifact and returns the raw status message\nbody together with a parsed disposition classification.","properties":{"mdnStatusMessage":{"type":"string","description":"Full raw MDN body text, including the MIME headers and the `Disposition:`\nline from the disposition-notification part."},"mdnTimestamp":{"type":"string","format":"date-time","description":"Timestamp of the stored MDN artifact — its last-modified time when\navailable, otherwise the transaction's `lastModified`."},"mdnDisposition":{"type":"string","enum":["processed","warning","error","failure"],"description":"Disposition classification parsed from the modifier on the `Disposition:`\nheader in `mdnStatusMessage` (the status token after the disposition\ntype, e.g. `processed` or `processed/error`)."}},"required":["mdnStatusMessage","mdnTimestamp","mdnDisposition"]},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/ediTransactions/{_ediTransactionId}/mdn":{"get":{"operationId":"getEdiTransactionMdn","tags":["EDI Transactions"],"summary":"Get MDN details for an EDI transaction","description":"Returns AS2 Message Disposition Notification (MDN) metadata for a specific\nEDI transaction record from the B2B Manager dashboard. The server reads the\nstored MDN artifact associated with the transaction and returns its raw body\ntext together with a parsed disposition classification.\n\nGet `_id` from a record returned by `POST /v1/ediTransactions/query`.","parameters":[{"name":"_ediTransactionId","in":"path","required":true,"schema":{"type":"string","format":"objectId"},"description":"The EDI transaction ID."}],"responses":{"200":{"description":"MDN metadata for the transaction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EDITransactionMdnResponse"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"description":"The EDI transaction was not found, has no associated MDN artifact, or\nthe MDN artifact is no longer available in storage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected error occurred while retrieving the MDN.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Download an EDI file by document number

> Streams the raw EDI document whose business document number and\
> document type match — the file an export parsed or an import\
> generated. Acknowledgement files are not served here; use\
> \`GET /v1/ediTransactions/{\_ediTransactionId}/ediFile?type=fa\`.\
> \
> A document number is not unique: the same purchase-order number can\
> exist for several trading partners, in both directions, in sandbox and\
> production, or across integrations. Add lookup filters to pick one —\
> they AND together — and when several records still match, the latest\
> by \`lastModified\` is returned. Partner ids use the same names as\
> \`POST /v1/ediTransactions/query\`: \`interchangeSenderId\` /\
> \`interchangeReceiverId\` for X12, \`unbSenderId\` / \`unbReceiverId\` for\
> EDIFACT. When no document number is known, use\
> \`GET /v1/edi/documents/ediFile\` with filters alone.\
> \
> Get \`documentNumber\` and \`documentType\` from a transaction record\
> returned by \`POST /v1/ediTransactions/query\`; a record's \`\_id\` is the\
> unambiguous alternative through\
> \`GET /v1/ediTransactions/{\_ediTransactionId}/ediFile\`.\
> \
> Public-API route only: there is no equivalent for applications acting\
> with a signed-in user's session. Downloads are rate limited per user.

```json
{"openapi":"3.2.0","info":{"title":"EDI Transactions","version":"1.0.0"},"tags":[{"name":"EDI Transactions","description":"Query the EDI transaction log surfaced by the B2B Manager dashboard.\n\nEach record represents a single EDI document (one X12 transaction set or\none EDIFACT message) that was processed through a Celigo flow. The envelope\nmetadata (sender/receiver IDs, control numbers, document type, functional\nacknowledgement status) is extracted during flow execution and indexed so\nthe B2B dashboard can render filterable activity lists.\n\nRequires a B2B / EDI license on the account.\n\n## EDI transaction schema\n\n{% openapi-schemas spec=\"editransaction\" schemas=\"EDITransaction\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"FileType":{"name":"fileType","in":"query","required":false,"schema":{"type":"string","enum":["X12","EDIFACT"]},"description":"EDI standard the lookup runs against. Inferred from `documentType` when\none is sent, and must agree with it."},"Direction":{"name":"direction","in":"query","required":false,"schema":{"type":"string","enum":["inbound","outbound"]},"description":"Narrows the lookup to one transaction direction. Case-insensitive."},"Sandbox":{"name":"sandbox","in":"query","required":false,"schema":{"type":"boolean"},"description":"When true, narrows the lookup to sandbox transactions; when false, to\nproduction ones."},"FaStatus":{"name":"faStatus","in":"query","required":false,"style":"form","explode":false,"schema":{"type":"array","items":{"type":"string","enum":["inProgress","notApplicable","notReceived","accepted","acceptedWithErrors","rejected","failed"]}},"description":"Narrows the lookup to records in any of the given functional-acknowledgment\nstatuses — one value, or several comma-separated (`faStatus=rejected,failed`)."},"StartDate":{"name":"startDate","in":"query","required":false,"schema":{"type":"string"},"description":"Lower bound of the `lastModified` window, as an ISO-8601 timestamp or\nepoch milliseconds. Must be sent together with `endDate` and lie before it."},"EndDate":{"name":"endDate","in":"query","required":false,"schema":{"type":"string"},"description":"Upper bound of the `lastModified` window, as an ISO-8601 timestamp or\nepoch milliseconds. Must be sent together with `startDate`."},"IntegrationId":{"name":"_integrationId","in":"query","required":false,"schema":{"type":"string","format":"objectId"},"description":"Narrows the lookup to transactions processed by one integration. A\nmalformed id is rejected with 400 `invalid_integration_id`."},"InterchangeSenderId":{"name":"interchangeSenderId","in":"query","required":false,"schema":{"type":"string"},"description":"X12 only — the record's `isaSenderId` (ISA06), matched exactly or against\nthe stored value padded with trailing spaces; letters are uppercased.\nRejected when the lookup runs against EDIFACT."},"InterchangeReceiverId":{"name":"interchangeReceiverId","in":"query","required":false,"schema":{"type":"string"},"description":"X12 only — the record's `isaReceiverId` (ISA08), matched like\n`interchangeSenderId`. Rejected when the lookup runs against EDIFACT."},"UnbSenderId":{"name":"unbSenderId","in":"query","required":false,"schema":{"type":"string"},"description":"EDIFACT only — the record's `unbSenderId` (UNB02), matched exactly or\nagainst the stored value padded with trailing spaces; letters are\nuppercased. Rejected when the lookup runs against X12."},"UnbReceiverId":{"name":"unbReceiverId","in":"query","required":false,"schema":{"type":"string"},"description":"EDIFACT only — the record's `unbReceiverId` (UNB04), matched like\n`unbSenderId`. Rejected when the lookup runs against X12."}},"schemas":{"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/edi/documents/{documentNumber}/ediFile":{"get":{"operationId":"downloadEdiFile","tags":["EDI Transactions"],"summary":"Download an EDI file by document number","description":"Streams the raw EDI document whose business document number and\ndocument type match — the file an export parsed or an import\ngenerated. Acknowledgement files are not served here; use\n`GET /v1/ediTransactions/{_ediTransactionId}/ediFile?type=fa`.\n\nA document number is not unique: the same purchase-order number can\nexist for several trading partners, in both directions, in sandbox and\nproduction, or across integrations. Add lookup filters to pick one —\nthey AND together — and when several records still match, the latest\nby `lastModified` is returned. Partner ids use the same names as\n`POST /v1/ediTransactions/query`: `interchangeSenderId` /\n`interchangeReceiverId` for X12, `unbSenderId` / `unbReceiverId` for\nEDIFACT. When no document number is known, use\n`GET /v1/edi/documents/ediFile` with filters alone.\n\nGet `documentNumber` and `documentType` from a transaction record\nreturned by `POST /v1/ediTransactions/query`; a record's `_id` is the\nunambiguous alternative through\n`GET /v1/ediTransactions/{_ediTransactionId}/ediFile`.\n\nPublic-API route only: there is no equivalent for applications acting\nwith a signed-in user's session. Downloads are rate limited per user.","parameters":[{"name":"documentNumber","in":"path","required":true,"schema":{"type":"string"},"description":"The business document number that identifies the EDI transaction\n(e.g. a purchase-order number from an 850's BEG03). Matches the\n`documentNumber` field on an EDI transaction record; letters are\nuppercased."},{"name":"documentType","in":"query","required":true,"schema":{"type":"string"},"description":"EDI document type code — for X12 the numeric transaction-set ID as\na string (`850`, `810`, `856`, `997`); for EDIFACT the UNH01 message\ntype (`ORDERS`, `INVOIC`, `DESADV`, `CONTRL`). Case-insensitive. It\nalso selects the EDI standard the lookup runs against. `X12` and\n`EDIFACT` name the standard, not a document type, and are rejected\nhere."},{"$ref":"#/components/parameters/FileType"},{"$ref":"#/components/parameters/Direction"},{"$ref":"#/components/parameters/Sandbox"},{"$ref":"#/components/parameters/FaStatus"},{"$ref":"#/components/parameters/StartDate"},{"$ref":"#/components/parameters/EndDate"},{"$ref":"#/components/parameters/IntegrationId"},{"$ref":"#/components/parameters/InterchangeSenderId"},{"$ref":"#/components/parameters/InterchangeReceiverId"},{"$ref":"#/components/parameters/UnbSenderId"},{"$ref":"#/components/parameters/UnbReceiverId"}],"responses":{"200":{"description":"The raw EDI file, streamed as the response body.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"description":"No transaction matched the document number, type and filters — or\none did, but its file is no longer in storage (it aged out of the\naccount's data retention period, or was never captured).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The account has no B2B Manager (EDI) license.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Download the latest EDI file matching filters

> Streams the raw EDI document of the latest transaction (by\
> \`lastModified\`) that matches the lookup filters — for callers that\
> hold trading-partner context but no document number. The filters AND\
> together and at least one must be sent. Acknowledgement files are not\
> served here; use \`GET /v1/ediTransactions/{\_ediTransactionId}/ediFile?type=fa\`.\
> \
> \`documentNumber\` may be passed as a query parameter here; when it is,\
> \`documentType\` becomes required — the same contract as\
> \`GET /v1/edi/documents/{documentNumber}/ediFile\`. When \`documentNumber\`\
> and \`documentType\` are both omitted, the lookup runs against X12 unless\
> \`fileType\` says \`EDIFACT\` — \`unbSenderId\` sent on its own is refused\
> with \`invalid\_search\_param\_for\_X12\`. Partner ids\
> use the same names as \`POST /v1/ediTransactions/query\`:\
> \`interchangeSenderId\` / \`interchangeReceiverId\` for X12,\
> \`unbSenderId\` / \`unbReceiverId\` for EDIFACT.\
> \
> Public-API route only: there is no equivalent for applications acting\
> with a signed-in user's session. Downloads are rate limited per user.

```json
{"openapi":"3.2.0","info":{"title":"EDI Transactions","version":"1.0.0"},"tags":[{"name":"EDI Transactions","description":"Query the EDI transaction log surfaced by the B2B Manager dashboard.\n\nEach record represents a single EDI document (one X12 transaction set or\none EDIFACT message) that was processed through a Celigo flow. The envelope\nmetadata (sender/receiver IDs, control numbers, document type, functional\nacknowledgement status) is extracted during flow execution and indexed so\nthe B2B dashboard can render filterable activity lists.\n\nRequires a B2B / EDI license on the account.\n\n## EDI transaction schema\n\n{% openapi-schemas spec=\"editransaction\" schemas=\"EDITransaction\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"DocumentType":{"name":"documentType","in":"query","required":false,"schema":{"type":"string"},"description":"EDI document type code — for X12 the numeric transaction-set ID as a\nstring (`850`, `810`, `856`, `997`); for EDIFACT the UNH01 message type\n(`ORDERS`, `INVOIC`, `DESADV`, `CONTRL`). Case-insensitive. It also\nselects the EDI standard the lookup runs against. `X12` and `EDIFACT`\nname the standard, not a document type, and are rejected here."},"FileType":{"name":"fileType","in":"query","required":false,"schema":{"type":"string","enum":["X12","EDIFACT"]},"description":"EDI standard the lookup runs against. Inferred from `documentType` when\none is sent, and must agree with it."},"Direction":{"name":"direction","in":"query","required":false,"schema":{"type":"string","enum":["inbound","outbound"]},"description":"Narrows the lookup to one transaction direction. Case-insensitive."},"Sandbox":{"name":"sandbox","in":"query","required":false,"schema":{"type":"boolean"},"description":"When true, narrows the lookup to sandbox transactions; when false, to\nproduction ones."},"FaStatus":{"name":"faStatus","in":"query","required":false,"style":"form","explode":false,"schema":{"type":"array","items":{"type":"string","enum":["inProgress","notApplicable","notReceived","accepted","acceptedWithErrors","rejected","failed"]}},"description":"Narrows the lookup to records in any of the given functional-acknowledgment\nstatuses — one value, or several comma-separated (`faStatus=rejected,failed`)."},"StartDate":{"name":"startDate","in":"query","required":false,"schema":{"type":"string"},"description":"Lower bound of the `lastModified` window, as an ISO-8601 timestamp or\nepoch milliseconds. Must be sent together with `endDate` and lie before it."},"EndDate":{"name":"endDate","in":"query","required":false,"schema":{"type":"string"},"description":"Upper bound of the `lastModified` window, as an ISO-8601 timestamp or\nepoch milliseconds. Must be sent together with `startDate`."},"IntegrationId":{"name":"_integrationId","in":"query","required":false,"schema":{"type":"string","format":"objectId"},"description":"Narrows the lookup to transactions processed by one integration. A\nmalformed id is rejected with 400 `invalid_integration_id`."},"InterchangeSenderId":{"name":"interchangeSenderId","in":"query","required":false,"schema":{"type":"string"},"description":"X12 only — the record's `isaSenderId` (ISA06), matched exactly or against\nthe stored value padded with trailing spaces; letters are uppercased.\nRejected when the lookup runs against EDIFACT."},"InterchangeReceiverId":{"name":"interchangeReceiverId","in":"query","required":false,"schema":{"type":"string"},"description":"X12 only — the record's `isaReceiverId` (ISA08), matched like\n`interchangeSenderId`. Rejected when the lookup runs against EDIFACT."},"UnbSenderId":{"name":"unbSenderId","in":"query","required":false,"schema":{"type":"string"},"description":"EDIFACT only — the record's `unbSenderId` (UNB02), matched exactly or\nagainst the stored value padded with trailing spaces; letters are\nuppercased. Rejected when the lookup runs against X12."},"UnbReceiverId":{"name":"unbReceiverId","in":"query","required":false,"schema":{"type":"string"},"description":"EDIFACT only — the record's `unbReceiverId` (UNB04), matched like\n`unbSenderId`. Rejected when the lookup runs against X12."}},"schemas":{"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/edi/documents/ediFile":{"get":{"operationId":"downloadEdiFileByLookup","tags":["EDI Transactions"],"summary":"Download the latest EDI file matching filters","description":"Streams the raw EDI document of the latest transaction (by\n`lastModified`) that matches the lookup filters — for callers that\nhold trading-partner context but no document number. The filters AND\ntogether and at least one must be sent. Acknowledgement files are not\nserved here; use `GET /v1/ediTransactions/{_ediTransactionId}/ediFile?type=fa`.\n\n`documentNumber` may be passed as a query parameter here; when it is,\n`documentType` becomes required — the same contract as\n`GET /v1/edi/documents/{documentNumber}/ediFile`. When `documentNumber`\nand `documentType` are both omitted, the lookup runs against X12 unless\n`fileType` says `EDIFACT` — `unbSenderId` sent on its own is refused\nwith `invalid_search_param_for_X12`. Partner ids\nuse the same names as `POST /v1/ediTransactions/query`:\n`interchangeSenderId` / `interchangeReceiverId` for X12,\n`unbSenderId` / `unbReceiverId` for EDIFACT.\n\nPublic-API route only: there is no equivalent for applications acting\nwith a signed-in user's session. Downloads are rate limited per user.","parameters":[{"name":"documentNumber","in":"query","required":false,"schema":{"type":"string"},"description":"Business document number to match (e.g. a purchase-order number from\nan 850's BEG03); letters are uppercased. Requires `documentType`."},{"$ref":"#/components/parameters/DocumentType"},{"$ref":"#/components/parameters/FileType"},{"$ref":"#/components/parameters/Direction"},{"$ref":"#/components/parameters/Sandbox"},{"$ref":"#/components/parameters/FaStatus"},{"$ref":"#/components/parameters/StartDate"},{"$ref":"#/components/parameters/EndDate"},{"$ref":"#/components/parameters/IntegrationId"},{"$ref":"#/components/parameters/InterchangeSenderId"},{"$ref":"#/components/parameters/InterchangeReceiverId"},{"$ref":"#/components/parameters/UnbSenderId"},{"$ref":"#/components/parameters/UnbReceiverId"}],"responses":{"200":{"description":"The raw EDI file of the latest matching transaction, streamed as the\nresponse body.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"description":"No transaction matched the filters — or one did, but its file is no\nlonger in storage (it aged out of the account's data retention\nperiod, or was never captured).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The account has no B2B Manager (EDI) license.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```
