# EDI Transactions

## 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.1.0","info":{"title":"EDI Transactions","version":"1.0.0"},"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","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 and\nprojected onto the fields below; the same fields carry X12 or EDIFACT\nvalues depending on `fileType`.","properties":{"_id":{"type":"string","format":"objectId","description":"Unique transaction record ID."},"_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."},"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":"`Inbound` if the document was received from a trading partner;\n`Outbound` if it was sent to a trading partner."},"faStatus":{"type":"string","enum":["inProgress","notApplicable","notReceived","received","rejected"],"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.\n\n- `inProgress` — awaiting FA from trading partner.\n- `notApplicable` — no FA expected (this document is itself an FA, or\n  the partner does not require one).\n- `notReceived` — FA expected but not yet received.\n- `received` — FA received and the transaction set was accepted.\n- `rejected` — FA received and the transaction set was rejected."},"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 (the signed-URL endpoint returns 201 with `signedURLs[]`)."},"isaSenderId":{"type":"string","description":"X12: ISA06 Interchange Sender ID, right-padded to 15 characters.\nEDIFACT: UNB02 sender identification, unpadded."},"isaReceiverId":{"type":"string","description":"X12: ISA08 Interchange Receiver ID, right-padded to 15 characters.\nEDIFACT: UNB03 receiver identification, unpadded."},"gsSenderId":{"type":"string","description":"X12: GS02 Application Sender's Code. EDIFACT: UNG02 application\nsender's code (empty when no UNG group is present)."},"gsReceiverId":{"type":"string","description":"X12: GS03 Application Receiver's Code. EDIFACT: UNG03 application\nreceiver's code (empty when no UNG group is present)."},"controlNumber":{"type":"object","description":"EDI control numbers extracted from the interchange, group, and\ntransaction-set/message envelope.","properties":{"interchange":{"type":"string","description":"X12 ISA13 / EDIFACT UNB05 interchange control number."},"group":{"type":"string","description":"X12 GS06 / EDIFACT UNG05 group control number."},"transactionSet":{"type":"string","description":"X12 ST02 / EDIFACT UNH01 transaction-set / message reference\nnumber. Occasionally stored with the raw X12 segment terminator\nand/or a trailing CR (e.g. `\"0004~\\r\"` instead of `\"0004\"`) when\nthe upstream parser leaves the delimiter attached — callers that\ncompare this value should strip trailing non-digit/non-alphanumeric\ncharacters."}}},"lastModified":{"type":"string","format":"date-time","description":"When this transaction record was last updated (ISO-8601 UTC)."}}},"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. Uses the same enum as\nthe `faStatus` field on EDI transaction records returned\nby the query endpoint.","enum":["inProgress","notApplicable","notReceived","received","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.\
> \
> The response is always a single page — there is no cursor or \`nextPageURL\`.\
> Narrow results with filter fields rather than paginating; the server caps\
> \`limit\` at 1000.\
> \
> AI guidance:\
> \- Use \`fileType\` + a dated window (\`startDate\` / \`endDate\`) to keep result\
> &#x20; sets bounded. The CLI (\`ora edi-transactions list\`) defaults to the last\
> &#x20; 30 days for this reason.\
> \- To fetch the raw EDI file for a returned record, combine \`\_flowJobId\`\
> &#x20; and \`s3Key\` with \`POST /v1/jobs/{\_flowJobId}/files/signedURL\` using\
> &#x20; body \`{ "fileIds": \["\<s3Key>"] }\`.\
> \- \`faStatus\` reflects the \*latest known\* functional-acknowledgement state\
> &#x20; for the transaction set — it updates asynchronously as 997 (X12) or\
> &#x20; CONTRL (EDIFACT) acknowledgements arrive from the trading partner, so a\
> &#x20; record that shows \`inProgress\` on one call may flip to \`received\` or\
> &#x20; \`rejected\` later without a new flow run.\
> \- Unknown filter fields and filter values that don't match any stored enum\
> &#x20; (e.g. \`direction: "inbound"\` with the wrong case) are \*\*silently\
> &#x20; ignored\*\* — the server returns a 200 with \`ediTransactions: \[]\` rather\
> &#x20; than a 400. Trust the documented enum values here when building callers.\
> \- Envelope fields (\`isaSenderId\`, \`gsSenderId\`, \`controlNumber.\*\`) are\
> &#x20; populated for X12 records; EDIFACT records carry the equivalent UNB / UNG\
> &#x20; / UNH values in the same fields (no separate \`unb\*\` field family).

```json
{"openapi":"3.1.0","info":{"title":"EDI Transactions","version":"1.0.0"},"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 — an\nempty body returns the default (unbounded) slice of recent records, capped\nby the server's implicit `limit`. In practice callers always at least set\n`fileType` + a dated window (`startDate`) to keep result sets bounded,\nbecause the response is un-paginated.","properties":{"fileType":{"type":"string","enum":["X12","EDIFACT"],"description":"EDI standard family. When omitted, records from both families are\neligible; when set, only matching records are returned."},"direction":{"type":"string","enum":["Inbound","Outbound"],"description":"Transaction direction. `Inbound` = received from a trading partner;\n`Outbound` = sent to a trading partner. **Case-sensitive** — values\nthat don't match an accepted enum (e.g. lowercase `\"inbound\"`) are\nsilently ignored and return an empty result set, not a 400."},"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 this\nis the UNH01 message type (e.g. `\"ORDERS\"`, `\"INVOIC\"`, `\"DESADV\"`,\n`\"CONTRL\"`)."},"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":"Restrict to transactions processed by flows belonging to this\nintegration. Unknown IDs are silently ignored — the response is `[]`,\nnot a 404."},"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` — otherwise the server returns 400\n`invalid_date_range`."},"limit":{"type":"integer","minimum":0,"maximum":1000,"description":"Maximum number of records to return in this call. Server-enforced\nupper bound is `1000` — values above this (including string values\nand negative numbers) are rejected with 400 `invalid_limit_value`.\nA value of `0` is accepted and returns `{\"ediTransactions\": []}`.\nThe response is un-paginated, so this is the hard ceiling for a\ngiven query; narrow with filters if you need more specificity."}}},"EDITransactionsQueryResponse":{"type":"object","description":"One page (the only page) of EDI transaction records matching the request\nfilter. The envelope has a single field — there is no cursor or next-page\npointer, so `limit` + filter fields are the only way to control result\nsize.","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"}}},"required":["ediTransactions"]},"EDITransaction":{"type":"object","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 and\nprojected onto the fields below; the same fields carry X12 or EDIFACT\nvalues depending on `fileType`.","properties":{"_id":{"type":"string","format":"objectId","description":"Unique transaction record ID."},"_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."},"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":"`Inbound` if the document was received from a trading partner;\n`Outbound` if it was sent to a trading partner."},"faStatus":{"type":"string","enum":["inProgress","notApplicable","notReceived","received","rejected"],"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.\n\n- `inProgress` — awaiting FA from trading partner.\n- `notApplicable` — no FA expected (this document is itself an FA, or\n  the partner does not require one).\n- `notReceived` — FA expected but not yet received.\n- `received` — FA received and the transaction set was accepted.\n- `rejected` — FA received and the transaction set was rejected."},"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 (the signed-URL endpoint returns 201 with `signedURLs[]`)."},"isaSenderId":{"type":"string","description":"X12: ISA06 Interchange Sender ID, right-padded to 15 characters.\nEDIFACT: UNB02 sender identification, unpadded."},"isaReceiverId":{"type":"string","description":"X12: ISA08 Interchange Receiver ID, right-padded to 15 characters.\nEDIFACT: UNB03 receiver identification, unpadded."},"gsSenderId":{"type":"string","description":"X12: GS02 Application Sender's Code. EDIFACT: UNG02 application\nsender's code (empty when no UNG group is present)."},"gsReceiverId":{"type":"string","description":"X12: GS03 Application Receiver's Code. EDIFACT: UNG03 application\nreceiver's code (empty when no UNG group is present)."},"controlNumber":{"type":"object","description":"EDI control numbers extracted from the interchange, group, and\ntransaction-set/message envelope.","properties":{"interchange":{"type":"string","description":"X12 ISA13 / EDIFACT UNB05 interchange control number."},"group":{"type":"string","description":"X12 GS06 / EDIFACT UNG05 group control number."},"transactionSet":{"type":"string","description":"X12 ST02 / EDIFACT UNH01 transaction-set / message reference\nnumber. Occasionally stored with the raw X12 segment terminator\nand/or a trailing CR (e.g. `\"0004~\\r\"` instead of `\"0004\"`) when\nthe upstream parser leaves the delimiter attached — callers that\ncompare this value should strip trailing non-digit/non-alphanumeric\ncharacters."}}},"lastModified":{"type":"string","format":"date-time","description":"When this transaction record was last updated (ISO-8601 UTC)."}}},"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\nThe response is always a single page — there is no cursor or `nextPageURL`.\nNarrow results with filter fields rather than paginating; the server caps\n`limit` at 1000.\n\nAI guidance:\n- Use `fileType` + a dated window (`startDate` / `endDate`) to keep result\n  sets bounded. The CLI (`ora edi-transactions list`) defaults to the last\n  30 days for this reason.\n- To fetch the raw EDI file for a returned record, combine `_flowJobId`\n  and `s3Key` with `POST /v1/jobs/{_flowJobId}/files/signedURL` using\n  body `{ \"fileIds\": [\"<s3Key>\"] }`.\n- `faStatus` reflects the *latest known* functional-acknowledgement state\n  for the transaction set — it updates asynchronously as 997 (X12) or\n  CONTRL (EDIFACT) acknowledgements arrive from the trading partner, so a\n  record that shows `inProgress` on one call may flip to `received` or\n  `rejected` later without a new flow run.\n- Unknown filter fields and filter values that don't match any stored enum\n  (e.g. `direction: \"inbound\"` with the wrong case) are **silently\n  ignored** — the server returns a 200 with `ediTransactions: []` rather\n  than a 400. Trust the documented enum values here when building callers.\n- Envelope fields (`isaSenderId`, `gsSenderId`, `controlNumber.*`) are\n  populated for X12 records; EDIFACT records carry the equivalent UNB / UNG\n  / UNH values in the same fields (no separate `unb*` field family).","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EDITransactionsQueryRequest"}}}},"responses":{"200":{"description":"One page of EDI transaction records. `ediTransactions` is `[]` when no\nrecords match the filter — the endpoint does **not** return 204 on\nempty results.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EDITransactionsQueryResponse"}}}},"400":{"description":"The request body failed validation. Known validator codes:\n- `invalid_filetype` — `fileType` is present but not one of `X12`, `EDIFACT`.\n- `invalid_limit_value` — `limit` is not an integer in the range `[1, 1000]` (strings are also rejected here).\n- `invalid_date_range` — `endDate` is earlier than `startDate`.","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.\
> \
> AI guidance:\
> \- The \`\_ediTransactionId\` is the \`\_id\` from a transaction returned by\
> &#x20; \`POST /v1/ediTransactions/query\`.\
> \- The \`fileType\` query parameter is \*\*required\*\*.

```json
{"openapi":"3.1.0","info":{"title":"EDI Transactions","version":"1.0.0"},"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.\n\nAI guidance:\n- The `_ediTransactionId` is the `_id` from a transaction returned by\n  `POST /v1/ediTransactions/query`.\n- The `fileType` query parameter is **required**.","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.","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"}}}}}}}}}
```

## 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.

```json
{"openapi":"3.1.0","info":{"title":"EDI Transactions","version":"1.0.0"},"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.","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. Known error codes:\n- `document_type_required` — the `documentType` query parameter\n  was omitted.\n- `edi_invalid_document_type` — `documentType` is not a\n  recognized EDI document type code (e.g. `X12` or `EDIFACT`\n  was passed instead of `850` or `ORDERS`).","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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
