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

Packeta API

Packeta API is available through two interfaces:

Both interfaces provide identical functionality. For the list of available API methods see the API reference.

Testing​

Packeta does not have a sanbox environment.

You can use your production account for testing purposes, as no charges apply unless a packet physically enters the Packeta network.

To avoid affecting live operations, consider creating a dedicated testing sender.

See also:

SOAP​

Endpoint​

  • WSDL: https://www.zasilkovna.cz/api/soap.wsdl
  • WSDL for PHP (32-bit): https://www.zasilkovna.cz/api/soap-php-bugfix.wsdl

The native PHP SoapClient tends to fail at processing 64-bit integers on 32-bit systems. Therefore, for such systems, we recommend using our bugfix WSDL for PHP, where the unsignedLong type is replaced with string. Packet IDs should always be handled as string values, as the standard signedInt may be incapable of holding the value.

Example requests​

Example createPacket() request

using System;
using System.ServiceModel;

namespace ConsoleApplication1
{
using Packeta;
class Program
{
static void Main(string[] args)
{
Packeta.PacketaClient gw = new PacketaClient();
string apiPassword = "{{API_PASSWORD}}";

PacketAttributes attrs = new PacketAttributes();
attrs.number = "123456";
attrs.name = "John";
attrs.surname = "Doe";
attrs.email = "example@packetatest.com";
attrs.phone = "+420777123456";
attrs.addressId = 79; //Praha 4, Pražského povstání, Na Pankráci 969/97
attrs.cod = 145.55;
attrs.value = 145.55;
attrs.weight = 2;
attrs.eshop = "MyEshop";

PacketIdDetail packet;
try
{
packet = gw.createPacket(apiPassword, attrs);
}
catch (FaultException<PacketAttributesFault> e) {
// TODO: process error
}
}
}
}

REST/XML​

Endpoint​

https://www.zasilkovna.cz/api/rest

Send an HTTP POST request with an XML body. The root element represents the API method name and its child elements represent the method arguments.

Example request​

Example createPacket() request

<createPacket>
<apiPassword>{{API_PASSWORD}}</apiPassword>
<packetAttributes>
<number>123456</number>
<name>John</name>
<surname>Doe</surname>
<email>example@packetatest.com</email>
<phone>+420777123456</phone>
<addressId>79</addressId>
<cod>145.55</cod>
<value>145.55</value>
<weight>2</weight>
<eshop>{{SENDER_INDICATION}}</eshop>
</packetAttributes>
</createPacket>

The server's response is shaped in the same manner as the request, with the exception that the root element carries the name of the return type.