Přeskočit na hlavní obsah
For any questions, feel free to contact our integrations team at integrations@packeta.com

Carrier labels

Carrier labels are labels provided directly by external carriers. They are not generated by the Packeta system but retrieved from the carrier.

Before you can generate a carrier label, the courier number must first be obtained. The courier number represents the packet's identification number within the carrier's system.

Generating carrier labels​

To generate a carrier label:

  1. Create a packet using the createPacket() method.
  2. Retrieve the carrier tracking number using the packetCourierNumber() method.
  3. Generate the label using one of the following methods:
important

Carrier labels support only the A6 format.

Carrier support​

Carrier label capabilities vary by carrier. Before implementing carrier labels, verify whether the carrier supports:

  • carrier label generation - apiAllowed within the carrier list.
    • If apiAllowed is not available for a carrier, carrier labels cannot be generated through the API. In such case you can use the Packeta label and the packet will be relabeled without additional charges.
  • PDF labels - Response contains a Base64-encoded PDF document.
  • PNG labels - Response contains a Base64-encoded PNG image.
  • ZPL labels - Response contains HTML/XML escaped string which must be unescaped before printing.

For a complete overview of supported carriers and their capabilities, see the Carrier Overview.

The Carrier Overview provides:

  • supported carriers grouped by destination country
  • label availability (PDF / PNG / ZPL)
  • carrier-specific validation rules
  • common integration issues
  • carrier label examples

From there, you can navigate to country-specific and carrier-specific documentation.

ZPL Support​

Some carriers support ZPL label format. They might also support only one of the available label resolutions (DPI). Please see the Carrier Overview to find the specifics of your carrier.

Example requests​

Example packetCourierLabelPdf() request/response


<!--request-->
<packetCourierLabelPdf>
<apiPassword>{{API_PASSWORD}}</apiPassword>
<packetId>1234567890</packetId>
<courierNumber>DR4362230958U</courierNumber>
</packetCourierLabelPdf>


<!--response-->
<response>
<status>ok</status>
<result>JVBERi0xLjcKJeLjz9MKNSAwIG9iago8PCAvVHlwZSAvU.....JlZWU5YjQ1MD4gXSA+PgpzdGFydHhyZWYKMjAyMTUKJSVFT0YK</result>
</response>


Example packetCourierLabelPng() request/response


<!--request-->
<packetCourierLabelPng>
<apiPassword>{{API_PASSWORD}}</apiPassword>
<packetId>1234567890</packetId>
<courierNumber>DR4362230958U</courierNumber>
</packetCourierLabelPng>


<!--response-->
<?xml version="1.0" encoding="utf-8"?>
<response>
<status>ok</status>
<result>iVBORw0KGgoAAAANSUhEUgAABIwAA.....TjrppJMm5P8DkxJkWU8DjcEAAAAASUVORK5CYII=</result>
</response>


Example packetsCourierLabelsPdf() request/response


<!--request-->
<packetsCourierLabelsPdf>
<apiPassword>{{API_PASSWORD}}</apiPassword>
<packetIdsWithCourierNumbers>
<packetIdWithCourierNumber>
<packetId>1234567890</packetId>
<courierNumber>DR4362230958U</courierNumber>
</packetIdWithCourierNumber>
<packetIdWithCourierNumber>
<packetId>1234567891</packetId>
<courierNumber>DR4362235031U</courierNumber>
</packetIdWithCourierNumber>
</packetIdsWithCourierNumbers>
<offset>0</offset>
<format>A6 on A6</format>
</packetsCourierLabelsPdf>


<!--response-->
<response>
<status>ok</status>
<result>JVBERi0xLjcKJeLjz9MKNSAwIG9iago8PCA.....vVHlwZSAvUGFYKMzQ0MDAKJSVFT0YK</result>
</response>


Example packetCourierLabelZpl() request/response


<!--request-->
<packetCourierLabelZpl>
<apiPassword>{{API_PASSWORD}}</apiPassword>
<packetId>1234567890</packetId>
<courierNumber>994717547550338388</courierNumber>
<dpi>300</dpi>
</packetCourierLabelZpl>


<!--response-->
<response>
<status>ok</status>
<result>^XA^CI28^CWN,TT0003M_.FNT^LH0,0^FO118,366^BY6^BCN,271,N,N,N,A^FD994717547550338388^FS^FT118,708^ANN,58^FD99.47.175475.50338388^FS^FT118,708^ANN,58^FD99.47.175475.50338388^FS^FT118,709^ANN,58^FD99.47.175475.50338388^FS^FT118,708^ANN,58^FD99.47.175475.50338388^FS^FT117,708^ANN,58^FD99.47.175475.50338388^FS^FT118,708^ANN,58^FD99.47.175475.50338388^FS^FT118,707^ANN,58^FD99.47.175475.50338388^FS^FT118,708^ANN,58^FD99.47.175475.50338388^FS^FT119,708^ANN,58^FD99.47.175475.50338388^FS^FO118,118^BY3^BCN,95,N,N,N,A^FDCD503383886LI^FS^FT229,248^ANN,29^FDCD503383886LI^FS^FT229,248^ANN,29^FDCD503383886LI^FS^FT229,249^ANN,29^FDCD503383886LI^FS^FT229,248^ANN,29^FDCD503383886LI^FS^FT228,248^ANN,29^FDCD503383886LI^FS^FT229,248^ANN,29^FDCD503383886LI^FS^FT229,247^ANN,29^FDCD503383886LI^FS^FT229,248^ANN,29^FDCD503383886LI^FS^FT230,248^ANN,29^FDCD503383886LI^FS^FO821,268^GFA,1040,1040,13,,:::::g0C,R03F80FE03F8FFC,R03FC1FF07F8FFC,R030E3870EI0C,R030E3838EI0C,R030E3838FI0C,R030E3038FE00C,R03FC70387F00C,R03F870381F80C,R0300303803C0C,R0300383801C0C,R030038780380C,R03001C70E780C,R03I0FE1FF00C,R03I07C07E00C,,:::::R0QF8,Q01QF,Q03QF,Q07PFE,Q0QFC,X0JF8,W01JF,W03IFE,W07IFC,W0JF8,V01JF,V01IFE,O03IFC003IFC,O07IF8007IFC,O0JF800JF8,N01JF001JF,N03IFE003IFE,N07IFC007IFC,N0JF800JF8,M01JF001JF,M03IFE003IFE,M07IFC007IFC,M0JF8007IF8,L01JFI0JF,L01IFE001JF,L03IFC003IFE,L07IF8007IFC,L0JF800JF8,K01JF001IFE,K03IFE003IF8,K07IFC007IF,K0JF800IF8,J01JF001FF8,J03IFE,J07IFC,J07IF8,J0JF,I01IFE,I03IFC,I07IF8,I0JF8,001JF,003IFE,007IFC,00JF8,01JF,03IFC,07IF8,07FFC,0FFE,,::^FS^FT161,1096^ANB,29^FDtest^FS^FT205,1096^ANB,29^FDPacketa Holding^FS^FT249,1096^ANB,29^FDc/o IMPC Schaan^FS^FT293,1096^ANB,29^FDPostfach 5601^FS^FT336,1096^ANB,29^FD9494 Schaan^FS^FT468,872^ANN,47^FDUmpa Lumpa^FS^FT468,934^ANN,47^FDViktoriapl. 1^FS^FT468,996^ANN,47^FD3013 Bern^FS^XZ</result>
</response>


Like Packeta labels, PDF and PNG labels are provided in base64 encoded form, and thus require decoding.

ZPL labels come with XML or HTML escaping as the ZPL format may include characters that are interpreted as special characters in XML/HTML. Because of this, ZPL labels need to be unescaped before printing.