ChartQuery

Label Convert

POST
/v1/label/convert

Convert printer commands from one language to another. POST source, from, and to. from is the source language (tsc, zpl, epl, …). to is the target (tsc, zpl, escpos, …).

Credit cost: 5 credits per call

Query Parameters

fields?string

Comma-separated list of response fields to return, with dot notation for nested fields (e.g. name,location.city).

is_async?boolean

Run the request as a background job: the API answers 202 with a job_id to poll on GET /v1/jobs/{id}.

Defaultfalse
soft_fail?boolean

Return HTTP 200 even when the request fails; the error is in the error field of the body.

Defaultfalse

Request Body

application/json
  1. body
source*string

Raw printer commands to convert. Also send from and to.

from*string

Source language.

Default"tsc"
Value in"tsc""zpl""epl""cpcl""dpl""sbpl""ipl"
to*string

Target language.

Default"tsc"
Value in"tsc""zpl""epl""cpcl""dpl""sbpl""escpos""starprnt""ipl"
dpi?number

Override DPI on the converted output.

speed?number

Override print speed, 1-18.

density?number

Override print darkness, 0-15.

copies?number

Override copies. Minimum 1.

Response Body

Successful response

application/json
  1. response
to?string
from?string
output?string
warnings?array<unknown>
width_dots?integer
height_dots?integer
elements_count?integer
output_encoding?string
Example Request
curl -X POST 'https://api.chartquery.com/v1/label/convert' \  -H 'Content-Type: application/json' \  -d '{  "source": "string",  "from": "tsc",  "to": "tsc"}'
Example Response
{  "to": "zpl",  "from": "tsc",  "output": "^XA\n^PW320\n^LL240\n^FO10,10^A0N,20,20^FDHello World^FS\n^PQ1\n^XZ",  "warnings": [],  "width_dots": 320,  "height_dots": 240,  "elements_count": 1,  "output_encoding": "utf-8"}