Skip to main content
POST
Generate a barcode
Generate a barcode image for an order reference, product code, or other compatible value. The response is always PNG or SVG media; there is no Base64 JSON response mode for this operation. The Playground returns an image response for both supported formats. Generated artifacts are real and can consume Development-project credits.
Live Testing Guide: Before using Try it, create a Development project, then enter its Client ID and Client Secret. Configure the relevant provider for that project before sending the request.

API endpoint

POST

Request fields

C128 is the default general-purpose type. Select a retail, postal, numeric, or constrained variant only when your downstream scanner or standard requires it. AvraAPI validates the public type name, while the barcode renderer enforces any type-specific encoding constraint.

Request example

curl

Media response

For png, the success body is the barcode image with Content-Type: image/png. For svg, it is SVG media with Content-Type: image/svg+xml. Both return Content-Length, Cache-Control: no-store, Content-Disposition: inline, and X-APIX-Request-ID headers. The response body is not JSON. Save the media response or send it into your own image workflow. If you need a Base64 string, convert the returned media in your backend rather than expecting a separate API response mode.

Error codes

See the REST API guide for shared credentials, privacy, and response-handling rules.

Playground resources

The generated reference below lists this endpoint’s API standard details: request fields, authorizations, and response schema. The complete integration guide, request and response examples, and endpoint-specific error handling are above.

Authorizations

X-API-KEY
string
header
required

Your Development project's Client ID. Enter your own value in the Documentation Playground.

X-API-SECRET
string
header
required

Your Development project's Client Secret. Mintlify does not proxy these requests; the browser sends them directly to AvraAPI. Never enter a Production secret in the Documentation Playground.

Headers

X-ENV
enum<string>
default:development

Selects the Development credential environment. The Documentation Playground exposes Development values only; normal backend integrations may use their documented Production credentials outside this tool.

Available options:
dev,
development
Accept
string

Requests a JSON response where the selected operation supports JSON.

Example:

"application/json"

X-Privacy-Mode
boolean
default:false

Optional privacy override. Turn this on to request that AvraAPI suppress request-payload storage in observability logs for this request.

Example:

true

Body

application/json
data
string
required

Value to encode. The selected barcode type can impose additional content rules.

Required string length: 1 - 80
type
enum<string>
default:C128
Available options:
C128,
C128A,
C128B,
C128C,
EAN13,
EAN8,
UPCA,
UPCE,
C39,
C39+,
I25,
ITF14,
MSI,
POSTNET
format
enum<string>
default:png
Available options:
png,
svg
width_factor
number
default:2

Bar-width multiplier. The implementation converts this value to an integer.

Required range: 1 <= x <= 4
height
integer
default:80

Barcode height in pixels.

Required range: 20 <= x <= 300
color
string
default:000000
Pattern: ^#?[0-9a-fA-F]{6}$
privacy_mode
boolean

Optional request-level privacy setting. X-Privacy-Mode is the universal header override.

Response

Barcode image in the requested format.

The response is of type file.

Last modified on October 1, 2026