Skip to content

omnibus/gls API reference

Floor
Provider · Omnibus
Version
2.x
Conformance suite
runs, no CI read
Verified for real
Its README does not say
Licence
MIT
composer require omnibus/gls:2.x-dev

Read from the package's own PHP files at the commit 5ae261f55f6c: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.

Omnibus\Gls

  • Api class

    GLS's ShipIT web API (basic auth) for shipments and their labels, and GLS's public tracking (gls-group.eu, no credentials) for where a parcel is.

    3 methods · 2 properties · 3 constants

  • GlsGatewayFactory class

    options: username: '%env(GLS_USERNAME)%' # the ShipIT web API login password: '%env(GLS_PASSWORD)%' contact_id: '%env(GLS_CONTACT_ID)%' # the customer's contact id at GLS sandbox: true rates: [...] # prices from configuration: ShipIT quotes none

    8 options

Omnibus\Gls\Action

  • CancelAction class

    POST /shipments/cancel/{trackId}: a shipment not yet collected, cancelled.

    3 methods

  • ShippingAction class

    POST /shipments: the parcels under a product (service: PARCEL by default, EXPRESS...), a ShopDelivery service when the shipment goes to a ParcelShop (pickupPoint: the shop's id), its labels as PDF.

    3 methods

  • TrackingAction class

    GLS's public parcel tracking: the history, oldest first.

    3 methods

Omnibus\Gls

Api class

final class Api Api.php:15

GLS's ShipIT web API (basic auth) for shipments and their labels, and GLS's public tracking (gls-group.eu, no credentials) for where a parcel is.

Prices come from configuration: ShipIT quotes none.

const LIVE = 'https://shipit.gls-group.eu/backend/rs'
const TEST = 'https://shipit-wbm-test01.gls-group.eu:8443/backend/rs'
const TRACKING = 'https://gls-group.eu/app/service/open/rest/EU/en/rstt001'
public readonly string $contactId
public readonly bool $sandbox

Api::__construct()

public function __construct(readonly HttpClientInterface $http, readonly string $username, readonly string $password, public readonly string $contactId, public readonly bool $sandbox = false, readonly int $timeout = 20)

Api::call()

public function call(string $method, string $path, ?array $body = null, array $query = []): array

Api::track()

public function track(string $number, string $locale): array

GlsGatewayFactory class

final class GlsGatewayFactory extends GatewayFactory GlsGatewayFactory.php:22

options: username: '%env(GLS_USERNAME)%' # the ShipIT web API login password: '%env(GLS_PASSWORD)%' contact_id: '%env(GLS_CONTACT_ID)%' # the customer's contact id at GLS sandbox: true rates: [...] # prices from configuration: ShipIT quotes none

Pickup points (ParcelShops) are not offered by ShipIT: GLS's finder is a separate contract.

Options

OptionDefault
sandboxfalse
omnibus.apifunction (Config $c) { $http = $this->http ?? HttpClient::create(); return new Api($http, (string) $c['username'], (string) $c['password'], (string) …
omnibus.action.shippingnew ShippingAction()
omnibus.action.trackingnew TrackingAction()
omnibus.action.cancelnew CancelAction()
usernamerequired
passwordrequired
contact_idrequired

Omnibus\Gls\Action

CancelAction class

final class CancelAction implements ActionInterface, ApiAwareInterface CancelAction.php:13

POST /shipments/cancel/{trackId}: a shipment not yet collected, cancelled.

CancelAction::__construct()

public function __construct()

CancelAction::supports()

public function supports(Request $request): bool

CancelAction::execute()

public function execute(Request $request): void

ShippingAction class

final class ShippingAction implements ActionInterface, ApiAwareInterface ShippingAction.php:20

POST /shipments: the parcels under a product (service: PARCEL by default, EXPRESS...), a ShopDelivery service when the shipment goes to a ParcelShop (pickupPoint: the shop's id), its labels as PDF.

ShippingAction::__construct()

public function __construct()

ShippingAction::supports()

public function supports(Request $request): bool

ShippingAction::execute()

public function execute(Request $request): void

TrackingAction class

final class TrackingAction implements ActionInterface, ApiAwareInterface TrackingAction.php:16

GLS's public parcel tracking: the history, oldest first.

TrackingAction::__construct()

public function __construct()

TrackingAction::supports()

public function supports(Request $request): bool

TrackingAction::execute()

public function execute(Request $request): void