Approach A — your own carrier integration, just record the number in Base
If you generate the label outside Base (your own GLS/DPD/etc. integration in your WMS), you just write the finished tracking number into Base usingcreatePackageManual.
| Parameter | Type | Description |
|---|---|---|
order_id | int | Order ID in Base. |
courier_code | varchar(20) | Carrier code from getCouriersList, or a custom carrier name. |
package_number | varchar(40) | Tracking (consignment) number. |
pickup_date | int (unix) | Dispatch date. |
return_shipment | bool | Optional, default false. Marks the shipment as a return. |
courier_code still matters here — it’s how Base knows which carrier you used and can pass that along to the marketplace correctly.
Approach B — Base’s built-in carrier integration
Most commonly used for marketplace-specific shipping like Allegro (“Wysyłam z Allegro”) or Alza Shipping. You need the relevant shipping integration connected and configured in Base first. Then you need three methods:createPackage— generates the label with the carrier.getOrderPackages— fetches label IDs for an order. Only needed for multi-package shipments; for a single package you already get the ID in thecreatePackageresponse.getLabel— downloads the label itself (base64, PDF/ZPL/EPL/DPL/HTML/GIF depending on the carrier’s Base settings).
createPackage — parameters
| Parameter | Type | Description |
|---|---|---|
order_id | int | Order ID. |
courier_code | varchar(20) | Carrier code. Always "allegrokurier" for Allegro shipping. |
account_id | int | Optional. Specific shipping account ID (getCourierAccounts); if omitted, the first one found is used. |
fields | array | Carrier-specific form fields (getCourierFields / getCourierServices). |
packages | array | Dimensions (cm) and weight (kg) of the package(s). Add another object to the array for multi-package shipments. |
package_id, package_number (tracking number), and courier_inner_number.
getOrderPackages and getLabel
getOrderPackages
getLabel
getLabel accepts either package_id or package_number — one is enough. The response includes extension (pdf/html/gif/png/epl/zpl/dpl) and label as base64.
How the tracking number gets back to the order source
Depending on the integration’s settings in Base, the tracking number is forwarded to the order source either:- immediately after it’s added, or
- when the order is switched to a specific status — note this isn’t instant, it runs in batches, typically around 9:00, 10:00, 13:00, 16:00, and 23:00 (± a few minutes). For Alza integrations, the cut-off time (COT) setting also plays a role.
Deleting a shipment
A created shipment can be deleted withdeleteCourierPackage. For Alza integrations, a strict rule applies: once a label has been sent to Alza (Shipment Departure occurred), never delete it — set the order status to Rejected instead (see Statuses). Deleting is only safe before the label has been transmitted to the marketplace.