Carriers' PUDOs
Creating carrier PUDOs packets can be a little confusing.
To create a Carrier PUDOs packet you need two things:
addressId-idof the desired carrier to which the Carrier pick-up point belongscarrierPickupPoint- code of the destination Carrier pick-up point
These can be obtained either from our Widget or from our data feeds. (carriers list and carriers' PUDOs feed)
To create a Carrier pick-up point packet, you have to pass the ID of the desired carrier into the addressId field, and the code of the Carrier pick-up point into the carrierPickupPoint field.
- REST
- SOAP
- PHP
- C#
- Node.js
<!--request-->
<createPacket>
<apiPassword>{{API_PASSWORD}}</apiPassword>
<packetAttributes>
<number>orderNumber</number>
<name>John</name>
<surname>Doe</surname>
<email>example@packetatest.com</email>
<phone>+48698183542</phone>
<company>Company</company>
<!--ID of external carrier, in this case Polish InPost Paczkomaty-->
<addressId>3060</addressId>
<value>123</value>
<cod>0</cod>
<currency>CZK</currency>
<weight>1</weight>
<eshop>{{SENDER_INDICATION}}</eshop>
<note>Note</note>
<!--Code of carrier pickup point-->
<carrierPickupPoint>BIA10M</carrierPickupPoint>
<!--This carrier requires parcel size-->
<size>
<height>50</height>
<width>200</width>
<length>150</length>
</size>
</packetAttributes>
</createPacket>
<!--response-->
<response>
<status>ok</status>
<result>
<id>4111663024</id>
<barcode>Z4111663024</barcode>
<barcodeText>Z 411 1663 024</barcodeText>
</result>
</response>
<!--request-->
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://www.zasilkovna.cz/api/soap.wsdl2" xmlns:soap1="http://www.zasilkovna.cz/api/soap.wsdl">
<soapenv:Header/>
<soapenv:Body>
<soap:createPacket>
<apiPassword>{{API_PASSWORD}}</apiPassword>
<attributes>
<soap1:number>orderNumber</soap1:number>
<soap1:name>John</soap1:name>
<soap1:surname>Doe</soap1:surname>
<soap1:company>Company</soap1:company>
<soap1:email>example@packetatest.com</soap1:email>
<soap1:phone>+48698183542</soap1:phone>
<soap1:addressId>3060</soap1:addressId>
<soap1:cod>0</soap1:cod>
<soap1:currency>CZK</soap1:currency>
<soap1:value>123</soap1:value>
<soap1:weight>2.5</soap1:weight>
<soap1:eshop>MyEshop</soap1:eshop>
<soap1:note>Note</soap1:note>
<soap1:carrierPickupPoint>BIA10M</soap1:carrierPickupPoint>
<soap1:size>
<soap1:length>50</soap1:length>
<soap1:width>200</soap1:width>
<soap1:height>150</soap1:height>
</soap1:size>
</attributes>
</soap:createPacket>
</soapenv:Body>
</soapenv:Envelope>
<!--response-->
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.zasilkovna.cz/api/soap.wsdl">
<SOAP-ENV:Body>
<ns1:createPacketResponse>
<createPacketResult>
<ns1:id>3879730403</ns1:id>
<ns1:barcode>Z3879730403</ns1:barcode>
<ns1:barcodeText>Z 387 9730 403</ns1:barcodeText>
</createPacketResult>
</ns1:createPacketResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<?php
$apiPassword = 'apiPassword';
$packetAttributes = [
'number' => '20220513001',
'name' => 'John',
'surname' => 'Doe',
'email' => 'example@packetatest.com',
'phone' => '+420777123456',
'addressId' => 3060, // ID of external carrier, in this case Polish InPost Paczkomaty
'carrierPickupPoint' => 'BIA10M', // Code of carrier pickup point
'value' => '100',
'currency' => 'CZK',
'weight' => 2.5,
'eshop' => 'MyEshop',
'note' => 'note',
// This carrier requires parcel size
'size' => [
'height' => 50,
'width' => 200,
'length' => 150,
]
];
try {
$client = new SoapClient("https://www.zasilkovna.cz/api/soap.wsdl");
$result = $client->createPacket($apiPassword, $packetAttributes);
var_dump($result);
}
catch (SoapFault $e) {
echo $e->getMessage();
if (isset($e->detail->PacketAttributesFault)) {
var_dump($e->detail->PacketAttributesFault->attributes->fault);
} elseif (isset($e->detail->IncorrectApiPasswordFault)) {
var_dump('Incorrect API password.');
}
}
using System;
using System.ServiceModel;
using System.Threading.Tasks;
using PacketaService;
namespace PacketaClientExample
{
class Program
{
static async Task Main(string[] args)
{
BasicHttpsBinding binding = new BasicHttpsBinding();
EndpointAddress endpointAddress = new EndpointAddress("https://www.zasilkovna.cz/api/soap");
const string apiPassword = "apiPassword";
PacketAttributes packetAttributes = new PacketAttributes
{
addressId = 3060,
carrierPickupPoint = "BIA10M",
name = "Test",
surname = "Test",
phone = "+48698183000",
email = "example@packetatest.com",
value = 500,
weight = 1,
eshop = "MyEshop",
number = "orderNumber",
size =
new Size {
height = 200,
width = 50,
length= 150,
}
};
PacketaClient client = new PacketaClient(binding, endpointAddress);
try
{
createPacketResponse response = await client.createPacketAsync(new createPacketRequest(apiPassword, packetAttributes));
//Process response
Console.WriteLine(response.createPacketResult.id);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}
import { Builder, Parser } from "xml2js"
const requestBody = {
createPacket: {
apiPassword: "apiPassword",
packetAttributes: {
addressId: 3060,
carrierPickupPoint: "BIA10M",
name: "Test",
surname: "Test",
phone: "+48698183000",
email: "example@packetatest.com",
cod: 100,
value: 100,
weight: 1,
eshop: "MyEshop",
number: "orderNumber",
size: {
width: 50,
height: 200,
length: 150
}
}
}
}
try {
const response = await fetch(
"https://www.zasilkovna.cz/api/rest",
{
method: "POST",
body: new Builder().buildObject(requestBody)
}
);
const responseBody = await new Parser({ explicitArray: false }).parseStringPromise(await response.text());
//process response
console.dir(responseBody, {depth: null});
}
catch (exception) {
console.log(exception);
}