---
title: "get an invoice"
method: GET
path: "/api/v1/sales/invoices/{invoice_id}"
tags: ["orders"]
---

# get an invoice

`GET /api/v1/sales/invoices/{invoice_id}`

## Request

- Base URL: `https://api.app.tightly.io`
- URL: `https://api.app.tightly.io/api/v1/sales/invoices/{invoice_id}`
- Auth: HTTP bearer

One wholesale invoice: what was billed, at what price, against which order and shipment, what your books did with it and what the network did with its 810. Use it to answer an account's query about a document they hold.

Three facts are served apart and none of them is the others. `state` is the document's own, `issued` or `voided`. `ledger` is what Xero or QuickBooks did, and null there means no ledger is connected, so nothing was posted and nothing is owed in anybody's books. `edi` is what SPS did with the 810, and null means none was queued, which is what an account that takes none looks like.

Scope: `orders:read`.

## Path parameters

- `invoice_id` integer, required

## Headers

- `Tightly-Version` string

## Response `200`

The invoice, whole.

## Other responses

- `401`: No usable key: malformed, unknown, revoked, expired or stopped.
- `403`: The key does not hold Orders (`scope_missing`), or is issued to one account and the record is not that account's (`account_mismatch`).
- `404`: No invoice with that id is on file.
- `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)
