Rendering

API for starting template rendering

This API will start the process of template rendering and return an id of started process. Rendering will be done asynchronously. Generated document can be requested via GET Api or admin UI. It is also possible to provide configured webhooks, which will be executed after document generation.

POST/api/renderings

Authorizations

X-AUTH-TOKEN
stringheaderrequired

Value for the X-AUTH-TOKEN header parameter.

Request Body

application/json
required

The new Rendering resource

{
  "externalId": "external-id",
  "template": "my-invoice",
  "format": "pdf",
  "webhook": "my-webhook",
  "comment": "My Comment",
  "emailServer": "my-smtp",
  "metadata": {
    "reference": "my-reference-123",
    "info": {
      "version": 3,
      "type": "my-type"
    }
  },
  "data": {
    "contract": {
      "email": "john.doe@output.rocks"
    },
    "invoiceNumber": "123456",
    "invoiceDate": "12 March 2022",
    "items": [
      {
        "qty": "3",
        "ItemName": "ACP101 Accounting Package",
        "amt": "1350.00"
      },
      {
        "qty": "4.5",
        "ItemName": "ACP101S Standard Support",
        "amt": "450.00"
      },
      {
        "qty": "10",
        "ItemName": "ACP101T Online Training",
        "amt": "1200.00"
      }
    ]
  }
}

Response

201application/json

Rendering resource created

id
integer

Identifier generated by Output.Rocks.

Example: 12345

externalId
string

External id

Example: "external-id"

template
stringrequired

Template identifier.

Example: "my-invoice"

format
enum<string>

Document format to render

Available options: pdfdocodtrtfhtmltxt

Example: "pdf"

webhook
string

Webhook (identifier) to execute after document rendering.

Example: "my-webhook"

comment
string

Rendering Comment.

Example: "My Comment"

emailServer
string

Identifier of Email-Server configuration in Output.Rocks

Example: "my-smtp"