We are in official beta.

Barcode & QR

Generate and read barcodes, QR codes, and Swiss QR-bills

8 endpoints in this category. All require X-API-Key header.


Create Barcode

POST /api/CreateBarcode 1 token

Generate a barcode image (Code128, EAN, UPC, etc).

Parameters
NameTypeRequiredDescription
data string required Data to encode
type string optional code128, ean13, upc, code39 (default: code128)
options.scale number optional Scale factor (default: 3)
options.height number optional Bar height in pixels
Request Example
JSON
{"data": "1234567890", "type": "code128", "options": {"scale": 2, "height": 100}}
Response Example
JSON
{"success": true, "image": "iVBORw0...", "contentType": "image/png", "barcodeType": "code128", "timing": {"total": 42}}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/CreateBarcode" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"data": "1234567890", "type": "code128", "options": {"scale": 2, "height": 100}}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""data"": ""1234567890"", ""type"": ""code128"", ""options"": {""scale"": 2, ""height"": 100}}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://api.docbutterfly.com/api/CreateBarcode", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://api.docbutterfly.com/api/CreateBarcode"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"data": "1234567890", "type": "code128", "options": {"scale": 2, "height": 100}}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://api.docbutterfly.com/api/CreateBarcode
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "data": "1234567890",
│      "type": "code128",
│      "options": {
│        "scale": 2,
│        "height": 100
│      }
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/CreateBarcode"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Create QR Code

POST /api/CreateQrCode 1 token

Generate a QR code image.

Parameters
NameTypeRequiredDescription
data string required Data to encode
options.width number optional Size in pixels (default: 300)
options.errorCorrectionLevel string optional L, M, Q, H (default: M)
Request Example
JSON
{"data": "https://example.com", "options": {"width": 256, "errorCorrectionLevel": "M"}}
Response Example
JSON
{"success": true, "image": "iVBORw0...", "contentType": "image/png", "timing": {"total": 330}}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/CreateQrCode" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"data": "https://example.com", "options": {"width": 256, "errorCorrectionLevel": "M"}}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""data"": ""https://example.com"", ""options"": {""width"": 256, ""errorCorrectionLevel"": ""M""}}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://api.docbutterfly.com/api/CreateQrCode", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://api.docbutterfly.com/api/CreateQrCode"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"data": "https://example.com", "options": {"width": 256, "errorCorrectionLevel": "M"}}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://api.docbutterfly.com/api/CreateQrCode
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "data": "https://example.com",
│      "options": {
│        "width": 256,
│        "errorCorrectionLevel": "M"
│      }
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/CreateQrCode"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Create Swiss QR Code

POST /api/CreateSwissQrCode 1 token

Generate a Swiss QR-bill payment code.

Parameters
NameTypeRequiredDescription
account string required IBAN number
amount number required Payment amount
currency string required CHF or EUR
creditor object required {name, address, zip, city, country}
Request Example
JSON
{"account": "CH9300762011623852957", "amount": 199.95, "currency": "CHF", "creditor": {"name": "Company AG", "zip": "8000", "city": "Zurich", "country": "CH"}}
Response Example
JSON
{"success": true, "image": "iVBORw0...", "contentType": "image/png", "spcPayload": "SPC\r\n0200\r\n1\r\nCH9300762011623852957\r\nK\r\nCompany AG\r\n\r\nZurich\r\n\r\n\r\nCH\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n199.95\r\nCHF\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nQRR\r\n\r\n\r\nEPD", "timing": {"total": 12}}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/CreateSwissQrCode" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"account": "CH9300762011623852957", "amount": 199.95, "currency": "CHF", "creditor": {"name": "Company AG", "zip": "8000", "city": "Zurich", "country": "CH"}}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""account"": ""CH9300762011623852957"", ""amount"": 199.95, ""currency"": ""CHF"", ""creditor"": {""name"": ""Company AG"", ""zip"": ""8000"", ""city"": ""Zurich"", ""country"": ""CH""}}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://api.docbutterfly.com/api/CreateSwissQrCode", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://api.docbutterfly.com/api/CreateSwissQrCode"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"account": "CH9300762011623852957", "amount": 199.95, "currency": "CHF", "creditor": {"name": "Company AG", "zip": "8000", "city": "Zurich", "country": "CH"}}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://api.docbutterfly.com/api/CreateSwissQrCode
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "account": "CH9300762011623852957",
│      "amount": 199.95,
│      "currency": "CHF",
│      "creditor": {
│        "name": "Company AG",
│        "zip": "8000",
│        "city": "Zurich",
│        "country": "CH"
│      }
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/CreateSwissQrCode"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Read Barcode from Image

POST /api/ReadBarcodeImage 1 token

Read barcodes from an image.

Parameters
NameTypeRequiredDescription
image string required Base64-encoded image
Request Example
JSON
{"image": "<base64-image>"}
Response Example
JSON
{"success": true, "barcodes": [{"text": "1234567890", "format": "Code128", "position": {"topLeft": {"x": 12, "y": 12}, "topRight": {"x": 258, "y": 12}, "bottomRight": {"x": 258, "y": 98}, "bottomLeft": {"x": 12, "y": 98}}}], "count": 1, "timing": {"total": 713}}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/ReadBarcodeImage" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64-image>"}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""image"": ""<base64-image>""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://api.docbutterfly.com/api/ReadBarcodeImage", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://api.docbutterfly.com/api/ReadBarcodeImage"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"image": "<base64-image>"}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://api.docbutterfly.com/api/ReadBarcodeImage
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "image": "\u003Cbase64-image\u003E"
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/ReadBarcodeImage"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Read QR Code from Image

POST /api/ReadQrCodeImage 1 token

Read QR codes from an image.

Parameters
NameTypeRequiredDescription
image string required Base64-encoded image
Request Example
JSON
{"image": "<base64-image>"}
Response Example
JSON
{"success": true, "qrCodes": [{"value": "https://example.com"}], "count": 1, "timing": {"total": 214}}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/ReadQrCodeImage" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64-image>"}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""image"": ""<base64-image>""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://api.docbutterfly.com/api/ReadQrCodeImage", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://api.docbutterfly.com/api/ReadQrCodeImage"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"image": "<base64-image>"}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://api.docbutterfly.com/api/ReadQrCodeImage
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "image": "\u003Cbase64-image\u003E"
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/ReadQrCodeImage"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Read Swiss QR Code

POST /api/ReadSwissQrCode 1 token

Read and parse Swiss QR-bill data.

swissQrCodes and count are on every 200 response - count is 0 and the array empty when no Swiss QR was found, so "if count > 0" is a usable branch. The flat account/creditor/amount/currency/reference/referenceType/message fields are the original response shape, kept for existing callers, and describe the same code as swissQrCodes[0].
Parameters
NameTypeRequiredDescription
image string required Base64 image of QR-bill
Request Example
JSON
{"image": "<base64-image>"}
Response Example
JSON
{"success": true, "count": 1, "note": null, "swissQrCodes": [{"account": "CH9300762011623852957", "creditor": {"name": "Robert Schneider AG"}, "amount": 199.95, "currency": "CHF", "reference": "210000000003139471430009017", "referenceType": "QRR", "message": "Invoice 2026-0042"}], "account": "CH9300762011623852957", "amount": 199.95, "currency": "CHF"}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/ReadSwissQrCode" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64-image>"}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""image"": ""<base64-image>""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://api.docbutterfly.com/api/ReadSwissQrCode", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://api.docbutterfly.com/api/ReadSwissQrCode"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"image": "<base64-image>"}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://api.docbutterfly.com/api/ReadSwissQrCode
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "image": "\u003Cbase64-image\u003E"
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/ReadSwissQrCode"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Read Barcode from PDF

POST /api/ReadBarcodeDocument 2 tokens

Read barcodes from a PDF document.

Parameters
NameTypeRequiredDescription
pdf string required Base64-encoded PDF
pages array optional Array of page numbers to scan (default all)
Request Example
JSON
{"pdf": "<base64-pdf>", "pages": [1, 2, 3]}
Response Example
JSON
{"success": true, "barcodes": [{"page": 1, "text": "1234567890", "format": "Code128"}], "count": 1, "pagesScanned": [1, 2, 3], "totalPagesInDocument": 12, "timing": {"total": 3120, "browserLaunch": 1502}}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/ReadBarcodeDocument" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"pdf": "<base64-pdf>", "pages": [1, 2, 3]}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""pdf"": ""<base64-pdf>"", ""pages"": [1, 2, 3]}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://api.docbutterfly.com/api/ReadBarcodeDocument", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://api.docbutterfly.com/api/ReadBarcodeDocument"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"pdf": "<base64-pdf>", "pages": [1, 2, 3]}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://api.docbutterfly.com/api/ReadBarcodeDocument
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "pdf": "\u003Cbase64-pdf\u003E",
│      "pages": [
│        1,
│        2,
│        3
│      ]
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/ReadBarcodeDocument"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Read QR Code from PDF

POST /api/ReadQrCodeDocument 2 tokens

Read QR codes from a PDF document.

Parameters
NameTypeRequiredDescription
pdf string required Base64-encoded PDF
pages array optional Array of page numbers to scan (default all)
Request Example
JSON
{"pdf": "<base64-pdf>", "pages": [1, 2, 3]}
Response Example
JSON
{"success": true, "qrCodes": [{"page": 1, "text": "https://example.com", "position": {"topLeft": {"x": 37, "y": 37}, "topRight": {"x": 264, "y": 37}, "bottomRight": {"x": 265, "y": 265}, "bottomLeft": {"x": 37, "y": 264}}}], "count": 1, "pagesScanned": [1, 2, 3], "totalPagesInDocument": 12, "timing": {"total": 2980, "browserLaunch": 1502}}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/ReadQrCodeDocument" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"pdf": "<base64-pdf>", "pages": [1, 2, 3]}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""pdf"": ""<base64-pdf>"", ""pages"": [1, 2, 3]}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://api.docbutterfly.com/api/ReadQrCodeDocument", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://api.docbutterfly.com/api/ReadQrCodeDocument"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"pdf": "<base64-pdf>", "pages": [1, 2, 3]}')

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()

data = response.json()
print(json.dumps(data, indent=2))
┌─────────────────────────────────────────────┐
│  Power Automate - HTTP Action               │
├─────────────────────────────────────────────┤
│                                             │
│  Method:  POST                              │
│  URI:     https://api.docbutterfly.com/api/ReadQrCodeDocument
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "pdf": "\u003Cbase64-pdf\u003E",
│      "pages": [
│        1,
│        2,
│        3
│      ]
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/ReadQrCodeDocument"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed