iotoms Docs

Generate an invoice PDF

POST
/api/v1/transaction/transactions/{transactionId}/pdf

Renders a fresh invoice PDF for the transaction and returns its signed download link. Uses your active invoice template unless you pass templateId to pick a specific one.

How to use it

  1. Take the transactionId from Create a transaction from a cart or List transactions.
  2. Optionally choose a template from List report templates and pass it as templateId; otherwise the active invoice template is used.
  3. Download the PDF from the signed link in the response. Get the invoice PDF reuses the stored PDF only while it matches the active template version; otherwise it re-renders.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Path Parameters

transactionId*string

The sale to render the invoice for, from List transactions.

Formatuuid

Query Parameters

templateId?integer

Optional invoice report template to render with, from List report templates. Defaults to the active sales invoice template.

Formatint64

Header Parameters

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/transaction/transactions/497f6eca-6276-4993-bfeb-53cbbbba6f08/pdf'
Example Response
{  "status": "string",  "message": "string",  "data": {    "property1": {},    "property2": {}  }}