Make a receipt file from a template, with your own items, and get a 24-hour download link. Call list_templates for a slug first. Set accept_terms to true. items is required (1 to 200): name, qty and unit_price as decimal strings like "4.50", never numbers; subtotal, tax and total are worked out for you. Every other field you leave out (store name and address, date, currency, tax, payment, discounts, extra_lines, messages, barcode) uses the template's sample value, so pass an empty array to clear discounts, extra_lines or messages. format is png (default), jpeg or pdf. An optional logo goes on top: PNG, JPEG or SVG up to 2 MB (a PNG or JPEG at most 2 megapixels, for example 1600×1250; resize a bigger one first), as file_id (from create_upload), url or data_base64; it replaces the template's logo, and header.logo "none" removes the template's logo. Returns url, expires_at, the delivered image size in pixels (for a PDF, the page at 1x), the totals as formatted strings, and notes for anything that was left out or cut. Free within a daily quota counted in documents (see start.md). Make receipts only for lawful purposes, such as replacing a lost receipt, bookkeeping, testing or design mockups. Using a receipt to deceive anyone, including for refunds, expense claims or proof of purchase, is prohibited.
View input schema
{
"type": "object",
"properties": {
"template": {
"type": "string",
"minLength": 1,
"maxLength": 80,
"description": "Template slug from list_templates"
},
"accept_terms": {
"type": "boolean",
"const": true,
"description": "Must be true: you agree to the acceptable-use policy in this tool's description"
},
"format": {
"default": "png",
"description": "File type of the receipt",
"type": "string",
"enum": [
"png",
"pdf",
"jpeg"
]
},
"logo": {
"type": "object",
"properties": {
"file_id": {
"description": "A file_id from create_upload (after the PUT)",
"type": "string"
},
"url": {
"description": "Or a public https URL of the logo",
"type": "string",
"format": "uri"
},
"data_base64": {
"description": "Or base64 bytes of the logo, up to 2 MB decoded",
"type": "string"
}
},
"description": "A logo for the top of the receipt: exactly one of file_id, url or data_base64. PNG, JPEG or SVG, up to 2 MB (a PNG or JPEG also at most 2 megapixels, for example 1600×1250); the file's own bytes decide the type, not its name."
},
"items": {
"minItems": 1,
"maxItems": 200,
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 120
},
"qty": {
"type": "string"
},
"unit_price": {
"type": "string"
},
"sku": {
"type": "string",
"maxLength": 40
},
"note": {
"type": "string",
"maxLength": 120
}
},
"required": [
"name",
"qty",
"unit_price"
]
},
"description": "What was bought: name, qty and unit_price (decimal strings; a negative price is a refund line), with optional sku and note"
},
"header": {
"description": "Seller name, address lines, alignment and logo choice; fields you leave out keep the template's",
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 120
},
"lines": {
"maxItems": 6,
"type": "array",
"items": {
"type": "string",
"maxLength": 120
}
},
"align": {
"type": "string",
"enum": [
"left",
"center",
"right"
]
},
"logo": {
"type": "string",
"enum": [
"none",
"template"
],
"description": "none removes the template's built-in logo; template keeps it"
}
}
},
"currency": {
"description": "Symbol, decimals (0, 2 or 3) and number format; fields you leave out keep the template's",
"type": "object",
"properties": {
"symbol": {
"type": "string",
"minLength": 1,
"maxLength": 5
},
"decimals": {
"anyOf": [
{
"type": "number",
"const": 0
},
{
"type": "number",
"const": 2
},
{
"type": "number",
"const": 3
}
]
},
"position": {
"type": "string",
"enum": [
"before",
"after"
]
},
"thousands": {
"type": "string",
"enum": [
",",
".",
" ",
""
]
},
"decimal": {
"type": "string",
"enum": [
".",
","
]
}
}
},
"tax": {
"description": "Either a rate in percent or a fixed amount, with a label; replaces the template's tax",
"type": "object",
"properties": {
"rate": {
"type": "string"
},
"amount": {
"type": "string"
},
"label": {
"type": "string",
"maxLength": 120
}
}
},
"payment": {
"description": "How it was paid; replaces the template's payment",
"type": "object",
"properties": {
"method": {
"type": "string",
"enum": [
"cash",
"card",
"other"
]
},
"label": {
"type": "string",
"maxLength": 60
},
"card_brand": {
"type": "string",
"maxLength": 30
},
"card_last4": {
"type": "string",
"pattern": "^\\d{4}$"
},
"tendered": {
"type": "string"
},
"auth_code": {
"type": "string",
"maxLength": 40
},
"transaction_id": {
"type": "string",
"maxLength": 60
}
},
"required": [
"method"
]
},
"datetime": {
"type": "string"
},
"date_format": {
"type": "string",
"enum": [
"MM/DD/YYYY",
"DD/MM/YYYY",
"YYYY-MM-DD",
"DD.MM.YYYY"
]
},
"time_format": {
"type": "string",
"enum": [
"12h",
"24h"
]
},
"discounts": {
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"label": {
"type": "string",
"maxLength": 120
},
"amount": {
"type": "string"
}
},
"required": [
"label",
"amount"
]
}
},
"tip": {
"type": "string"
},
"barcode": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"code128",
"ean13",
"upca",
"qr"
]
},
"value": {
"type": "string",
"minLength": 1,
"maxLength": 500
}
},
"required": [
"type",
"value"
]
},
"messages": {
"maxItems": 12,
"type": "array",
"items": {
"type": "string",
"maxLength": 200
}
},
"extra_lines": {
"maxItems": 12,
"type": "array",
"items": {
"type": "object",
"properties": {
"label": {
"type": "string",
"maxLength": 60
},
"value": {
"type": "string",
"maxLength": 120
}
},
"required": [
"label",
"value"
]
}
},
"sections": {
"maxItems": 28,
"type": "array",
"items": {
"type": "string",
"enum": [
"header",
"meta",
"items",
"totals",
"payment",
"barcode",
"messages"
]
}
},
"paper": {
"type": "string",
"enum": [
"thermal",
"white",
"yellow"
]
}
},
"required": [
"template",
"accept_terms",
"items"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}