Biklo for developersTESTsandbox-api.biklo.comchange

Download the label

GET/v1/orders/{id}/label

scope orders.read

Returns the label BYTES, not JSON — send it straight to a printer. ZPL is what most warehouse printers want. PDF labels come in a page size: ?size=a6 (105 × 148 mm, label printer), a5, a4, or original (the courier's own PDF, usually an A4 sheet with the label printed twice). Without size you get the size the seller chose in their Biklo settings, and A6 if they never chose. Each distinct label gets its own portrait page; a duplicate copy is dropped, every parcel of a multi-parcel order is kept. A4/A5 print at real size, A6 fills the page. The X-Label-Size response header says what you received — original while Biklo has label formatting switched off. size does not apply to ZPL.

Query parameters#

NameExample
formatpdfpdf or zpl
sizea6PDF page size: a6, a5, a4 or original. Default: the seller's saved choice, else a6.

Response#

FieldTypeDescription
(binary)fileThe label BYTES, not JSON — send them straight to a printer. Content-Type is application/pdf or application/octet-stream for ZPL, chosen by ?format=. Request a waybill first, or you get no_awb (409). An unknown size is invalid_size (400).
X-Label-SizeheaderThe page size actually served: a6, a5, a4 or original.

Example

"<binary: application/pdf>"

Failures use the shared error envelope — a machine-readable code and a request_id to quote to support. Error handling.

curl -X GET "https://sandbox-api.biklo.com/v1/orders/711/label?format=pdf" \
  -H "Authorization: Bearer bk_test_YOUR_KEY"
<?php

$ch = curl_init('https://sandbox-api.biklo.com/v1/orders/711/label?format=pdf');

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'GET',
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer bk_test_YOUR_KEY',
    ],
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
using System.Net.Http;
using System.Net.Http.Headers;

var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", "bk_test_YOUR_KEY");

var request = new HttpRequestMessage(
    new HttpMethod("GET"),
    "https://sandbox-api.biklo.com/v1/orders/711/label?format=pdf");

var response = await client.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();
import requests

response = requests.get(
    "https://sandbox-api.biklo.com/v1/orders/711/label?format=pdf",
    headers={"Authorization": "Bearer bk_test_YOUR_KEY"},
)

data = response.json()
const response = await fetch("https://sandbox-api.biklo.com/v1/orders/711/label?format=pdf", {
  method: "GET",
  headers: {
    Authorization: "Bearer bk_test_YOUR_KEY"
  }
});

const data = await response.json();
import java.net.http.*;
import java.net.URI;

var client = HttpClient.newHttpClient();

var request = HttpRequest.newBuilder()
    .uri(URI.create("https://sandbox-api.biklo.com/v1/orders/711/label?format=pdf"))
    .header("Authorization", "Bearer bk_test_YOUR_KEY")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();

var response = client.send(request, HttpResponse.BodyHandlers.ofString());