E116: Generate PO PDF
GET /api/purchase-orders/:id/pdf
Renders a printable PO document and returns the PDF bytes. Triggered from Purchase Order Detail, "Export PDF". Composes header, items, vendor and billing contact, ship-to location, and the org's branding (logo, address) into a generic CPG template; no per-template Anthem code lives here.
Authentication
Standard tenant route. Requires Authorization: Bearer <firebase-id-token> and X-Org-Id: <org-id>. Access: Member.
Request
No body.
Response — 200 OK
Content-Type: application/pdf. Content-Disposition: attachment; filename="PO-2026-0042.pdf". Body is the PDF bytes — no JSON envelope.
PDF content is built from the PO, its vendor, ship-to location, items, and per-org organization_settings branding (logo, primary color, billing address). When branding is incomplete, the PDF renders with placeholders for the missing fields and the response sets X-Pharus-Warning: branding_incomplete so the client can surface a setup CTA.
Errors
| HTTP | code | Condition |
|---|---|---|
| 404 | not_found | No such PO. |
Workflow
Calls W116 Generate PO PDF.