API v1 preview

# Download an order invoice

`GET /api/v1/orders/{order_id}/invoice`

## Overview

Download the PDF invoice of a paid order. The invoice is issued once, when payment succeeds, and does not change. An unpaid order returns 409 invoice_unavailable. Errors are JSON.

Requires `orders:read`.

[Create and poll a model guide](https://ottomfg.com/docs/models.md)

[Errors and retries](https://ottomfg.com/docs/errors.md)

Request

cURL

```
curl -X GET "$API_BASE_URL/api/v1/orders/$ORDER_ID/invoice" \
  -H "Authorization: Bearer $OTTOMFG_API_KEY" \
  -H "Accept: application/pdf" \
  --output response.pdf
```

Set API_BASE_URL, OTTOMFG_API_KEY and ORDER_ID. The file is saved as response.pdf.

[Registration and lookup examples](https://ottomfg.com/docs/models.md)

## Parameters

`order_id` path · required

Public order ID returned in id; pass unchanged.

Immutable order ID and customer reference: OM- followed by eight uppercase Crockford Base32 characters. Pass it unchanged; there is no separate order-number field.

string

## Responses

PDF invoice, named INV-<order number>.pdf.

**Response headers**

`X-Request-ID`

Request identifier for support. Send X-Request-ID with 8–64 ASCII letters, digits or hyphens to reuse that value; otherwise the server generates a UUID4 hex value. Include the returned X-Request-ID in support requests. Do not put secrets or account IDs in this value.

`Content-Disposition`

attachment; filename="INV-XMF1NT2E.pdf"

## Errors

| HTTP | Code | What to do |
| --- | --- | --- |
| 401 Unauthorized | `unauthenticated` | The API key is missing, invalid or revoked. Send a valid business API key in Authorization: Bearer. |
| 403 Forbidden | `permission_denied` | The key lacks the endpoint's scope, or payments lack spending consent. Check the scope listed on the endpoint. |
| 404 Not Found | `order_not_found` | No order with this ID exists in the account. Check the ID. |
| 406 Not Acceptable | `not_acceptable` | Any route (HTTP 406): the Accept header excludes application/json. Accept application/json. |
| 409 Conflict | `invoice_unavailable` | The order has no paid invoice yet. Pay the order, then download the invoice. |
| 429 Too Many Requests | `resource_exhausted` | A rate or account limit was reached. Wait at least Retry-After seconds, then retry. |
| 500 Internal Server Error | `internal` | The server failed unexpectedly. Retry with backoff; contact support with X-Request-ID if it persists. |
| 503 Service Unavailable | `unavailable` | A required service is briefly unavailable. Retry with backoff, reusing the same Idempotency-Key. |

[Idempotent requests](https://ottomfg.com/docs/idempotency.md)

API v1 preview

Source: https://ottomfg.com/docs/get-order-invoice
