LettrLabs API
API ReferenceOrders

Create an order

Creates a new order from an existing template, copying its design and product settings, and returns the new order's ID. Add recipients and execute checkout separately to send the order.

POST
/v1/order

Creates a new order from an existing template, copying its design and product settings, and returns the new order's ID. Add recipients and execute checkout separately to send the order.

X-API-KEY<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

External Orders Create Order From TemplateId

templateId*integer

The template to create the order from. Obtain it from the templates listing; note that a template is itself an order that is never fulfilled, so this is an order identifier.

useQr?|

Whether the generated mail piece should include the template's QR code. true = include the QR code at its existing template placement; false = remove it. The selected template must already have a QR code element placed on its design, otherwise the request is rejected. Omit to keep the template's current setting.

qrUrl?|

Optional target URL the QR code should direct to. When supplied, overrides the template's existing QR target; when omitted (with UseQr true) the template target is kept.

handwritingFont?|

Optional handwriting style identifier. Must be a style supported by LettrLabs and available to the authenticated account. Handwriting styles are global only — fonts uploaded to the account cannot be used for handwriting and are rejected. Use the fonts listing operation to discover valid values. Omit to use the template's default style.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/order" \  -H "Content-Type: application/json" \  -d '{    "templateId": 48213  }'
{  "profile": {    "id": 0,    "aadId": "1cbad290-069a-4527-be23-a0c144b5302d",    "email": "string",    "firstName": "string",    "lastName": "string",    "company": "string",    "created": "2019-08-24T14:15:22Z",    "shouldProcessQrCodes": true  },  "payload": {    "orderId": 0,    "status": "Success"  },  "errorCode": "UNAUTHENTICATED",  "errors": [    "string"  ],  "hasErrors": true,  "warnings": [    "string"  ],  "hasWarnings": true,  "errorDetails": [    null  ],  "metadata": {    "property1": null,    "property2": null  }}
{  "profile": {    "id": 0,    "aadId": "1cbad290-069a-4527-be23-a0c144b5302d",    "email": "string",    "firstName": "string",    "lastName": "string",    "company": "string",    "created": "2019-08-24T14:15:22Z",    "shouldProcessQrCodes": true  },  "payload": {    "orderId": 0,    "status": "Success"  },  "errorCode": "UNAUTHENTICATED",  "errors": [    "string"  ],  "hasErrors": true,  "warnings": [    "string"  ],  "hasWarnings": true,  "errorDetails": [    null  ],  "metadata": {    "property1": null,    "property2": null  }}
"string"
Empty
{  "profile": {    "id": 0,    "aadId": "1cbad290-069a-4527-be23-a0c144b5302d",    "email": "string",    "firstName": "string",    "lastName": "string",    "company": "string",    "created": "2019-08-24T14:15:22Z",    "shouldProcessQrCodes": true  },  "payload": {    "orderId": 0,    "status": "Success"  },  "errorCode": "UNAUTHENTICATED",  "errors": [    "string"  ],  "hasErrors": true,  "warnings": [    "string"  ],  "hasWarnings": true,  "errorDetails": [    null  ],  "metadata": {    "property1": null,    "property2": null  }}