LabellingService

class Firstred\PostNL\Service\LabellingService
Class LabellingService.
Parent:

Firstred\PostNL\Service\AbstractService

Implements:

Firstred\PostNL\Service\LabellingServiceInterface

Summary

Methods

Constants

VERSION = \'2\.2\'
LIVE_ENDPOINT = \'https://api\.postnl\.nl/shipment/v2\_2/label\'
SANDBOX_ENDPOINT = \'https://api\-sandbox\.postnl\.nl/shipment/v2\_2/label\'
SOAP_ACTION = \'http://postnl\.nl/cif/services/LabellingWebService/ILabellingWebService/GenerateLabel\'
SOAP_ACTION_NO_CONFIRM = \'http://postnl\.nl/cif/services/LabellingWebService/ILabellingWebService/GenerateLabelWithoutConfirm\'
SERVICES_NAMESPACE = \'http://postnl\.nl/cif/services/LabellingWebService/\'
DOMAIN_NAMESPACE = \'http://postnl\.nl/cif/domain/LabellingWebService/\'

Properties

public property Firstred\PostNL\Service\LabellingService::$namespaces
Namespaces uses for the SOAP version of this service.
Type:

array

private property Firstred\PostNL\Service\LabellingService::$insuranceProductCodes

Methods

public Firstred\PostNL\Service\LabellingService::generateLabelREST($generateLabel, $confirm=true)
Generate a single barcode via REST.
Parameters:
Returns:

\Firstred\PostNL\Entity\Response\GenerateLabelResponse

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\NotSupportedException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\NotSupportedException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\NotSupportedException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\NotSupportedException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\NotSupportedException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\NotSupportedException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Since:

1.0.0

Deprecated:

1.4.0 Use `generateLabel` instead

public Firstred\PostNL\Service\LabellingService::generateLabelsREST($generateLabels)
Generate multiple labels at once.
Parameters:
  • $generateLabels (array) [‘uuid’ => [GenerateBarcode, confirm], …]

Returns:

array

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\NotSupportedException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\NotSupportedException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\NotSupportedException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\NotSupportedException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Throws:

\Firstred\PostNL\Exception\ResponseException

Since:

1.0.0

Deprecated:

1.4.0 Use `generateLabels` instead

public Firstred\PostNL\Service\LabellingService::generateLabelSOAP($generateLabel, $confirm=true)
Generate a single label via SOAP.
Parameters:
Returns:

\Firstred\PostNL\Entity\Response\GenerateLabelResponse

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Since:

1.0.0

Deprecated:

1.4.0 Use `generateLabels` instead

public Firstred\PostNL\Service\LabellingService::generateLabelsSOAP($generateLabels)
Generate multiple labels at once via SOAP.
Parameters:
  • $generateLabels (array) [‘uuid’ => [GenerateBarcode, confirm], …]

Returns:

array

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Since:

1.0.0

Deprecated:

1.4.0 Use `generateLabels` instead

public Firstred\PostNL\Service\LabellingService::buildGenerateLabelRequestREST($generateLabel, $confirm=true)
Build the GenerateLabel request for the REST API.
Parameters:
Returns:

\Psr\Http\Message\RequestInterface

Since:

1.0.0

Deprecated:

1.4.0

public Firstred\PostNL\Service\LabellingService::processGenerateLabelResponseREST($response)
Process the GenerateLabel REST Response.
Parameters:
  • $response (Psr\Http\Message\ResponseInterface)

Returns:

\Firstred\PostNL\Entity\Response\GenerateLabelResponse | null

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\NotSupportedException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\NotSupportedException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\NotSupportedException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\NotSupportedException

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

Since:

1.0.0

public Firstred\PostNL\Service\LabellingService::buildGenerateLabelRequestSOAP($generateLabel, $confirm=true)
Build the GenerateLabel request for the SOAP API.
Parameters:
Returns:

\Psr\Http\Message\RequestInterface

Since:

1.0.0

Deprecated:

1.4.0

public Firstred\PostNL\Service\LabellingService::processGenerateLabelResponseSOAP($response)
Parameters:
  • $response (Psr\Http\Message\ResponseInterface)

Returns:

\Firstred\PostNL\Entity\Response\GenerateLabelResponse

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Throws:

\Firstred\PostNL\Exception\CifDownException

Throws:

\Firstred\PostNL\Exception\CifException

Throws:

\Firstred\PostNL\Exception\ResponseException

Throws:

\Firstred\PostNL\Exception\HttpClientException

Since:

1.0.0

Deprecated:

1.4.0