Tools
Utility endpoints for generating QR codes, merging PDFs, and listing templates.
Generate a QR Code
Creates a QR code image. You must use a PUBLIC KEY for this request. The data parameter accepts any content — typically a URL. To create personalised QR codes for each recipient, use template variables in the data field (e.g., {{url}}) which will be replaced per recipient during mail merge. QR code foreground and background colours are configured via the template editor in the platform. For more information, see our QR code guide.
GET / POST
Parameters
| Parameter | Details | Description |
|---|---|---|
| size | int optional | The requested size in pixels of the QR code. The actual image dimensions may differ as the QR code is sized to the nearest module boundary. Returns a JPEG image. |
| data | str required | The content you wish the QR code to contain. |
| color | str optional | The foreground colour of the QR code as a hex value. Defaults to #000000. |
| background | str optional | The background colour of the QR code as a hex value. Defaults to #ffffff. |
Request Example
curl "https://api-us1.stannp.com/v1/qrcode/create" \
-u {API_KEY}: \
-d "size=300" \
-d "data=hello+world" Response Example
"<img src=\"/assets/images/qr_example.jpg\" alt=\"QR Code Example\">"Merge PDF files
Merge multiple PDF files into a single file.
POST
Parameters
| Parameter | Details | Description |
|---|---|---|
| files | array required | An array of URLs for the PDF files to merge. Example: files[]=https://file1.pdf&files[]=https://file2.pdf |
Request Example
curl "https://api-us1.stannp.com/v1/pdf/merge" \
-u {API_KEY}: \
-d "files[0]=https://file1.pdf" \
-d "files[1]=https://file2.pdf" Response Example
{
"success": true,
"data": "https://merged-file.pdf"
}Get templates
Get the templates created on your account.
GET / POST
Request Example
curl "https://api-us1.stannp.com/v1/templates/list" \
-u {API_KEY}: Response Example
{
"success": true,
"data": [
{
"id": "0",
"template_name": "Template name 1",
"size": "US-letter",
"duplex": "1"
},
{
"id": "1",
"template_name": "Template name 2",
"size": "A6",
"duplex": "1"
}
]
}