> 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/cli/commands/edi-transactions.md).

# edi-transactions

Query the EDI transaction log surfaced by the B2B Manager dashboard — each record is one X12 transaction set or one EDIFACT message processed through a Celigo flow, with envelope metadata, control numbers, and functional-acknowledgement status.

**REST API**: [EDI Transactions](https://developer.celigo.com/api/api-reference/edi-transactions)

```
celigo edi-transactions <subcommand> [flags]
```

Supports all [global flags](/cli/getting-started/global-flags.md).

***

## Subcommands

| Subcommand                       | Purpose                                                                           |
| -------------------------------- | --------------------------------------------------------------------------------- |
| `list`                           | Query EDI transactions with envelope, direction, document-type, and date filters. |
| `fa-detail <id>`                 | Get functional acknowledgement (997/CONTRL) details for a transaction.            |
| `mdn-detail <id>`                | Get the AS2 MDN (message disposition notification) details for a transaction.     |
| `update-fa-status`               | Update the functional-ack status (`faStatus`) on a batch of transactions.         |
| `download-file <documentNumber>` | Download the raw EDI file for a document number.                                  |

There is no `create`, `update`, `set`, or `delete` — the transaction log itself is written by flow execution. `update-fa-status` only patches the acknowledgement status on existing records. See [Gotchas](#gotchas) for other ways to retrieve the raw EDI file.

***

## `celigo edi-transactions list`

Query EDI transactions processed through B2B Manager flows. Returns envelope details (sender/receiver IDs, control numbers), document type, direction, and functional-acknowledgement status — the same data that powers the B2B Manager "Transactions" dashboard.

**Signature**

```bash
celigo edi-transactions list [flags]
```

**Arguments**

None.

**Flags**

| Flag                      | Type   | Default     | Description                                                                                                                          |
| ------------------------- | ------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `--file-type <type>`      | string | `X12`       | EDI standard to query. `X12` or `EDIFACT`.                                                                                           |
| `--direction <dir>`       | string | —           | Filter by direction. `Inbound` or `Outbound` (case-sensitive).                                                                       |
| `--document-type <type>`  | string | —           | Filter by document type (e.g. `850`, `810`, `856`, `997`).                                                                           |
| `--document-number <num>` | string | —           | Filter by document number (e.g. PO number).                                                                                          |
| `--integration <id>`      | string | —           | Filter by integration `_id`. Sent as `_integrationId` in the query body.                                                             |
| `--modified-gte <iso>`    | string | 30 days ago | Return transactions whose `lastModified` is at or after this point. Accepts ISO 8601 (`2026-04-01T00:00:00Z`) or epoch milliseconds. |
| `--modified-lte <iso>`    | string | —           | Return transactions whose `lastModified` is at or before this point. Accepts ISO 8601 or epoch milliseconds.                         |
| `--limit <n>`             | number | `100`       | Max results. Server caps at `1000`.                                                                                                  |

Also supports the [global flags](/cli/getting-started/global-flags.md) (`--format`, `--jq`, `--profile`, `--verbose`).

> **Two changes in celigo-cli 2026.8.1.** `--start-date` and `--end-date` are now `--modified-gte` and `--modified-lte`, matching the date-bound naming used across the CLI and naming the field they filter. `--sandbox` was removed — use a profile whose token targets the environment you want. See [Profiles & regions](/cli/getting-started/profiles.md).

**Example**

```bash
# Inbound 850 POs for one integration over the last week
celigo edi-transactions list \
  --file-type X12 \
  --direction Inbound \
  --document-type 850 \
  --integration 5f83a9b2c7d3e8f1a2b3c4d5 \
  --modified-gte 2026-04-17T00:00:00Z

# The same query against a QA environment
celigo --profile qa edi-transactions list --document-type 850
```

**Corresponds to**: [`POST /v1/ediTransactions/query`](https://developer.celigo.com/api/api-reference/edi-transactions#post-v1-editransactions-query)

***

## `celigo edi-transactions fa-detail`

Get the functional acknowledgement (997 for X12, CONTRL for EDIFACT) details for a single EDI transaction.

**Signature**

```bash
celigo edi-transactions fa-detail <id>
```

**Arguments**

| Argument | Type   | Required | Description                                 |
| -------- | ------ | -------- | ------------------------------------------- |
| `<id>`   | string | Yes      | EDI transaction `_id` from a `list` result. |

**Example**

```bash
celigo edi-transactions fa-detail 6a1b2c3d4e5f6a7b8c9d0e1f
```

**Corresponds to**: [`GET /v1/ediTransactions/{_ediTransactionId}/faDetails`](https://developer.celigo.com/api/api-reference/edi-transactions)

***

## `celigo edi-transactions mdn-detail`

Get the AS2 MDN (message disposition notification) details for a single EDI transaction.

**Signature**

```bash
celigo edi-transactions mdn-detail <id>
```

**Arguments**

| Argument | Type   | Required | Description                                 |
| -------- | ------ | -------- | ------------------------------------------- |
| `<id>`   | string | Yes      | EDI transaction `_id` from a `list` result. |

**Example**

```bash
celigo edi-transactions mdn-detail 6a1b2c3d4e5f6a7b8c9d0e1f
```

**Corresponds to**: [`GET /v1/ediTransactions/{_ediTransactionId}/mdn`](https://developer.celigo.com/api/api-reference/edi-transactions)

***

## `celigo edi-transactions update-fa-status`

Update the functional-acknowledgement status (`faStatus`) on a batch of EDI transactions. The body is read from a file with `-f, --file`, or piped on stdin.

**Signature**

```bash
celigo edi-transactions update-fa-status --file <path>
celigo edi-transactions update-fa-status < body.json     # or pipe on stdin
```

**Flags**

| Flag                | Type   | Default | Description                         |
| ------------------- | ------ | ------- | ----------------------------------- |
| `-f, --file <path>` | string | —       | JSON body file (or pipe via stdin). |

**Request body**

```json
{
  "ediTransactions": [
    { "_id": "6a1b2c3d4e5f6a7b8c9d0e1f", "faStatus": "received" }
  ],
  "fileType": "X12"
}
```

**Example**

```bash
celigo edi-transactions update-fa-status --file ./fa-status.json
```

**Corresponds to**: [`PATCH /v1/ediTransactions`](https://developer.celigo.com/api/api-reference/edi-transactions)

***

## `celigo edi-transactions download-file`

Download the raw EDI file for a document number. Requires `--document-type` (the document-type code, e.g. `850`, `810`, `ORDERS`); the EDI standard names `X12` / `EDIFACT` are **not** valid values here.

The file is written to stdout as a JSON-encoded string, not raw bytes — one quoted value with newlines escaped as `\n`. There is no output-path flag; `--format text` does not change the encoding. Pipe through `jq -r .` to recover the raw file byte-for-byte.

**Signature**

```bash
celigo edi-transactions download-file <documentNumber> --document-type <type>
```

**Arguments**

| Argument           | Type   | Required | Description                                       |
| ------------------ | ------ | -------- | ------------------------------------------------- |
| `<documentNumber>` | string | Yes      | The document number (e.g. PO number) to download. |

**Flags**

| Flag                     | Type   | Default | Description                                           |
| ------------------------ | ------ | ------- | ----------------------------------------------------- |
| `--document-type <type>` | string | —       | EDI document-type code (e.g. `850`, `810`, `ORDERS`). |

**Example**

```bash
# Print the file to stdout (JSON-encoded)
celigo edi-transactions download-file 4500012345 --document-type 850

# Recover the raw bytes and save to disk
celigo edi-transactions download-file 4500012345 --document-type 850 | jq -r . > file.edi
```

**Corresponds to**: [`GET /v1/edi/documents/{documentNumber}/ediFile`](https://developer.celigo.com/api/api-reference/edi-transactions)

***

## Gotchas

* **The log itself is read-only.** There is no `create`, `update`, `set`, or `delete` for transaction records — they are written by flow execution. `update-fa-status` is the one mutating subcommand, and it only patches the acknowledgement status on existing records. Configure the envelopes that produce these records via [edi-profiles](/cli/commands/edi-profiles.md).
* **No pagination.** The server returns a single page and caps `limit` at `1000`. Narrow with `--file-type`, `--direction`, `--document-type`, and a tight `--modified-gte` / `--modified-lte` window instead of trying to page.
* **The default window is 30 days.** With `--modified-gte` omitted, the CLI sends a lower bound of 30 days ago. Pass `--modified-gte` explicitly for historical queries.
* **Filter values are case-sensitive.** `--direction Inbound` works; `--direction inbound` is silently ignored by the API (returns `ediTransactions: []` with `200 OK`). Same for `--file-type X12` vs `x12`.
* **`faStatus` updates asynchronously.** A record that shows `inProgress` can later flip to `received` or `rejected` as 997 (X12) or CONTRL (EDIFACT) acknowledgements arrive from the partner — no new flow run is required.
* **EDIFACT envelope fields reuse the X12 field names.** `isaSenderId`, `gsSenderId`, and `controlNumber.*` carry the equivalent UNB / UNG / UNH values for EDIFACT records; there is no separate `unb*` field family.
* **`download-file` prints a JSON-encoded string, not raw bytes.** The file arrives on stdout as one quoted value with `\n` escapes; there is no output-path flag, and `--format text` does not change the encoding. Append `| jq -r . > file.edi` to recover the raw file byte-for-byte — the REST endpoint itself returns `application/octet-stream`.
* **Downloading the raw EDI file.** Each record carries `_flowJobId` and `s3Key`. To fetch the file, call `POST /v1/jobs/{_flowJobId}/files/signedURL` with body `{ "fileIds": ["<s3Key>"] }` — or use [`celigo jobs download-files`](/cli/commands/jobs.md) which wraps that call.
* **Requires a B2B / EDI license** on the account.

## Related

* [edi-profiles](/cli/commands/edi-profiles.md) — envelope and acknowledgement configuration that *produces* these transaction records.
* [jobs](/cli/commands/jobs.md) — each transaction references `_flowJobId`; use `jobs get` and `jobs download-files` to retrieve the raw EDI payload via `s3Key`.
* [flows](/cli/commands/flows.md) — the flows whose execution writes records to the EDI transaction log.
* [file-definitions](/cli/commands/file-definitions.md) — X12 / EDIFACT parsing rules referenced by the flows that generate these records.


---

# 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/cli/commands/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.
