list_templates
List receipt templates
List the receipt templates make_receipt can use, each with its slug, name, category and kind (brand or generic). Filter by category, kind or a query on the name or slug. Call this first to get a slug. Free. 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.
輸入參數kindquerycategory
make_receipt
Make a receipt
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.
輸入參數taxtiplogoitems必填paperformatheaderbarcodepaymentcurrencydatetimemessages另有 7 個
make_barcode
Make a barcode
Make a barcode image on white, with quiet zones and the readable text under a 1-D code, and get a 24-hour download link. type is code128 (printable ASCII, up to 48 characters), ean13 (12 digits, or 13 with a check digit that must match), upca (11 digits, or 12 with a check digit that must match) or qr (up to 300 characters). format is png (default) or svg. Returns url, expires_at and text, what a reader will decode (including the check digit). 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.
輸入參數type必填value必填format
calculate_sales_tax
Calculate sales tax
Work out sales tax exactly, in whole minor units. mode "add": amount is the price before tax. mode "extract": amount already includes the tax, and the net price and the tax inside it are returned. rate is a percentage like "8.25". Money is a decimal string. Returns net, tax and gross as decimal strings rounded to the currency's decimals (default 2). Free. 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.
輸入參數mode必填rate必填amount必填currency
calculate_tip
Calculate a tip
Work out a tip and split a bill between people, in whole cents. round "none" rounds the tip to the cent; "up-total" rounds the total up to the next whole unit; "up-each" rounds each person's share up to the next whole unit and the total becomes shares times people. Returns tip, total and per_person as decimal strings. Free. 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.
輸入參數bill必填round必填people必填percent必填
create_upload
Create upload URL
Get a one-hour signed upload URL for a logo file (PNG, JPEG or SVG, up to 2 MB; a PNG or JPEG at most 2 megapixels) that sits on disk. PUT the raw bytes to upload_url with a Content-Length header, then pass file_id as make_receipt's logo.file_id. Free. 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.
輸入參數bytes必填filename