billing
GET /v1/invoices/{invoiceId}/pdf
Download the invoice or credit note as a PDF, in a chosen language.
身份验证
请将 API 密钥作为 bearer 令牌发送。此端点在规范中未指明具体的权限,因此请为您的密钥赋予所需的最小权限,并通过检查响应来确认,而不是盲目假设。
此端点不需要组织 ID。您的密钥已用于识别其所属的组织,且响应范围也仅限于该组织。
免费试用
将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。
curl -X GET https://api.zinndigital.com/v1/invoices/{invoiceId}/pdf \
-H "Authorization: Bearer zdk_live_…"已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点
详细信息
The rendered legal document (#708, `docs/34` §4.2) — server-side HTML→PDF, in all 58 locales including RTL, with embedded fonts covering Latin, Greek, Cyrillic, CJK, Arabic and Hebrew. Rendered from the invoice's **immutable snapshot**, never from live data: a customer who has since moved still sees the address that was on the document, because a re-render that updated it would be a different legal document under the same number. That is also what makes the render deterministic and the cache disposable. ⭐ **Labels translate; numbers, tax wording and the document identity do not.** The invoice number, the amounts and the dates keep their canonical form, and the **English document is the authoritative original** — a translated rendering is a copy of the same numbered document for the customer's convenience and says so in its footer. Answers a short-lived signed URL rather than the bytes, so a multi-megabyte document never transits the engine twice. ⛔ When no document bucket is configured in an environment the response is the **PDF itself** (`application/pdf`) rather than a refusal: the cache is an optimisation, and a customer must not be unable to download their own invoice because a bucket is missing.
参数
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
invoiceId (path) | Uuid | 是 | The billing document's id. This is the `Invoice`/`CreditNote` id — **not** the order's. It was the order's id while `/v1/invoices` projected orders (docs/34 §7); the projection… |
locale (query) | string | 否 | Language to render in. Defaults to the account's own. A language this platform does not ship is a `422` rather than a silent fallback — and it is validated because the value rea… |
响应
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
url | string | 是 | Minted per request and **never persisted** — it expires in minutes, so storing it in a list payload or a cache would hand a client a link that is already dead. |
expires_at | string | 否 | — |
locale | string | 是 | The language the document was rendered in. |
此端点可能返回的错误
401 · 403 · 404 · 422 · 429 · 503