Biklo for developersTESTsandbox-api.biklo.comchange

Request a waybill

POST/v1/orders/{id}/awb

scope orders.write

Accepting an order already books its courier, so this returns that AWB (already_existed: true). It books one only for an order accepted before accept did so — and it is idempotent: never a second shipment for the same order.

Request body#

Example

[]

Response#

FieldTypeDescription
awbobjectThe waybill.
awb.numberstringThe AWB number. Hand this to the courier and quote it in any dispute.
awb.tracking_urlstring|nullWhere the parcel can be followed.
already_existedbooleantrue means this order already had a waybill and you got the existing one back, not a second shipment. The call is idempotent on purpose — booking twice costs real money.

Example

{
    "awb": {
        "number": "SBX0000007112",
        "tracking_url": "https://.../sandbox/tracking/SBX0000007112"
    },
    "already_existed": false
}

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

curl -X POST "https://sandbox-api.biklo.com/v1/orders/711/awb" \
  -H "Authorization: Bearer bk_test_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '[]'
<?php

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

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer bk_test_YOUR_KEY',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS     => json_encode([
    ]),
]);

$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("POST"),
    "https://sandbox-api.biklo.com/v1/orders/711/awb");

request.Content = new StringContent(
    @"[]",
    System.Text.Encoding.UTF8,
    "application/json");

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

response = requests.post(
    "https://sandbox-api.biklo.com/v1/orders/711/awb",
    headers={"Authorization": "Bearer bk_test_YOUR_KEY"},
    json=[],
)

data = response.json()
const response = await fetch("https://sandbox-api.biklo.com/v1/orders/711/awb", {
  method: "POST",
  headers: {
    Authorization: "Bearer bk_test_YOUR_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify([])
});

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/awb"))
    .header("Authorization", "Bearer bk_test_YOUR_KEY")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString(
        "[]"))
    .build();

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