> 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/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","_integrationId","fileType","documentType","documentNumber","direction","faStatus","s3Key","lastModified"],"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.","allOf":[{"$ref":"#/components/schemas/ResourceResponse"},{"type":"object","properties":{"_userId":{"type":"string","format":"objectId","description":"Owning account user ID."},"_integrationId":{"type":"string","format":"objectId","description":"Integration that processed this transaction."},"_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."},"fileType":{"type":"string","enum":["X12","EDIFACT"],"description":"EDI standard family of this transaction."},"documentType":{"type":"string","description":"EDI document type. X12: numeric transaction-set ID as a string\n(`\"850\"`, `\"810\"`, `\"856\"`, `\"997\"`). EDIFACT: UNH01 message type\n(`\"ORDERS\"`, `\"INVOIC\"`, `\"DESADV\"`, `\"CONTRL\"`)."},"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)."},"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\n(observed as a 32-char lowercase hex string — not an S3 path). Combine\nwith `_flowJobId` and call `POST /v1/jobs/{_flowJobId}/files/signedURL`\nwith body `{ \"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.\nDownload it via `GET /v1/ediTransactions/{_ediTransactionId}/ediFile?type=fa`."},"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 (observed as a\nUUID). Present only on AS2 transactions that have an MDN. Retrieve the\nparsed MDN via `GET /v1/ediTransactions/{_ediTransactionId}/mdn`."},"isaSenderId":{"type":"string","description":"X12 only. ISA06 Interchange Sender ID, right-padded to 15\ncharacters. Absent on EDIFACT records (see `unbSenderId`)."},"isaReceiverId":{"type":"string","description":"X12 only. ISA08 Interchange Receiver ID, right-padded to 15\ncharacters. Absent on EDIFACT records (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."}}}}}]},"ResourceResponse":{"type":"object","description":"Response","properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the resource. Format is a 24-character hexadecimal string."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was created. Set automatically and cannot be modified."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was last updated. Changes whenever any property is modified."},"deletedAt":{"type":["string","null"],"format":"date-time","readOnly":true,"description":"Timestamp when the resource was soft-deleted. When null or absent, the resource is active."}},"required":["_id"]}}}}
```

## 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)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"EDITransaction":{"type":"object","required":["_id","_userId","_integrationId","fileType","documentType","documentNumber","direction","faStatus","s3Key","lastModified"],"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.","allOf":[{"$ref":"#/components/schemas/ResourceResponse"},{"type":"object","properties":{"_userId":{"type":"string","format":"objectId","description":"Owning account user ID."},"_integrationId":{"type":"string","format":"objectId","description":"Integration that processed this transaction."},"_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."},"fileType":{"type":"string","enum":["X12","EDIFACT"],"description":"EDI standard family of this transaction."},"documentType":{"type":"string","description":"EDI document type. X12: numeric transaction-set ID as a string\n(`\"850\"`, `\"810\"`, `\"856\"`, `\"997\"`). EDIFACT: UNH01 message type\n(`\"ORDERS\"`, `\"INVOIC\"`, `\"DESADV\"`, `\"CONTRL\"`)."},"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)."},"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\n(observed as a 32-char lowercase hex string — not an S3 path). Combine\nwith `_flowJobId` and call `POST /v1/jobs/{_flowJobId}/files/signedURL`\nwith body `{ \"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.\nDownload it via `GET /v1/ediTransactions/{_ediTransactionId}/ediFile?type=fa`."},"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 (observed as a\nUUID). Present only on AS2 transactions that have an MDN. Retrieve the\nparsed MDN via `GET /v1/ediTransactions/{_ediTransactionId}/mdn`."},"isaSenderId":{"type":"string","description":"X12 only. ISA06 Interchange Sender ID, right-padded to 15\ncharacters. Absent on EDIFACT records (see `unbSenderId`)."},"isaReceiverId":{"type":"string","description":"X12 only. ISA08 Interchange Receiver ID, right-padded to 15\ncharacters. Absent on EDIFACT records (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."}}}}}]},"ResourceResponse":{"type":"object","description":"Response","properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the resource. Format is a 24-character hexadecimal string."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was created. Set automatically and cannot be modified."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was last updated. Changes whenever any property is modified."},"deletedAt":{"type":["string","null"],"format":"date-time","readOnly":true,"description":"Timestamp when the resource was soft-deleted. When null or absent, the resource is active."}},"required":["_id"]},"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)"}],"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","_integrationId","fileType","documentType","documentNumber","direction","faStatus","s3Key","lastModified"],"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.","allOf":[{"$ref":"#/components/schemas/ResourceResponse"},{"type":"object","properties":{"_userId":{"type":"string","format":"objectId","description":"Owning account user ID."},"_integrationId":{"type":"string","format":"objectId","description":"Integration that processed this transaction."},"_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."},"fileType":{"type":"string","enum":["X12","EDIFACT"],"description":"EDI standard family of this transaction."},"documentType":{"type":"string","description":"EDI document type. X12: numeric transaction-set ID as a string\n(`\"850\"`, `\"810\"`, `\"856\"`, `\"997\"`). EDIFACT: UNH01 message type\n(`\"ORDERS\"`, `\"INVOIC\"`, `\"DESADV\"`, `\"CONTRL\"`)."},"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)."},"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\n(observed as a 32-char lowercase hex string — not an S3 path). Combine\nwith `_flowJobId` and call `POST /v1/jobs/{_flowJobId}/files/signedURL`\nwith body `{ \"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.\nDownload it via `GET /v1/ediTransactions/{_ediTransactionId}/ediFile?type=fa`."},"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 (observed as a\nUUID). Present only on AS2 transactions that have an MDN. Retrieve the\nparsed MDN via `GET /v1/ediTransactions/{_ediTransactionId}/mdn`."},"isaSenderId":{"type":"string","description":"X12 only. ISA06 Interchange Sender ID, right-padded to 15\ncharacters. Absent on EDIFACT records (see `unbSenderId`)."},"isaReceiverId":{"type":"string","description":"X12 only. ISA08 Interchange Receiver ID, right-padded to 15\ncharacters. Absent on EDIFACT records (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."}}}}}]},"ResourceResponse":{"type":"object","description":"Response","properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the resource. Format is a 24-character hexadecimal string."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was created. Set automatically and cannot be modified."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was last updated. Changes whenever any property is modified."},"deletedAt":{"type":["string","null"],"format":"date-time","readOnly":true,"description":"Timestamp when the resource was soft-deleted. When null or absent, the resource is active."}},"required":["_id"]},"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 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)"}],"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 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)"}],"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

> Downloads the raw EDI file content for a specific document number.\
> \
> The \`documentType\` query parameter is required and must be the EDI\
> document type code — for X12, the numeric transaction-set ID as a\
> string (e.g. \`850\`, \`810\`, \`856\`, \`997\`); for EDIFACT, the UNH01\
> message type (e.g. \`ORDERS\`, \`INVOIC\`, \`DESADV\`, \`CONTRL\`).\
> \
> The server uses \`documentType\` + \`documentNumber\` together to locate\
> the transaction record and return the associated raw EDI file.\
> \
> Get \`documentNumber\` and \`documentType\` from a transaction record\
> returned by \`POST /v1/ediTransactions/query\`. Alternatively,\
> download via \`POST /v1/jobs/{\_flowJobId}/files/signedURL\` using\
> the \`s3Key\` from the transaction record.

```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)"}],"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/edi/documents/{documentNumber}/ediFile":{"get":{"operationId":"downloadEdiFile","tags":["EDI Transactions"],"summary":"Download an EDI file","description":"Downloads the raw EDI file content for a specific document number.\n\nThe `documentType` query parameter is required and must be the EDI\ndocument type code — for X12, the numeric transaction-set ID as a\nstring (e.g. `850`, `810`, `856`, `997`); for EDIFACT, the UNH01\nmessage type (e.g. `ORDERS`, `INVOIC`, `DESADV`, `CONTRL`).\n\nThe server uses `documentType` + `documentNumber` together to locate\nthe transaction record and return the associated raw EDI file.\n\nGet `documentNumber` and `documentType` from a transaction record\nreturned by `POST /v1/ediTransactions/query`. Alternatively,\ndownload via `POST /v1/jobs/{_flowJobId}/files/signedURL` using\nthe `s3Key` from the transaction record.","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."},{"name":"documentType","in":"query","required":true,"schema":{"type":"string"},"description":"The EDI document type code. For X12, this is the numeric\ntransaction-set ID as a string (e.g. `850`, `810`, `856`, `997`).\nFor EDIFACT, this is the UNH01 message type (e.g. `ORDERS`,\n`INVOIC`, `DESADV`, `CONTRL`).\n\nValues like `X12` or `EDIFACT` are **not** valid here — those\nidentify the EDI standard family, not the document type."}],"responses":{"200":{"description":"Raw EDI file content.","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"The request failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"description":"No transaction was found matching the provided document type and\ndocument number combination.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.celigo.com/api/api-reference/edi-transactions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
