zplflow logo

Pipelines

Pipelines are reusable ZPL transformation recipes. Define a sequence of steps once and apply them to any ZPL document.

Contents: Pipeline Steps · Create · List · Get One · Delete · Apply · Preview (Free)

Tip: POST /v1/pipelines/preview is free — test your steps without spending tokens and get a PNG visual render of the output.


Pipeline Steps

Each step has a type and type-specific parameters. Variables use {{placeholder}} syntax.

Type Cost Key Parameters Description
rotate 2 orientation: N, R, I, B Rotate label
replace_text 1 search, replace String replacement. Supports {{vars}}
add_barcode 1 barcode_type: code128/code39, value, x, y, height Linear barcode
add_gs1_128 2 x, y, height, elements[{ai,value}] GS1-128 barcode
add_text 1 x, y, font, font_height, value, block_width Text field. Supports {{vars}}
add_qrcode 1 x, y, value, magnification, error_correction QR Code
add_datamatrix 1 x, y, value, symbol_height DataMatrix
add_box 1 x, y, width, height, thickness, color Rectangle
add_line 1 x, y, length, orientation, thickness Line
replace_barcode_value 1 old_value, new_value Barcode content replacement
remove_graphics 1 - Strip embedded images
set_font 1 from_font, to_font, height, width Font replacement
add_timestamp 1 format, timezone, x, y Current date/time
format_date 1 field_pattern, input_format, output_format Date reformatting
regex_replace 1 pattern, replace Regex search/replace
set_print_params 1 darkness, print_speed, media_type Printer settings
set_label_dimensions 1 width_dots, length_dots Label size override
scale 2 target_width_mm, target_height_mm Resize
add_margin 2 top_dots, right_dots, bottom_dots, left_dots Padding
crop 2 x, y, width_dots, height_dots Crop region
mirror 2 axis: horizontal/vertical Mirror
add_image 3 image_base64, x, y, width_dots, height_dots Embed image
repeat count count Print quantity

POST /v1/pipelines — Create

{
  "name": "Warehouse Label",
  "steps": [
    { "type": "add_text", "x": 50, "y": 100, "font": "0", "font_height": 30, "value": "SKU: {{sku}}" },
    { "type": "add_barcode", "barcode_type": "code128", "value": "{{sku}}", "x": 50, "y": 200, "height": 80 }
  ]
}

Response (201):

{
  "pipeline_id": "d4e5f6a7-b8c9-0123-4567-890abcdef0",
  "name": "Warehouse Label",
  "steps": [...],
  "created_at": 1747132800
}

GET /v1/pipelines — List All

curl -H "Authorization: Bearer lb_live_xxxx" https://api.zplflow/v1/pipelines
import requests

resp = requests.get(
    "https://api.zplflow/v1/pipelines",
    headers={"Authorization": "Bearer lb_live_xxxx"}
)
pipelines = resp.json()
for p in pipelines:
    print(f"{p['pipeline_id']}: {p['name']}")
package main

import (
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://api.zplflow/v1/pipelines", nil)
    req.Header.Set("Authorization", "Bearer lb_live_xxxx")
    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()

    var pipelines []struct {
        PipelineID string `json:"pipeline_id"`
        Name       string `json:"name"`
    }
    json.NewDecoder(resp.Body).Decode(&pipelines)
    for _, p := range pipelines {
        fmt.Printf("%s: %s\n", p.PipelineID, p.Name)
    }
}
<?php
$ch = curl_init("https://api.zplflow/v1/pipelines");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer lb_live_xxxx"]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$pipelines = json_decode(curl_exec($ch), true);
foreach ($pipelines as $p) {
    echo "{$p['pipeline_id']}: {$p['name']}\n";
}

AS400 / SQL Native (IBM i)


SELECT SYSTOOLS.HTTPGETCLOB(
    'https://api.zplflow/v1/pipelines',
    NULL,
    '{"Authorization":"Bearer lb_live_xxxx"}'
) AS response
FROM SYSIBM.SYSDUMMY1;

AS400 / HTTPAPI (RPG)


dcl-s response varchar(32000);
dcl-s rc int(10);

rc = http_req('GET'
    : 'https://api.zplflow/v1/pipelines'
    : *null
    : %trim(response)
    : 'Authorization: Bearer lb_live_xxxx'
    : *null
    : *null
    : 30000
    : *null);

Returns an array of pipelines.

Response

[
  {
    "pipeline_id": "d4e5f6a7-b8c9-0123-4567-890abcdef0",
    "name": "Warehouse Label",
    "step_count": 2,
    "created_at": 1747132800,
    "updated_at": 1747132800
  }
]

GET /v1/pipelines/{id} — Get One

curl -H "Authorization: Bearer lb_live_xxxx" https://api.zplflow/v1/pipelines/d4e5f6a7-...
import requests

resp = requests.get(
    "https://api.zplflow/v1/pipelines/d4e5f6a7-b8c9-0123-4567-890abcdef0",
    headers={"Authorization": "Bearer lb_live_xxxx"}
)
pipeline = resp.json()
print(pipeline["name"], pipeline["steps"])
package main

import (
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET",
        "https://api.zplflow/v1/pipelines/d4e5f6a7-b8c9-0123-4567-890abcdef0", nil)
    req.Header.Set("Authorization", "Bearer lb_live_xxxx")
    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()

    var pipeline struct {
        PipelineID string `json:"pipeline_id"`
        Name       string `json:"name"`
    }
    json.NewDecoder(resp.Body).Decode(&pipeline)
    fmt.Printf("%s\n", pipeline.Name)
}
<?php
$ch = curl_init("https://api.zplflow/v1/pipelines/d4e5f6a7-b8c9-0123-4567-890abcdef0");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer lb_live_xxxx"]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$pipeline = json_decode(curl_exec($ch), true);
echo $pipeline['name'] . "\n";

AS400 / SQL Native (IBM i)


SELECT SYSTOOLS.HTTPGETCLOB(
    'https://api.zplflow/v1/pipelines/d4e5f6a7-b8c9-0123-4567-890abcdef0',
    NULL,
    '{"Authorization":"Bearer lb_live_xxxx"}'
) AS response
FROM SYSIBM.SYSDUMMY1;

AS400 / HTTPAPI (RPG)


dcl-s response varchar(32000);
dcl-s rc int(10);

rc = http_req('GET'
    : 'https://api.zplflow/v1/pipelines/d4e5f6a7-b8c9-0123-4567-890abcdef0'
    : *null
    : %trim(response)
    : 'Authorization: Bearer lb_live_xxxx'
    : *null
    : *null
    : 30000
    : *null);

DELETE /v1/pipelines/{id} — Delete

curl -X DELETE https://api.zplflow/v1/pipelines/d4e5f6a7-... \
  -H "Authorization: Bearer lb_live_xxxx"
import requests

resp = requests.delete(
    "https://api.zplflow/v1/pipelines/d4e5f6a7-b8c9-0123-4567-890abcdef0",
    headers={"Authorization": "Bearer lb_live_xxxx"}
)
# 204 No Content
package main

import (
    "net/http"
)

func main() {
    req, _ := http.NewRequest("DELETE",
        "https://api.zplflow/v1/pipelines/d4e5f6a7-b8c9-0123-4567-890abcdef0", nil)
    req.Header.Set("Authorization", "Bearer lb_live_xxxx")
    http.DefaultClient.Do(req)
}
<?php
$ch = curl_init("https://api.zplflow/v1/pipelines/d4e5f6a7-b8c9-0123-4567-890abcdef0");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer lb_live_xxxx"]);
curl_exec($ch);

AS400 / SQL Native (IBM i)


SELECT SYSTOOLS.HTTPDELETECLOB(
    'https://api.zplflow/v1/pipelines/d4e5f6a7-b8c9-0123-4567-890abcdef0',
    NULL,
    '{"Authorization":"Bearer lb_live_xxxx"}'
) AS response
FROM SYSIBM.SYSDUMMY1;

AS400 / HTTPAPI (RPG)


dcl-s response varchar(32000);
dcl-s rc int(10);

rc = http_req('DELETE'
    : 'https://api.zplflow/v1/pipelines/d4e5f6a7-b8c9-0123-4567-890abcdef0'
    : *null
    : %trim(response)
    : 'Authorization: Bearer lb_live_xxxx'
    : *null
    : *null
    : 30000
    : *null);

Response: 204 No Content

Note: Pipelines cannot be modified in-place. To update a pipeline, delete the existing one and create a new one with the updated steps. Existing jobs using the old pipeline ID are unaffected.


POST /v1/pipelines/{id}/apply — Apply to Documents

Idempotent: yes
Cost: sum of step costs × document count

Applies a saved pipeline to 1-5 ZPL documents concurrently.

{
  "documents": [
    {
      "zpl_base64": "XlpB...",
      "variables": {
        "sku": "ABC-001",
        "batch": "BATCH-001"
      }
    }
  ]
}

Response:

{
  "tokens_charged": 4,
  "documents": [
    { "zpl_base64": "XlpB..." }
  ]
}

Errors: 400 INVALID_PARAMS, 409 INSUFFICIENT_TOKENS


POST /v1/pipelines/preview — Free Preview

Test pipeline steps without token charge. Returns transformed ZPL and PNG render.

{
  "zpl": "^XA^FO50,50^FDHello^FS^XZ",
  "steps": [{ "type": "replace_text", "search": "Hello", "replace": "World" }],
  "page": 0
}

Response:

{
  "zpl": "^XA\n^FO50,50^FDWorld^FS\n^XZ",
  "png_base64": "iVBORw0KGgo...",
  "page_count": 1,
  "current_page": 0
}

Next Steps