About this endpoint
What it does
Generates a barcode from the supplied body fields and returns the rendered barcode as binary content. You can choose the barcode symbology, output format, dimensions, colors, and margin.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| data | String | Yes | Content to encode. ean13, ean8, and upca require digits with a valid check digit. |
| bg | String | No | Background colour as a hex value such as FFFFFF. Default: FFFFFF. |
| fg | String | No | Foreground colour as a hex value such as 000000. Default: 000000. |
| type | ENUM | No | Barcode type. Allowed values: code128, code39, ean13, ean8, upca, datamatrix, pdf417. Default: code128. |
| width | Integer | No | Width in pixels. Minimum 32, maximum 2000. Default: 400, or 300 for datamatrix. |
| format | ENUM | No | Output format. Allowed values: png, svg. Default: png. |
| height | Integer | No | Height in pixels. Minimum 32, maximum 2000. Default: 150, or 300 for datamatrix. |
| margin | Integer | No | Quiet zone around the code. Minimum 0, maximum 50. Default: 10. |
Response
Returns the generated barcode as binary data. The output schema is a binary string, so the success response is a file-like payload rather than a JSON object.
Notes
The width and height fields accept values from 32 to 2000. If you choose datamatrix, the defaults change to 300 for both dimensions instead of the standard 400 width and 150 height.



