iotoms Docs

Generate a purchase order PDF

POST
/api/v1/procurement/purchase-orders/{id}/pdf

Renders a new PDF for the purchase order and returns a download link. Uses the merchant's active purchase order template, or the template given in templateId.

How to use it

  1. Find the purchase order ID with List purchase orders.
  2. Optionally pass templateId from List report templates; otherwise the active purchase order template is used.
  3. A new PDF is rendered and stored, and the response gives its download link.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Path Parameters

id*string

ID of the record (UUID).

Formatuuid

Query Parameters

templateId?integer

ID of a report template to render with, from List report templates. Omit to use the merchant's active purchase order template.

Formatint64

Header Parameters

X-TenantID*string

Your merchant's tenant code — the value typed in the Domain field on the iotoms login screen. See Concepts.

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when the request worked, ERROR when it did not.

message*string

Short human-readable message describing the result, for logs or display; do not parse it.

data?|

Key-value result. For PDF endpoints: pdfUrl (a temporary signed download link), templateId, templateVersion, generatedAt plus document keys such as dayCycleId.

Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/procurement/purchase-orders/497f6eca-6276-4993-bfeb-53cbbbba6f08/pdf' \  -H 'X-TenantID: your-tenant-code'
Example Response
{  "status": "string",  "message": "string",  "data": {    "property1": {},    "property2": {}  }}