Update a report template
Changes the name or layout of a document template. Active templates cannot be edited; create a new version instead.
How to use it
- Get the template ID from List report templates; it must not be the active version.
- Send reportType (required by validation but ignored), the name and, optionally, a new layoutJson; omitting layoutJson keeps the current layout. Unknown layout keys or columns are rejected.
- The document type does not change. Use Activate a report template to start using the edited version.
BearerAuthAuthorizationBearer <JWT>templateId*integerID of the template version, from List report templates. It must not be the active version.
int64application/json- body
reportType*stringDocument type: PURCHASE_ORDER, SALES_INVOICE, DAY_END_SUMMARY, ROUTE_SETTLEMENT, DELIVERY_NOTE, CREDIT_NOTE or SALES_QUOTATION. Required; ignored on update.
"PURCHASE_ORDER""SALES_INVOICE""DAY_END_SUMMARY""ROUTE_SETTLEMENT""DELIVERY_NOTE""CREDIT_NOTE""SALES_QUOTATION"name*stringName 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.
int64OK
*/*- response
status*stringOutcome of the call: SUCCESS when the request worked, ERROR when it did not.
message*stringShort human-readable message describing the result, for logs or display; do not parse it.
data?The report template version as it now stands.
curl -X PUT 'https://beta.iotoms.com/api/v1/reports/templates/0' \ -H 'Content-Type: application/json' \ -d '{ "reportType": "PURCHASE_ORDER", "name": "string"}'{ "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 }}