iotoms Docs

Generate credit note PDF for a return

POST
/api/v1/transaction/returns/{returnId}/pdf

Generates a fresh credit note PDF for the return using the merchant's document template, or the template given in templateId, and returns a download link.

How to use it

  1. Take the returnId from Create an order return or List order returns.
  2. Optionally pass templateId from List report templates; otherwise the active credit note template is used.
  3. A fresh PDF replaces the stored one; download it from pdfUrl in the response. Get credit note PDF for a return reuses it while its template version matches the active credit note template, and generates a new one otherwise.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Path Parameters

returnId*string

ID of the return, from Create an order return or List order returns.

Formatuuid

Query Parameters

templateId?integer

Optional report template to render with, from List report templates. Defaults to the merchant's active credit note 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/returns/497f6eca-6276-4993-bfeb-53cbbbba6f08/pdf'
Example Response
{  "status": "string",  "message": "string",  "data": {    "property1": {},    "property2": {}  }}