New: PDF/A-3b conversion with a compliance report included.See Docs

How to Generate Barcode with PDF.co API and Postman

4 Minutes Read

IMPORTANT: You need to set up Postman first. Use our guide to set up PDF.co for Postman.

In these guidelines, we will learn the basic process of generating barcodes or QR codes with PDF.co using Postman.

Step 1: Go to Collections Tab and Click on PDF.co API v.1 Folder

First of all, go to Collections Tab and pick the API v.1 folder.

PDF.co Postman API

Step 2: Look for and Click on Barcode Generator Folder

After accessing that folder, click on the following Barcode Generator folder.

Barcode Generator Folder

Step 3: Click on POST /barcode/generate endpoint

The next step would be to click on the endpoint named POST/barcode/generate.

Barcode Generator Endpoint

Step 4: You May Opt to Send Request with cURL or by Postman

Take a look at the cURL request you may use for the next step.

For cURL Option:

curl --location --request POST 'https://api.pdf.co/v1/barcode/generate' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {{x-api-key}}' \
--data-raw '{
"name": "barcode.png",
"value": "abcdef123456",
"type": "QRCode",
"inline": false,
"decorationImage": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-generator/logo.png"
}'

For Postman Option:

For the equivalent request in Postman, select Body → raw → JSON and paste the JSON object from the cURL example. In Headers, confirm that Content-Type is application/json and supply your PDF.co API key in x-api-key.

Step 5: Enter Desired Barcode Name on “Name” Key’s Value

Now, it’s time to enter the appropriate Barcode Name and to proceed.

Barcode Generator Keys and Values

Step 6: Set Barcode Input Parameters

Barcode Input parameters can be customized on this step.

  • Enter your barcode value on value key
  • Enter the barcode type on type value
  • You can find the supported barcode types in column 3
Barcode Generator Supported Barcode Types

Step 7: Click on Send Button

At the next step, just click the button to send the information.

Send Button

Step 8: Check the Response

Check the HTTP status and the response’s error field. If the request failed, read the error message before continuing.

For this example, inline is false, so a successful response returns a URL to the generated barcode image. Open the image and decode it with a barcode reader. Confirm that the decoded value is abcdef123456, matching the request. Repeat this check after adding or changing a logo.

Step 9: Copy the URL and Paste to Browser to See the Generated Barcode

To view your barcode, just copy and paste the URL into your browser.

Barcode Generator Result URL

The PNG file is stored temporarily in the cloud and expires in an hour. Be sure to download/move it to permanent storage before the time elapse.

Video Guide

Related Tutorials

See Related Tutorials