GLS

Integration with GLS for shipment booking in Omnium.

Omnium integrates with GLS for shipment booking, return handling, and parcel shop services. The current implementation focuses on the Danish market.


Configuration Steps

  1. Navigate to: Configuration > Settings > Orders > Shipping Providers > Add New

Required Settings

FieldDescriptionExample
NameInternal provider nameGLS
Display NameName shown to usersGLS
Shipping ProviderSelect provider typeGls
Base URLGLS API endpointhttps://ws.gls.dk/
Tracking URLTracking URL basehttps://track.gls.dk/track?bid=

Store Configuration

GLS requires store-level authentication via External IDs:

Provider NameDescriptionRequired
GlsUsernameGLS API usernameYes
GlsCodeGLS API password/codeYes
GlsContactIdGLS contact IDYes

Important

All three External IDs must be configured on the store. Missing credentials will cause booking failures.

Shipment Options

Adding shipment options for each market

Configure shipping options under each market:

FieldDescription
Shipping ProviderSet to Gls
Delivery TypeDelivery (home delivery) or Pickup (parcel shop)
Display NameUser-friendly name
Shipping MethodInternal name for mapping
Shipment ProductGLS product code

Parcel Shops (Pickup Points)

Lookup

GLS uses a SOAP-based Shop Finder service for parcel shop lookup. The service accepts address, postal code, country code, and the number of results to return.

Response Data

Parcel shops include:

  • Shop number (ServicePointId)
  • Company name
  • Address details
  • Opening hours per weekday
  • Latitude/longitude
  • Distance from search location

Note

The current implementation is focused on Denmark (country code "DK").

Booking Process

API Endpoint

POST {BaseUrl}/ws/DK/V1/CreateShipment

Authentication

  • Basic authentication using GlsUsername and GlsCode from store External IDs
  • Customer ID from GlsContactId

Request Structure

{
  "UserName": "gls-username",
  "Password": "gls-code",
  "Customerid": "gls-contact-id",
  "Contactid": "gls-contact-id",
  "ShipmentDate": "20240115",
  "Reference": "order-id",
  "Addresses": {
    "Delivery": { ... },
    "Pickup": { ... }
  },
  "Parcels": [
    {
      "Weight": 1,
      "Reference": "order-id"
    }
  ],
  "Services": {
    "ShopDelivery": "service-point-id",
    "NotificationEmail": "customer@email.com"
  }
}

Booking Response

Successful bookings return:

  • ConsignmentId (tracking number)
  • PDF label (base64 encoded)
  • Parcel numbers for each package

Return Shipments

Configuration

Return shipments reverse the addresses:

  • Customer location becomes Pickup address
  • Store location becomes Delivery address
  • ShopReturn service flag is set to "Y"

Booking

Return bookings use the same API endpoint with modified address mapping.


Label Management

Label Generation

Labels are returned as base64-encoded PDF in the booking response.

Label Storage

Labels are uploaded to Azure Blob Storage:

  • Container: shippinglabels
  • Filename: {ConsignmentId}.pdf

Tracking

Tracking URL Format

{TrackingUrl}{ConsignmentNumber}

Example:

https://track.gls.dk/track?bid=123456789

Services

Shop Delivery

For parcel shop deliveries, set the ShopDelivery service with the service point ID:

{
  "Services": {
    "ShopDelivery": "12345"
  }
}

Notification Email

Customer notification emails can be configured:

{
  "Services": {
    "NotificationEmail": "customer@email.com"
  }
}

Error Handling

Error Keys

Error KeyDescription
GlsBookingErrorStandard booking failure
GlsReturnBookingErrorReturn booking failure

Error Response

Failed bookings return error messages in the response body, which are stored on the Order entity.


Supported Features

FeatureSupported
Outbound shipment bookingYes
Return shipment bookingYes
Label generation (PDF)Yes
Parcel shop lookupYes
Tracking URLYes
Shop deliveryYes
Direct printingNo
Label downloadNo
Shipment statusNo
Multi-parcelPartial (weight hardcoded)

Limitations

  1. Country Support: Currently optimized for Denmark (DK)
  2. Weight: Package weight is currently hardcoded to 1 kg
  3. Country Code: ISO numeric code is hardcoded to "208" (Denmark)
  4. Single Pickup Point Lookup: Individual pickup point lookup is not implemented

Troubleshooting

Common Issues

  1. Missing store credentials: Ensure all three External IDs (GlsUsername, GlsCode, GlsContactId) are configured on the store.

  2. Authentication failed: Verify the GLS credentials are correct and the account is active.

  3. No parcel shops found: The SOAP service may be limited to Danish addresses.

  4. Label not generated: Check the API response for error messages stored in the order errors.