iotoms Docs

Create a report template

POST
/api/v1/reports/templates

Creates a new, inactive template version for a document type, either from a supplied layout or by cloning sourceTemplateId. The version number is assigned automatically.

How to use it

  1. Send reportType, a name and either a layoutJson or a sourceTemplateId (from List report templates, same document type) to copy.
  2. The layout is checked: only theme, header, partyBlocks, lineItemColumns and footer are allowed, and columns must be valid for the type.
  3. A new inactive version is created with the next version number; use Activate a report template to put it into use.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Request Body

application/json
  1. body
reportType*string

Document type: PURCHASE_ORDER, SALES_INVOICE, DAY_END_SUMMARY, ROUTE_SETTLEMENT, DELIVERY_NOTE, CREDIT_NOTE or SALES_QUOTATION. Required; ignored on update.

Value in"PURCHASE_ORDER""SALES_INVOICE""DAY_END_SUMMARY""ROUTE_SETTLEMENT""DELIVERY_NOTE""CREDIT_NOTE""SALES_QUOTATION"
name*string

Name of the template version. Required, not blank.

layoutJson?

Layout object. Allowed keys: theme, header, partyBlocks, lineItemColumns (array of column names valid for the type), footer.

sourceTemplateId?|

On create, ID of an existing template of the same type to copy the layout from when layoutJson is omitted.

Formatint64

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?

The report template version as it now stands.

Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/reports/templates' \  -H 'Content-Type: application/json' \  -d '{  "reportType": "PURCHASE_ORDER",  "name": "string"}'
Example Response
{  "status": "string",  "message": "string",  "data": {    "id": 0,    "reportType": "PURCHASE_ORDER",    "name": "string",    "layoutJson": "string",    "version": 0,    "isActive": true,    "isSystem": true,    "createdBy": "string",    "createdTime": "2019-08-24T14:15:22Z",    "modifiedTime": "2019-08-24T14:15:22Z",    "system": true,    "active": true  }}