Skip to main content
For any questions, feel free to contact our integrations team at integrations@packeta.com

How to create a Shipment

A shipment (or virtual shipment/packet) represents a group of individual packets that are shipped together. It is mostly used by e-shops when handing over packets to the courier, either during collection or at the depot. You simply add all your packets to a shipment so the courier can scan them at once, which speeds up handover and delivery.

How to create a shipment​

To create a shipment, use the createShipment() method. The response includes the shipment <barcode> which you will later need.

Example​

Request

<createShipment>
<apiPassword>{{API_PASSWORD}}</apiPassword>
<packetIds>
<id>Z3692111615</id>
<id>Z4541958561</id>
<id>Z1885286407</id>
</packetIds>
</createShipment>

Response

<response>
<status>ok</status>
<result>
<id>200542356</id>
<checksum></checksum>
<barcode>D-***-XM-200542356</barcode>
<barcodeText>D-***-XM-200542356</barcodeText>
</result>
</response>

Barcode​

Now that you've created the shipment you will want to print the barcode for the courier to scan. You can do so by using the barcodePng() method.

Example​

Request

<barcodePng>
<apiPassword>{{API_PASSWORD}}</apiPassword>
<barcode>D-***-XM-200542356</barcode>
</barcodePng>

Response

<response>
<status>ok</status>
<result>
/9j/4AAQSkBl//ggZyB2MS4wI....
</result>
</response>

This is how your barcode will look like:

barcode

List of packets​

You can also retrieve a list of the packets that you added to the shipment. Use the shipmentPackets() method in order to do so.

Example​

Request

<shipmentPackets>
<apiPassword>{{API_PASSWORD}}</apiPassword>
<shipmentId>D-***-XM-200542356</shipmentId>
</shipmentPackets>

Response

<response>
<status>ok</status>
<result>
<packets>
<packet>
<id>3692111615</id>
<barcode>Z3692111615</barcode>
<barcodeText>Z 369 2111 615</barcodeText>
</packet>
<packet>
<id>1885286407</id>
<barcode>Z1885286407</barcode>
<barcodeText>Z 188 5286 407</barcodeText>
</packet>
<packet>
<id>4541958561</id>
<barcode>Z4541958561</barcode>
<barcodeText>Z 454 1958 561</barcodeText>
</packet>
</packets>
</result>
</response>

Possible errors​

You may come accross a PacketIdsFault when trying to create the shipment. Among the most common reasons for this error is the fact that the packet was already consigned. Also if your packet is a claim assistent you will not be able to add it to the shipment.

IMPORTANT

It is not possible to create a shipment with a packet that was already consigned.

CONTACT US

Didn't find what you're looking for? Reach out to our integration support team at integrations@packeta.com.