Images

Barcode (Code128, EAN, UPC, DataMatrix, PDF417, Aztec...)

Generates a PNG barcode. Not QR (see generate_qr for that). Each type requires data in its own format (e.g. EAN-13 needs 12-13 digits); a mismatch returns a 400 with a clear reason.

Costs 1 credit per call.

post/barcode

Request

  • Base URL: https://api.cofferdock.com
  • URL: https://api.cofferdock.com/barcode
  • Auth: API key in header x-api-key

Request body

datastring required

The text or number to encode, up to 500 characters. EAN, UPC and ITF-14 take digits only, with an exact length: ean13 12-13, ean8 7-8, upca 11-12, upce 7-8, itf14 13-14. A mismatch returns a 400 error.

type'code128' | 'code39' | 'ean13' | 'ean8' | 'upca' | 'upce' | 'itf14' | 'datamatrix' | 'pdf417' | 'aztec'

Barcode type: "code128" (default), "code39", "ean13", "ean8", "upca", "upce", "itf14", "datamatrix", "pdf417" or "aztec".

scaleinteger

Size multiplier from 1 to 10: width and height grow in proportion, so 3 is three times the size of 1. Default 3.

include_textboolean

true (default) = also print the encoded text under the bars (datamatrix, pdf417 and aztec never show it); false = barcode only.

output'json' | 'binary' | 'url' | 'image'

How to return the image: "json" (base64 in the JSON response), "binary" (the image itself, ready for n8n/Make/Zapier) or "url" (a temporary download link, valid 15 minutes). Default: json when the request is JSON, binary when the input was sent raw.

Response

The resulting image (shape depends on output).

OR

Changes

No recorded changes to this operation across all 1 revision of this API.