Code0 LogoCodeZero
GLS Action

Functions

All functions available in the GLS Action with detailed descriptions, parameters, and data flow diagrams.

Functions

The GLS Action exposes 26 functions grouped into three categories:

  • Builder functions — Construct data objects (no API call)
  • Shipment functions — Create different types of GLS shipments (calls GLS API)
  • API functions — Query or modify shipments (calls GLS API)

Builder functions

createAddress

Creates a GLS address object (GLS_ADDRESS) for use in shipments as consignee, shipper, or return address.

Signature:

createAddress(
  Name1: string,
  CountryCode: string,
  City: string,
  Street: string,
  ZIPCode: string,
  Name2?: string,
  Name3?: string,
  Province?: string,
  StreetNumber?: string,
  ContactPerson?: string,
  FixedLinePhonenumber?: string,
  MobilePhonenumber?: string,
  Email?: string
): GLS_ADDRESS

Parameters:

ParameterTypeRequiredDescription
Name1string (max 40)YesPrimary name (recipient or company name)
CountryCodestring (max 2)YesISO alpha-2 country code (e.g. DE, FR, GB)
Citystring (max 40)YesCity name
Streetstring (min 4)YesStreet name
ZIPCodestring (max 10)YesPostal/ZIP code
Name2string (max 40)NoAdditional name line (e.g. department)
Name3string (max 40)NoAdditional name line (e.g. c/o)
Provincestring (max 40)NoState or province
StreetNumberstring (max 40)NoHouse/building number
ContactPersonstring (min 6, max 40)NoContact person at this address
FixedLinePhonenumberstring (min 4, max 35)NoLandline phone number
MobilePhonenumberstring (min 4, max 35)NoMobile phone number
eMailstring (max 80)NoEmail address

Returns: GLS_ADDRESS


createConsignee

Creates a GLS consignee (recipient) object for use in shipments.

Signature:

createConsignee(
  consigneeId: string,
  costCenter: string,
  AddressSchema: GLS_ADDRESS,
  Category: "BUSINESS" | "PRIVATE"
): GLS_CONSIGNEE

Parameters:

ParameterTypeRequiredDescription
consigneeIdstring (max 40)YesUnique ID for the consignee (your internal customer ID)
costCenterstring (max 80)YesCost center for billing purposes
AddressSchemaGLS_ADDRESSYesThe delivery address for this consignee
Category"BUSINESS" | "PRIVATE"YesWhether the consignee is a business or private recipient

Returns: GLS_CONSIGNEE


createShipmentUnit

Creates a GLS shipment unit (an individual parcel within a shipment).

Signature:

createShipmentUnit(
  weight: number,
  shipmentUnitReference?: string,
  partnerParcelNumber?: string,
  note1?: string,
  note2?: string,
  shipmentUnitService: GLS_UNIT_SERVICE
): GLS_SHIPMENT_UNIT

Parameters:

ParameterTypeRequiredDescription
weightnumber (0.10–99)YesWeight of the parcel in kilograms
shipmentUnitReferencestring (max 40)NoYour internal reference for this parcel
partnerParcelNumberstring (max 50)NoPartner-assigned parcel number
note1string (max 50)NoAdditional note printed on the label (line 1)
note2string (max 50)NoAdditional note printed on the label (line 2)
shipmentUnitServiceGLS_UNIT_SERVICENoUnit-level services (Cash, AddonLiability, HazardousGoods, etc.)

Returns: GLS_SHIPMENT_UNIT


createPrintingOptions

Creates GLS printing options that control how labels are generated.

Signature:

createPrintingOptions(returnLabels: RETURN_LABELS): GLS_PRINTING_OPTIONS

Parameters:

ParameterTypeRequiredDescription
returnLabelsRETURN_LABELSYesLabel format configuration

RETURN_LABELS fields:

FieldValuesDescription
TemplateSetNONE, D_200, PF_4_I, ZPL_200, ZPL_300, ...Label template set
LabelFormatPDF, ZEBRA, INTERMEC, DATAMAX, TOSHIBA, PNGOutput format

Returns: GLS_PRINTING_OPTIONS


createCustomContent

Creates custom content settings for GLS labels, including logos and barcodes.

Signature:

createCustomContent(
  barcodeContentType: "TRACK_ID" | "GLS_SHIPMENT_REFERENCE",
  customerLogo: string,
  hideShipperAddress?: boolean,
  barcodeType?: "EAN_128" | "CODE_39",
  barcode?: string
): GLS_CUSTOM_CONTENT

Parameters:

ParameterTypeRequiredDescription
barcodeContentType"TRACK_ID" | "GLS_SHIPMENT_REFERENCE"YesWhat the barcode encodes
customerLogostringYesBase64-encoded customer logo image
hideShipperAddressbooleanNoHide the shipper address on the label
barcodeType"EAN_128" | "CODE_39"NoBarcode symbology
barcodestringNoCustom barcode value

Returns: GLS_CUSTOM_CONTENT


Shipment functions

All shipment functions accept a common set of parameters in addition to their type-specific parameters. They call the GLS ShipIT API (POST /rs/shipments) and return a GLS_CREATE_PARCELS_RESPONSE.

Common parameters for all shipment functions:

ParameterTypeRequiredDescription
shipmentGLS_SHIPMENT_WITHOUT_SERVICESYesShipment data (consignee, shipper, units, product)
printingOptionsGLS_PRINTING_OPTIONSYesLabel format settings
returnOptionsGLS_RETURN_OPTIONSNoWhether to return print data and routing info
customContentGLS_CUSTOM_CONTENTNoCustom logo and barcode settings

createShopDeliveryShipment

Delivers a parcel to a GLS Parcel Shop where the recipient can collect it.

Signature:

createShopDeliveryShipment(
  parcelShopId: string,
  shipment: GLS_SHIPMENT_WITHOUT_SERVICES,
  printingOptions: GLS_PRINTING_OPTIONS,
  returnOptions?: GLS_RETURN_OPTIONS,
  customContent?: GLS_CUSTOM_CONTENT
): GLS_CREATE_PARCELS_RESPONSE
ParameterTypeRequiredDescription
parcelShopIdstringYesID of the target GLS Parcel Shop

Data flow:

createShopDeliveryShipment

    ├── Service: [{ ShopDelivery: { ParcelShopID } }]

    └── POST /rs/shipments → GLS_CREATE_PARCELS_RESPONSE

createShopReturnShipment

Creates a return shipment from a GLS Parcel Shop (customer drops off parcel at a shop).

Signature:

createShopReturnShipment(
  numberOfLabels: number,
  shipment: GLS_SHIPMENT_WITHOUT_SERVICES,
  printingOptions: GLS_PRINTING_OPTIONS,
  returnOptions?: GLS_RETURN_OPTIONS,
  customContent?: GLS_CUSTOM_CONTENT,
  returnQR?: "PDF" | "PNG" | "ZPL"
): GLS_CREATE_PARCELS_RESPONSE
ParameterTypeRequiredDescription
numberOfLabelsnumberYesNumber of return labels to generate
returnQR"PDF" | "PNG" | "ZPL"NoFormat of the QR code for the return

createExchangeShipment

Delivers a new parcel while simultaneously picking up an existing one (exchange).

Signature:

createExchangeShipment(
  address: GLS_ADDRESS,
  shipment: GLS_SHIPMENT_WITHOUT_SERVICES,
  printingOptions: GLS_PRINTING_OPTIONS,
  returnOptions?: GLS_RETURN_OPTIONS,
  customContent?: GLS_CUSTOM_CONTENT,
  expectedWeight?: number
): GLS_CREATE_PARCELS_RESPONSE
ParameterTypeRequiredDescription
addressGLS_ADDRESSYesAddressSchema for the exchange pickup
expectedWeightnumber (min 1)NoExpected weight of the parcel being returned

createDeliveryAtWorkShipment

Delivers a parcel to a specific location within a workplace (building, floor, room).

Signature:

createDeliveryAtWorkShipment(
  recipientName: string,
  building: string,
  floor: number,
  shipment: GLS_SHIPMENT_WITHOUT_SERVICES,
  printingOptions: GLS_PRINTING_OPTIONS,
  returnOptions?: GLS_RETURN_OPTIONS,
  customContent?: GLS_CUSTOM_CONTENT,
  alternateRecipientName?: string,
  room?: number,
  phonenumber?: string
): GLS_CREATE_PARCELS_RESPONSE
ParameterTypeRequiredDescription
recipientNamestring (max 40)YesName of the recipient at work
buildingstring (max 40)YesBuilding name or number
floornumberYesFloor number
alternateRecipientNamestring (max 40)NoAlternate recipient if primary is unavailable
roomnumberNoRoom number
phonenumberstring (max 35)NoContact phone number

createDepositShipment

Delivers a parcel to a designated deposit location (e.g. a garage or shed) without requiring a signature.

Signature:

createDepositShipment(
  placeOfDeposit: string,
  shipment: GLS_SHIPMENT_WITHOUT_SERVICES,
  printingOptions: GLS_PRINTING_OPTIONS,
  returnOptions?: GLS_RETURN_OPTIONS,
  customContent?: GLS_CUSTOM_CONTENT
): GLS_CREATE_PARCELS_RESPONSE
ParameterTypeRequiredDescription
placeOfDepositstring (max 121)YesDescription of where to deposit the parcel

createIdentShipment

Delivers a parcel with identity verification — the driver checks the recipient's ID document.

Signature:

createIdentShipment(
  birthDate: string,
  firstName: string,
  lastName: string,
  nationality: string,
  shipment: GLS_SHIPMENT_WITHOUT_SERVICES,
  printingOptions: GLS_PRINTING_OPTIONS,
  returnOptions?: GLS_RETURN_OPTIONS,
  customContent?: GLS_CUSTOM_CONTENT
): GLS_CREATE_PARCELS_RESPONSE
ParameterTypeRequiredDescription
birthDateISO date stringYesRecipient's date of birth
firstNamestring (max 40)YesRecipient's first name
lastNamestring (max 40)YesRecipient's last name
nationalitystring (max 2)YesISO alpha-2 nationality code

createIdentPinShipment

Delivers a parcel with PIN and optional birthdate verification.

Signature:

createIdentPinShipment(
  pin: string,
  shipment: GLS_SHIPMENT_WITHOUT_SERVICES,
  printingOptions: GLS_PRINTING_OPTIONS,
  returnOptions?: GLS_RETURN_OPTIONS,
  customContent?: GLS_CUSTOM_CONTENT,
  birthDate?: string
): GLS_CREATE_PARCELS_RESPONSE
ParameterTypeRequiredDescription
pinstring (max 4)Yes4-digit PIN to verify with recipient
birthDateISO date stringNoRecipient's date of birth (additional check)

createPickAndShipShipment

Schedules a pickup from the consignee's address on a given date.

Signature:

createPickAndShipShipment(
  pickupDate: string,
  shipment: GLS_SHIPMENT_WITHOUT_SERVICES,
  printingOptions: GLS_PRINTING_OPTIONS,
  returnOptions?: GLS_RETURN_OPTIONS,
  customContent?: GLS_CUSTOM_CONTENT
): GLS_CREATE_PARCELS_RESPONSE
ParameterTypeRequiredDescription
pickupDateISO date stringYesDate when GLS will pick up the parcel

createFlexDeliveryShipment

Creates a shipment with flexible delivery — the recipient can redirect or reschedule delivery.

Signature:

createFlexDeliveryShipment(
  shipment: GLS_SHIPMENT_WITHOUT_SERVICES,
  printingOptions: GLS_PRINTING_OPTIONS,
  returnOptions?: GLS_RETURN_OPTIONS,
  customContent?: GLS_CUSTOM_CONTENT
): GLS_CREATE_PARCELS_RESPONSE

No additional parameters beyond the common ones.


createSignatureShipment

Creates a shipment that requires a recipient signature upon delivery.

Signature:

createSignatureShipment(
  shipment: GLS_SHIPMENT_WITHOUT_SERVICES,
  printingOptions: GLS_PRINTING_OPTIONS,
  returnOptions?: GLS_RETURN_OPTIONS,
  customContent?: GLS_CUSTOM_CONTENT
): GLS_CREATE_PARCELS_RESPONSE

No additional parameters beyond the common ones.


createGuaranteed24Shipment

Creates a shipment with guaranteed delivery within 24 hours.

Signature:

createGuaranteed24Shipment(
  shipment: GLS_SHIPMENT_WITHOUT_SERVICES,
  printingOptions: GLS_PRINTING_OPTIONS,
  returnOptions?: GLS_RETURN_OPTIONS,
  customContent?: GLS_CUSTOM_CONTENT
): GLS_CREATE_PARCELS_RESPONSE

No additional parameters beyond the common ones.


createAddresseeOnlyShipment

Creates a shipment that can only be delivered to the named addressee (no neighbor delivery).

Signature:

createAddresseeOnlyShipment(
  shipment: GLS_SHIPMENT_WITHOUT_SERVICES,
  printingOptions: GLS_PRINTING_OPTIONS,
  returnOptions?: GLS_RETURN_OPTIONS,
  customContent?: GLS_CUSTOM_CONTENT
): GLS_CREATE_PARCELS_RESPONSE

No additional parameters beyond the common ones.


createTyreShipment

Creates a shipment specifically for tyre/wheel delivery (uses the GLS TyreService).

Signature:

createTyreShipment(
  shipment: GLS_SHIPMENT_WITHOUT_SERVICES,
  printingOptions: GLS_PRINTING_OPTIONS,
  returnOptions?: GLS_RETURN_OPTIONS,
  customContent?: GLS_CUSTOM_CONTENT
): GLS_CREATE_PARCELS_RESPONSE

No additional parameters beyond the common ones.


createDeliveryNextWorkingDayShipment

Creates an EXPRESS shipment for delivery on the next working day (EOB service).

Requirement: The shipment's Product field must be set to "EXPRESS". Setting it to "PARCEL" will throw an INVALID_PRODUCT error.

Signature:

createDeliveryNextWorkingDayShipment(
  shipment: GLS_SHIPMENT_WITHOUT_SERVICES,
  printingOptions: GLS_PRINTING_OPTIONS,
  returnOptions?: GLS_RETURN_OPTIONS,
  customContent?: GLS_CUSTOM_CONTENT
): GLS_CREATE_PARCELS_RESPONSE

createDeliverySaturdayShipment

Creates an EXPRESS shipment for Saturday delivery.

Requirement: The shipment's Product field must be set to "EXPRESS". Setting it to "PARCEL" will throw an INVALID_PRODUCT error.

Signature:

createDeliverySaturdayShipment(
  shipment: GLS_SHIPMENT_WITHOUT_SERVICES,
  printingOptions: GLS_PRINTING_OPTIONS,
  returnOptions?: GLS_RETURN_OPTIONS,
  customContent?: GLS_CUSTOM_CONTENT
): GLS_CREATE_PARCELS_RESPONSE

API functions

validateShipment

Validates a shipment against the GLS API without creating it. Use this before createShipment* functions to catch errors early.

Signature:

validateShipment(data: GLS_VALIDATE_SHIPMENT_REQUEST_DATA): GLS_VALIDATE_SHIPMENT_RESPONSE_DATA

Data flow:

validateShipment

    └── POST /rs/shipments/validate


    GLS_VALIDATE_SHIPMENT_RESPONSE_DATA
      ├── success: boolean
      └── validationResult.Issues[]

See Types — GLS_VALIDATE_SHIPMENT_REQUEST_DATA for the input format.


cancelShipment

Cancels an existing shipment by its Track ID. Only possible if the parcel has not yet been scanned.

Signature:

cancelShipment(data: GLS_CANCEL_SHIPMENT_REQUEST_DATA): GLS_CANCEL_SHIPMENT_RESPONSE_DATA

Data flow:

cancelShipment({ TrackID })

    └── POST /rs/shipments/cancel/{TrackID}


    GLS_CANCEL_SHIPMENT_RESPONSE_DATA
      ├── TrackID
      └── result: "CANCELLED" | "CANCELLATION_PENDING" | "SCANNED" | "ERROR"

getAllowedServices

Returns the GLS services available for a given origin/destination country and ZIP code combination.

Signature:

getAllowedServices(data: GLS_ALLOWED_SERVICES_REQUEST_DATA): GLS_ALLOWED_SERVICES_RESPONSE_DATA

Data flow:

getAllowedServices({ Source, Destination, ContactID? })

    └── GET /rs/shipments/allowedservices


    GLS_ALLOWED_SERVICES_RESPONSE_DATA
      └── AllowedServices[]: { ServiceName } | { ProductName }

getEndOfDayReport

Retrieves all shipments dispatched on a given date. Useful for reconciliation and end-of-day processing.

Signature:

getEndOfDayReport(data: GLS_END_OF_DAY_REQUEST_DATA): GLS_END_OF_DAY_RESPONSE_DATA

Data flow:

getEndOfDayReport({ date })

    └── GET /rs/shipments/endofday?date={date}


    GLS_END_OF_DAY_RESPONSE_DATA
      └── Shipments[]: { ShippingDate, Product, ConsigneeSchema, ShipperSchema, ShipmentUnit[] }

updateParcelWeight

Updates the weight of an already-created parcel. Useful when the final weight is only known after packaging.

Signature:

updateParcelWeight(data: GLS_UPDATE_PARCEL_WEIGHT_REQUEST_DATA): GLS_UPDATE_PARCEL_WEIGHT_RESPONSE_DATA

Data flow:

updateParcelWeight({ TrackID, Weight })

    └── POST /rs/shipments/updateparcelweight


    GLS_UPDATE_PARCEL_WEIGHT_RESPONSE_DATA
      └── UpdatedWeight: string

reprintParcel

Reprints the label for an existing parcel. Use this if the original label is damaged, lost, or needs to be printed in a different format.

Signature:

reprintParcel(data: GLS_REPRINT_PARCEL_REQUEST_DATA): GLS_REPRINT_PARCEL_RESPONSE_DATA

Data flow:

reprintParcel({ TrackID, CreationDate, PrintingOptions })

    └── POST /rs/shipments/reprintparcel


    GLS_REPRINT_PARCEL_RESPONSE_DATA
      └── CreatedShipment
            ├── ParcelData[].TrackID
            ├── ParcelData[].Barcodes
            └── PrintData[].Data  ← new base64-encoded label

On this page