LettrLabs API
API ReferenceOrder Recipient Analytics

Record a QR code scan

Records a QR code scan event against an order recipient, updating that recipient's engagement statistics. Processing is asynchronous — the scan is queued and applied shortly after the request succeeds.

POST
/v1/order-recipients-statistics

Records a QR code scan event against an order recipient, updating that recipient's engagement statistics. Processing is asynchronous — the scan is queued and applied shortly after the request succeeds.

X-API-KEY<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

orderId*integer

The order the statistic belongs to.

statisticName*OrderStatisticName

The statistics that can be recorded against an order recipient.

statisticValue*string

The value to record, as a string that must parse as a whole number. A value that does not parse is rejected with a 400 naming the offending value.

orderRecipientId*integer
orderRecipient*

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/order-recipients-statistics" \  -H "Content-Type: application/json" \  -d '{    "orderId": 0,    "statisticName": 0,    "statisticValue": "string",    "orderRecipientId": 0,    "orderRecipient": {      "id": 0,      "firstName": "string",      "lastName": "string",      "toOrganization": "string",      "fullAddress": "string",      "address1": "string",      "address2": "string",      "city": "string",      "state": "string",      "zipCode": "string",      "country": "string",      "createdDate": "2019-08-24T14:15:22Z",      "qrCode": "string",      "qrUrl": "string",      "qrCodeScanCount": 0,      "customerEmail": "string",      "customerName": "string",      "customerOrganization": "string",      "salespersonName": "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,    "statisticName": 0,    "statisticValue": "string",    "orderRecipientId": 0,    "orderRecipient": {      "id": 0,      "firstName": "string",      "lastName": "string",      "toOrganization": "string",      "fullAddress": "string",      "address1": "string",      "address2": "string",      "city": "string",      "state": "string",      "zipCode": "string",      "country": "string",      "createdDate": "2019-08-24T14:15:22Z",      "qrCode": "string",      "qrUrl": "string",      "qrCodeScanCount": 0,      "customerEmail": "string",      "customerName": "string",      "customerOrganization": "string",      "salespersonName": "string"    }  },  "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,    "statisticName": 0,    "statisticValue": "string",    "orderRecipientId": 0,    "orderRecipient": {      "id": 0,      "firstName": "string",      "lastName": "string",      "toOrganization": "string",      "fullAddress": "string",      "address1": "string",      "address2": "string",      "city": "string",      "state": "string",      "zipCode": "string",      "country": "string",      "createdDate": "2019-08-24T14:15:22Z",      "qrCode": "string",      "qrUrl": "string",      "qrCodeScanCount": 0,      "customerEmail": "string",      "customerName": "string",      "customerOrganization": "string",      "salespersonName": "string"    }  },  "errorCode": "UNAUTHENTICATED",  "errors": [    "string"  ],  "hasErrors": true,  "warnings": [    "string"  ],  "hasWarnings": true,  "errorDetails": [    null  ],  "metadata": {    "property1": null,    "property2": null  }}