Skip to main content
POST
/
v1
/
barcode
/
generate
Barcodes Generator
curl --request POST \
  --url https://api.pdf.co/v1/barcode/generate \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "value": "abcdef123456",
  "type": "AustralianPostCode",
  "decorationimage": "<string>",
  "name": "<string>",
  "async": true,
  "expiration": 60,
  "inline": true,
  "profiles": "<string>"
}'

Authorizations

x-api-key
string
header
required

Body

application/json
value
string
default:abcdef123456

Barcode value.

type
enum<string>
default:QRCode

Set the barcode type to be used. See available barcode types in the Supported Barcode Types

Available options:
AustralianPostCode,
Aztec,
Codabar,
CodablockF,
Code128,
Code16K,
Code39,
Code39Extended,
Code39Mod43,
Code39Mod43Extended,
Code93,
DataMatrix,
DPMDataMatrix,
EAN13,
EAN2,
EAN5,
EAN8,
GS1DataBarExpanded,
GS1DataBarExpandedStacked,
GS1DataBarLimited,
GS1DataBarOmnidirectional,
GS1DataBarStacked,
GTIN12,
GTIN13,
GTIN14,
GTIN8,
IntelligentMail,
Interleaved2of5,
ITF14,
MaxiCode,
MICR,
MicroPDF,
MSI,
PatchCode,
PDF417,
Pharmacode,
PostNet,
PZN,
QRCode,
RoyalMail,
RoyalMailKIX,
Trioptic,
UPCA,
UPCE,
UPU
decorationimage
string
name
string
default:barcode.png

File name for generated output.

async
boolean
default:false

Set async to true for long processes to run in the background, API will then return a jobId which you can use with the Background Job Check endpoint. Also see Webhooks & Callbacks

expiration
number
default:60

Sets the expiration time for the output link, in minutes. After this period, generated output file(s) are automatically deleted from PDF.co Temporary Files Storage. The maximum allowed duration depends on your subscription plan. For permanent storage of input files (e.g., reusable images, PDF templates, documents), use PDF.co Built‑In Files Storage.

inline
boolean
default:false

Set to true to return results inside the response. Otherwise, the endpoint will return a URL to the output file generated.

profiles
string

Profiles are used configure extra options for specific API endpoints and may be unique to an API. For more information, see Profiles and the documentation of each endpoint for profiles specific to it.