---
title: "list edi documents"
method: GET
path: "/api/v1/wholesale/edi/documents"
tags: ["accounts"]
---

# list edi documents

`GET /api/v1/wholesale/edi/documents`

## Request

- Base URL: `https://api.app.tightly.io`
- URL: `https://api.app.tightly.io/api/v1/wholesale/edi/documents`
- Auth: HTTP bearer

Every EDI document this organisation has exchanged with its accounts: purchase orders (850) in, acknowledgements (855), shipping notices (856) and invoices (810) out, and the inventory (846) and sell-out (852) reports that arrive on the same connection. Each row says which account it belongs to, which order it became or answered, what state it reached, and the sentence behind that state where it has one, so a file that was refused or an acknowledgement a network would not take is readable here rather than in the network's own console. `network` says which lane a document came through, and it is also the filter: this log holds every lane an order can arrive on, so ask for `network=sps_commerce` for the EDI lane alone. Read only: documents are made by the acts that make them, never posted here.

Scope: `accounts:read`.

## Query parameters

- `trading_partner_id` string
- `document_type` '850' | '855' | '856' | '810' | '846' | '852'
- `direction` 'inbound' | 'outbound'
- `state` 'received' | 'parsed' | 'applied' | 'refused' | 'queued' | 'sent' | 'failed'
- `network` 'sps_commerce' | 'email' | 'upload' | 'link' | 'portal'
- `offset` integer
- `limit` integer

## Headers

- `Tightly-Version` string

## Response `200`

The documents, newest first.

## Other responses

- `401`: No usable key: malformed, unknown, revoked, expired or stopped.
- `403`: The key may not reach this operation. `plan_excludes`: Accounts is sold with Tightly Connect on Essentials+ and this organisation's plan does not include it; `scope_missing`: the key does not hold Accounts; `account_mismatch`: a key issued to one account named another.
- `429`: The key has spent its allowance for this minute. 600 reads and 120 writes a minute, counted per key, refused calls included. `Retry-After` says how long to wait.
- `503`: The database is briefly out of reach, which is what a failover or a full connection pool looks like from outside. Wait the seconds `Retry-After` names and send the request again. A read is safe to repeat. A write is not, because the connection was lost in the middle of it, so read the object back before sending it a second time. Branch on the status rather than on `code`, which is `POSTGRES_UNAVAILABLE` from one of the two seams that raise this and `SERVICE_UNAVAILABLE` from the other.

---

[API](https://skmtc.dev/tightly/apis/tightly-api.md) · [All operations](https://skmtc.dev/tightly/apis/tightly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tightly/apis/tightly-api/revisions/199f7eb35afb?raw)
