Packetery API reference

Data structures reference

ClaimAttributes

Type Field name Constraints Required Description
unsignedLong id 10 digits no An unique packet ID from your assigned range. NOTE: Make sure to use 64-bit type.
string number 1-24 alphanumeric yes An unique ID of the order (from your e-shop).
string email valid e-mail if no phone Recipient's e-mail.
string phone valid phone number if no e-mail Recipient's phone.
decimal value see max values in TOS yes Packet's value (for insurance purposes).
string currency CZK, EUR, HUF, PLN, RON no Packet value currency.
string eshop when using more senders Sender label. If the entered sender does not exist yet, a new one is created.
bool sendLabelToEmail no If set to true, PDF label will be sent to the recipient via email.

CurrentStatusRecord

An extension of StatusRecord, so it contains the same and some additional fields.

Type Field name Required Description
... ... ... ...
boolean isReturning yes Indicates whether the packet is on its way back to the sender.
date storedUntil yes The last possible day to pick up the packet. After this date, it will start returning to the sender.

CustomsDeclaration

Type Constraints Field name Required Description
decimal deliveryCostEur yes A cost charged to the customer for shipping in EUR.
decimal deliveryCost yes A cost charged to the customer for shipping in the currency of the destination country.
CustomsDeclarationItems type CustomsDeclarationItems items yes An array describing customs declaration forms. One packet can consist of multiple goods, every one of each must have its own customs declaration form.

CustomsDeclarationItem

Type Field name Required Description
string customsCode yes Harmonized System code (see http://www.tariffnumber.com/).
decimal valueEur yes Value of the product in EUR.
decimal value yes Value of the product in the currency of the destination country.
string productEan yes Product EAN code.
string productNameEn yes Product name in English.
string productName yes Product name in the language of the destination country.
unsignedInt unitsCount yes Count of units. If you have multiple units of the same product, specify just one CustomsDeclarationItem for the product and set this value to count of units e.g. if you want to send 1000 screws then your product is a screw and the units count is 1000.
decimal countryOfOrigin yes Country of origin (COO) - country where the product was made.
string currency no Currency of product value. Required by the Swiss Post.
string invoiceNumber no Current product's invoice number. Required by the Swiss Post.
date invoiceIssueDate no Current product's invoice issue date in format Y-m-d, example: 2018-09-25. Required by the Swiss Post.
unsignedInt weight no Weight of the product(s) in grams. Required by the Swiss Post.
boolean isFoodBook no Does the current product classify as food or book? Required by the Swiss Post.
boolean isVoc no Does the current product classify as Volatile Organic Compound? Required by the Swiss Post.

CustomsDeclarationItems

Is an array of type CustomsDeclarationItem.

DispatchOrder

Type Field name Constraints Required Description
string goods comma separated good's codes yes Comma separated goods' IDs. If you wish to ship one type of goods multiple times, just list it's ID multiple times like this: product1xxx,product1xxx,product2xxx. Whitespaces are ignored.
binary pdf valid PDF file no Document to be printed out and shipped with the order, i.e. invoice.

PacketAttributes

Type Field name Constraints Required Description
unsignedLong id 10 digits no A unique packet ID from your assigned range. NOTE: make sure to use 64-bit type.
string number 1-24 alphanumeric yes A unique ID of the order (from your e-shop).
string name 1-32 alphanumeric yes Recipient's name.
string surname 1-32 alphanumeric yes Recipient's surname.
string company 1-32 alphanumeric no Recipient's company.
string email valid e-mail if no phone Recipient's e-mail.
string phone valid phone number if no e-mail Recipient's phone.
unsignedInt addressId valid active branch ID yes Branch ID or an ID of the external carrier.
string currency CZK, EUR, HUF, PLN, RON no Currency of COD and packet value.
decimal cod integer for CZK, a multiple of 5 for HUF no COD ammount.
decimal value see max. values in TOS yes Packet's value (for insurance purposes).
decimal weight no Weight in kg
date deliverOn date within next 14 days no Date for scheduled delivery in future. Package can be delivered on this date or later.
string eshop when using more senders Sender label. If the entered sender does not exist yet, a new one is created.
boolean adultContent 0-1 no If set to 1, the packet will be handed over only to person older than 18 years. An identfication will be requried.
string note no Sender's note. Currently used only by the carrier It GLS. It will be displayed on the label.
string street 1-32 alphanumeric on address delivery Street.
string houseNumber 1-16 alphanumeric on address delivery House number.
string city 1-32 alphanumeric on address delivery City.
string province 1-32 alphanumeric no Province. Required for address completeness in Italy ("provincia") and Romania ("judet").
string zip valid ZIP on address delivery ZIP code.
string carrierService no A valid delivery service of an external carrier (24h delivery etc.).
DispatchOrder dispatchOrder type DispatchOrder no If you have a fulfillment agreement, you can issue a dispatch order.
string customerBarcode 1-32 alphanumeric no A custom barcode. Only applicable if you have an agreement about using custom barcodes.
string carrierPickupPoint 1-32 alphanumeric yes for some carriers Code of a carrier's pick up point. Required only if the chosen carrier offers them.
CustomsDeclaration customsDeclaration type CustomsDeclaration on address delivery outside EU A collection of forms required for goods shipped outside of the European Union.
Size size type Size yes for some carriers Some carriers require the dimensions of the packet.

You can find more information about PacketAttributes associated with Direct label printing for carriers in it's own chapter.

PacketIdDetail

Type Field name Constraints Required Description
unsignedLong id 10 digits yes A unique packet ID from your assigned range.
string barcode yes The id prefixed by letter 'Z'. This format is used for generating a readable barcode.
string barcodeText yes The barcode in following format Z 123 4567 890. Used for printing, for better readability.

PacketIds

An array of packet IDs, a packet ID is 64-bit unsignedLong.

PacketIdWithCourierNumber

Type Field name Constraints Required Description
unsignedLong packetId 10 digits yes A packet ID, e.g. an id returned by createPacket().
string courierNumber yes A courier number returned by packetCourierNumber().

PacketIdsWithCourierNumbers

An array of PacketIdWithCourierNumber structures, which contain packet IDs together with courier numbers.

Size

Dimensions of the packet in millimetres (mm). Is not required, except for certain carriers.

Type Field name Required Description
unsignedInt length yes Length of the packet.
unsignedInt width yes Width of the packet.
unsignedInt height yes Height of the packet.

Packet status codes

statusCode codeText Extra valid fields Description
1 received data We have received the packet data. Freshly created packet.
2 arrived branchId Packet has been accepted at our branch.
3 prepared for departure branchId, destinationBranchId Packet is waiting to be dispatched from branch branchId to branch destinationBranchId.
4 departed branchId, destinationBranchId Packet is on the way from branch branchId to branch destinationBranchId.
5 ready for pickup branchId Packet has been delivered to its destination (branchId), the customer has been informed via SMS.
6 handed to carrier externalTrackingCode Packet has been handed over to an external carrier for delivery. It can be traced via carrier's tracking application under externalTrackingCode.
7 delivered branchId Packet was picked up by the customer at the branch branchId.
8 ready to return branchId Packet has been delivered to the branch branchId (returned to the sender) and is ready for pickup.
9 posted back Packet is on the way back to the sender.
10 returned Packet has been returned to the sender.
11 cancelled Packet has been cancelled.

ShipmentIdDetail

Type Field name Constraints Required Description
unsignedInt id yes A unique ID of the shipment.
string checksum 10 alphanumeric yes A hashed checksum of the shipment. NOTE: Can start with '0' character.
string barcode yes A shipment barcode in format: D<id>:<checksum>, i.e. D12345678:0123456789.
string barcodeText yes A readable barcode in following format: D 1234 5678 : 01234 56789.

StatusRecord

Type Field name Required Description
dateTime dateTime yes Date and time of the status change. The format is Y-m-d\TH:i:s, example: 2016-07-25T12:00:00.
unsignedInt statusCode yes Integer status code, see the status code table for more info.
string codeText yes Text representation of the code, see the status code table for more info.
string statusText yes Text description of the status.
unsignedInt branchId yes ID of the position of the packet in the moment of the last status change. Defaults to 0 if the branch data is not available.
unsignedInt destinationBranchId yes If status change regards moving to different branch, this field contains the ID of the destination branch. Defaults to 0 if the field is not relevant.
string externalTrackingCode ne If the packet is being delivered by an external carrier and this status change indicates handing over of the packet to the carrier, you can find the carrier's tracking code here.

StatusRecords

Is an array of type StatusRecord.

NullableDate

Is a date field with a possibility of null value.

Error messages

AttributeFault

Indicates an error that occured on a field specified by field's name and fault string.

Type Field name Required Description
string name yes Name of the invalid attribute (field).
string fault yes Description of the error.

CustomBarcodeNotAllowedFault

A custom barcode was used while its usage was not allowed.

Does not contain any additional information.

DateOutOfRangeFault

An entered date was out of supported range.

Does not contain any additional information.

DispatchOrderNotAllowedFault

An error has occured while validating packet attributes: trying to issue a DispatchOrder by setting PacketAttributes.dispatchOrder, while no fullfillment agreement is in place.

Does not contain any additional information.

DispatchOrderUnknownCodeFault

An error has occured while validating packet attributes: trying to issue a DispatchOrder for unknown goods.

Contains an array of invalid string codes.

DispatchOrderInvalidPdfFault

An error has occured while validating packet attributes: trying to issue a DispatchOrder with an invalid PDF file.

Does not contain any additional information.

IncorrectApiPasswordFault

An invalid API password was used.

Does not contain any additional information.

NoPacketIdsFault

An empty packetIds structure was passed to the method.

Does not contain any additional information.

NotSupportedFault

The action is not supported by the third party.

Does not contain any additional information.

PacketAttributesFault

An error has occured while validating packet attributes.

Contains an array of type AttributeFault.

PacketIdFault

An error has occured while validating packet attributes, an entered packetId is either not valid or does not belong inside your assigned packetId range.

Does not contain any additional information.

PacketIdsFault

Some of the packetIds passed to the method were not valid or were not from your assigned ID range.

Contains an array of invalid Ids.

SenderNotExists

A specified sender does not exist under your account.

Does not contain any additional information.

UnknownLabelFormatFault

An unknown label format was requested.

Does not contain any additional information.

ExternalGatewayFault

An error occured while communicating with third party service.

Does not contain any additional information.

InvalidCourierNumber

Supplied courier number was either not valid or couldn't be verified.

Does not contain any additional information.

Function reference

NOTE: All functions take API password as their first parameter. Due to its repetitiveness, it will be omitted from the function reference.

NOTE: The above also applies for an error message IncorrectApiPasswordFault.

For usage examples we will assume following prerequisities:

Usage:

<?php

$client = new SoapClient("http://www.zasilkovna.cz/api/soap-php-bugfix.wsdl"); // initialize the client
$pw = "1234567890abcdef1234567890abcdef"; // API password

packetAttributesValid()

Function prototype: void packetAttributesValid(PacketAttributes attributes)

Validates PacketAttributes.

On success (the attributes are valid) does not return anything.

Possible errors:

Usage:

<?php

$attributes = [
    "number" => "123abc",
    "name" => "John",
    "surname" => "Doe",
    "email" => "[email protected]",
    "addressId" => 95,
    "value" => 100.00,
    "eshop" => "my-eshop",
];
try {
    $client->packetAttributesValid($pw, $attributes);
}
catch (SoapFault $e){
    ...
}
<packetAttributesValid>
    <apiPassword>...</apiPassword>
    <packetAttributes>
        <number>123abc</number>
        <name>John</name>
        <surname>Doe</surname>
        <email>[email protected]</email>
        <addressId>95</addressId>
        <value>100.00</value>
        <eshop>my-eshop</eshop>
    </packetAttributes>
</packetAttributesValid>

packetClaimAttributesValid()

Function prototype: void packetClaimAttributesValid(ClaimAttributes attributes)

Validates ClaimAttributes.

On success (the attributes are valid) does not return anything.

Possible errors:

Usage:

<?php

$claimAttributes = [
    "number" => "RET123abc",
    "email" => "[email protected]",
    "value" => 100.00,
    "eshop" => "my-eshop",
];
try {
    $client->packetClaimAttributesValid($pw, $claimAttributes);
}
catch (SoapFault $e){
    ...
}
<packetClaimAttributesValid>
    <apiPassword>...</apiPassword>
    <claimAttributes>
        <number>RET123abc</number>
        <email>[email protected]</email>
        <value>100.00</value>
        <eshop>my-eshop</eshop>
    </claimAttributes>
</packetClaimAttributesValid>

createPacket()

Function prototype: PacketIdDetail createPacket(PacketAttributes attributes)

Creates packet from PacketAttributes.

On success returns PacketIdDetail with information about the newly created packet.

Possible errors:

Usage:

<?php

$attributes = [
    "number" => "123abc",
    "name" => "John",
    "surname" => "Doe",
    "email" => "[email protected]",
    "addressId" => 95,
    "value" => 100.00,
    "eshop" => "my-eshop",
];
try {
    $client->createPacket($pw, $attributes);
}
catch (SoapFault $e){
    ...
}
<createPacket>
    <apiPassword>...</apiPassword>
    <packetAttributes>
        <number>123abc</number>
        <name>John</name>
        <surname>Doe</surname>
        <email>[email protected]</email>
        <addressId>95</addressId>
        <value>100.00</value>
        <eshop>my-eshop</eshop>
    </packetAttributes>
</createPacket>

createPacketClaim()

Function prototype: PacketIdDetail createPacketClaim(ClaimAttributes attributes)

Creates a claim assistant packet from ClaimAttributes.

On success returns PacketIdDetail with information about the newly created packet.

Possible errors:

Usage:

<?php

$claimAttributes = [
    "number" => "RET123abc",
    "email" => "[email protected]",
    "value" => 100.00,
    "eshop" => "my-eshop",
];
try {
    $client->createPacketClaim($pw, $claimAttributes);
}
catch (SoapFault $e){
    ...
}
<createPacketClaim>
    <apiPassword>...</apiPassword>
    <claimAttributes>
        <number>RET123abc</number>
        <email>[email protected]</email>
        <value>100.00</value>
        <eshop>my-eshop</eshop>
    </claimAttributes>
</createPacketClaim>

createShipment()

Function prototype: ShipmentIdDetail createShipment(PacketIds packetIds, string customBarcode)

Creates a shipment from PacketIds. If customBarcode is specified and available for your account, the shipment will be created with the entered customBarcode.

On success returns ShipmentIdDetail with information about the newly created shipment.

Possible errors:

NOTE: The method does not accept IDs of claim assistant packets in PacketIds. If claim assistant packet ID is entered, function will return PacketIdsFault.

Usage:

<?php

$packetIds = [
    "1234567890",
    "1234567891",
    "1234567892",
    "1234567893",
];
try {
    $client->createShipment($pw, $packetIds);
}
catch (SoapFault $e){
    ...
}
<createShipment>
    <apiPassword>...</apiPassword>
    <packetIds>
        <id>1234567890</id>
        <id>1234567891</id>
        <id>1234567892</id>
        <id>1234567893</id>
    </packetIds>
</createShipment>

packetStatus()

Function prototype: CurrentStatusRecord packetStatus(unsignedLong packetId)

Fetches information about the current status of the packet specified by packetId.

On success returns CurrentStatusRecord.

Possible errors:

Usage:

<?php

$packetId = "1234567890";
try {
    $client->packetStatus($pw, $packetId);
}
catch (SoapFault $e){
    ...
}
<packetStatus>
    <apiPassword>...</apiPassword>
    <packetId>1234567890</packetId>
</packetStatus>

packetTracking()

Function prototype: StatusRecords packetTracking(unsignedLong packetId)

Fetches the whole tracking history of the packet specified by packetId.

On success returns StatusRecords.

Possible errors:

Usage:

<?php

$packetId = "1234567890";
try {
    $client->packetTracking($pw, $packetId);
}
catch (SoapFault $e){
    ...
}
<packetTracking>
    <apiPassword>...</apiPassword>
    <packetId>1234567890</packetId>
</packetTracking>

packetGetStoredUntil()

Function prototype: NullableDate packetGetStoredUntil(unsignedLong packetId)

Fetches the date until which the packet specified by packetId is stored and waiting for pickup. If the packet is not yet ready for pickup or is already returning to sender null is returned.

Possible errors:

Usage:

<?php

$packetId = "1234567890";
try {
    $client->packetGetStoredUntil($pw, $packetId);
}
catch (SoapFault $e){
    ...
}
<packetGetStoredUntil>
    <apiPassword>...</apiPassword>
    <packetId>1234567890</packetId>
</packetGetStoredUntil>

packetSetStoredUntil()

Function prototype: void packetSetStoredUntil(unsignedLong packetId, date date)

Sets the date until which the packet specified by packetId is stored and waiting for pickup.

On success (the date has been changed) does not return anything.

Possible errors:

Usage:

<?php

$packetId = "1234567890";
$extendTo = "2016-08-30";
try {
    $client->packetGetStoredUntil($pw, $packetId, $extendTo);
}
catch (SoapFault $e){
    ...
}
<packetGetStoredUntil>
    <apiPassword>...</apiPassword>
    <packetId>1234567890</packetId>
    <date>2016-08-30</date>
</packetGetStoredUntil>

barcodePng()

Function prototype: binary barcodePng(string barcode)

Returns a PNG image of the specified barcode. The barcode is created with Code 128 symbology.

NOTE: The method does not validate the barcode in any way. If you wish to create a barcode to use it on your labels, it is important that you use packetId prefixed by the letter Z e.g. Z1234567890.

Usage:

<?php

$packetId = "Z1234567890";
try {
    $client->barcodePng($pw, $barcode);
}
catch (SoapFault $e){
    ...
}
<barcodePng>
    <apiPassword>...</apiPassword>
    <barcode>Z1234567890</barcode>
</barcodePng>

packetLabelPdf()

Function prototype: binary packetLabelPdf(unsignedLong packetId, string format, unsignedInt offset)

Fetches a label for packet specified by packetId in format specified by format on a position specified by offset. The position is calculated left to right starting at top left corner of the document.

On success returns a PDF file with the label.

The format parameter accepts following values:

  • A6 on A6 - 105x148 mm (A6) label on a page of the same size
  • A7 on A7 - 105x74 mm (A7) label on a page of the same size
  • A6 on A4 - 105x148 mm (A6) label on a page of size 210x297 mm (A4)
  • A7 on A4 - 105x74 mm (A7) label on a page of size 210x297 mm (A4)
  • 105x35mm on A4 - 105x35 mm label on a page of size 210x297 mm (A4)
  • A8 on A8 - 50x74 mm (A8) label on a page of the same size

Possible errors:

Usage:

<?php

$packetId = "1234567890";
$format = "A7 on A4";
$offset = 0;
try {
    $client->packetLabelPdf($pw, $packetId, $format, $offset);
}
catch (SoapFault $e){
    ...
}
<packetLabelPdf>
    <apiPassword>...</apiPassword>
    <packetId>1234567890</packetId>
    <format>A7 on A4</format>
    <offset>0</offset>
</packetLabelPdf>

packetsLabelsPdf()

Function prototype: binary packetsLabelsPdf(PacketIds packetIds, string format, unsignedInt offset)

Fetches labels for packets specified by packetIds in format specified by format starting on a position specified by offset. The position is calculated left to right starting at top left corner of the document.

On success returns a PDF file with the labels.

The format parameter accepts the same values as in the packetLabelPdf() method.

Possible errors:

Usage:

<?php

$packetIds = [
    "1234567890",
    "1234567891",
    "1234567892",
];
$format = "A7 on A4";
$offset = 0;
try {
    $client->packetsLabelsPdf($pw, $packetIds, $format, $offset);
}
catch (SoapFault $e){
    ...
}
<packetsLabelsPdf>
    <apiPassword>...</apiPassword>
    <packetIds>
        <id>1234567890</id>
        <id>1234567891</id>
        <id>1234567892</id>
    </packetId>
    <format>A7 on A4</format>
    <offset>0</offset>
</packetsLabelsPdf>

packetCourierNumber()

Function prototype: string packetCourierNumber(unsignedLong packetId)

Returns a tracking code if the external carrier allows it, ie. its apiAllowed attribute is set to true.

Possible errors:

Usage:

<?php

$packetId = "1234567890";
try {
    $client->packetCourierNumber($pw, $packetId);
}
catch (SoapFault $e){
    ...
}
<packetCourierNumber>
    <apiPassword>...</apiPassword>
    <packetId>1234567890</packetId>
</packetCourierNumber>

packetCourierLabelPng()

Function prototype: base64binary packetCourierLabelPng(unsignedLong packetId, string courierNumber)

Returns label as string containing the PNG image (base64 encoded binary) if the external carrier allows it, ie. its apiAllowed attribute is set to true.

Possible errors:

Usage:

<?php

$packetId = "1234567890";
$courierNumber = "abcd1234567890";
try {
    $png = $client->packetCourierLabelPng($pw, $packetId, $courierNumber);
    header('Content-Type: image/png');
    echo $png;
}
catch (SoapFault $e){
    ...
}
<packetCourierLabelPng>
    <apiPassword>...</apiPassword>
    <packetId>1234567890</packetId>
    <courierNumber>abcd1234567890</courierNumber>
</packetCourierLabelPng>

packetCourierLabelPdf()

Function prototype: binary packetCourierLabelPdf(unsignedLong packetId, string courierNumber)

Returns label as string containing the PDF document (base64 encoded binary) if the external carrier allows it, ie. its apiAllowed attribute is set to true.

Possible errors:

Usage:

<?php

$packetId = "1234567890";
$courierNumber = "abcd1234567890";
try {
    $pdf = $client->packetCourierLabelPdf($pw, $packetId, $courierNumber);
    header('Content-Type: application/pdf');
    echo $pdf;
}
catch (SoapFault $e){
    ...
}
<packetCourierLabelPdf>
    <apiPassword>...</apiPassword>
    <packetId>1234567890</packetId>
    <courierNumber>abcd1234567890</courierNumber>
</packetCourierLabelPdf>

packetsCourierLabelsPdf()

Function prototype: binary packetCourierLabelPdf(PacketIdsWithCourierNumbers packetIdsWithCourierNumbers, unsignedInt offset)

Returns labels as string containing the PDF document (base64 encoded binary) if the external carrier allows it, ie. its apiAllowed attribute is set to true.

The returned PDF page format will be A4 with four 100x150 mm labels placed on each page. Second argument offset allows skipping some places on the first page. Allowed values 0–3.

NOTE: To avoid lost responses, set your request timeout to five seconds times the requested label count. E.g. 120 seconds for 24 labels. Typically, the labels will be generated much faster, but occasionally there may be delays.

Possible errors:

Usage:

<?php
$packetIdsWithCourierNumbers = [
    [
        'packetId' => "1234567890",
        'courierNumber' => "abcd1234567890",
    ],
    [
        'packetId' => "2345678901",
        'courierNumber' => "bcde2345678901",
    ],
];
try {
    $pdf = $client->packetsCourierLabelsPdf($pw, $packetIdsWithCourierNumbers, 0);
    header('Content-Type: application/pdf');
    echo $pdf;
}
catch (SoapFault $e){
    ...
}
<packetsCourierLabelsPdf>
    <apiPassword>...</apiPassword>
    <packetIdsWithCourierNumbers>
        <packetIdWithCourierNumber>
            <packetId>1234567890</packetId>
            <courierNumber>abcd1234567890</courierNumber>
        </packetIdWithCourierNumber>
        <packetIdWithCourierNumber>
            <packetId>2345678901</packetId>
            <courierNumber>bcde2345678901</courierNumber>
        </packetIdWithCourierNumber>
    </packetIdsWithCourierNumbers>
    <offset>0</offset>
</packetsCourierLabelsPdf>

packetCourierLabelZpl()

Function prototype: string packetCourierLabelZpl(unsignedLong packetId, string courierNumber, unsignedInt dpi = 300)

If the external carrier allows it, the method returns their label in ZPL format. Parameter dpi is not required, and defaults as 300 DPI.

This method is allowed for the following carriers:

  • CH Post

Allowed DPI values:

  • 203
  • 300

On success returns string containing the ZPL file.

Possible errors:

Usage:

<?php

$packetId = "1234567890";
$courierNumber = "abcd1234567890";
$dpi = 300;
try {
    $zpl = $client->packetCourierLabelZpl($pw, $packetId, $courierNumber, $dpi);
    echo $zpl;
}
catch (SoapFault $e){
    ...
}
<packetCourierLabelZpl>
    <apiPassword>...</apiPassword>
    <packetId>1234567890</packetId>
    <courierNumber>abcd1234567890</courierNumber>
    <dpi>300</dpi>
</packetCourierLabelZpl>

senderGetReturnRouting()

Function prototype: string[] senderGetReturnRouting(string senderLabel)

Returns an array of 2 return routing strings for a sender specified by senderLabel.

Possible errors:

NOTE: These strings are generated from your account settings and need to be downloaded each time you want to use them. If you were to download the strings just once and use the stored value, your return address might change and the strings would be deprecated.

NOTE: It is preferred that the return routing strings are printed each on separate line. See our label specifications.

Usage:

<?php

$senderLabel = "my-eshop";
try {
    $client->senderGetReturnRouting($pw, $senderLabel);
}
catch (SoapFault $e){
    ...
}
<senderGetReturnRouting>
    <apiPassword>...</apiPassword>
    <senderLabel>my-eshop</senderLabel>
</senderGetReturnRouting>