|
1 | 1 | --- |
2 | 2 | title: Action Configuration |
| 3 | +description: All configuration options for the GLS Action, including how to obtain credentials from the GLS Developer Portal. |
3 | 4 | --- |
4 | 5 |
|
5 | | -The GLS action provides following configurations: |
| 6 | +# GLS Action Configuration |
6 | 7 |
|
7 | | -| Config Name | Description | Type | Required | |
8 | | -|-----------------|------------------------------------------------------------------|-------------|----------| |
9 | | -| contact_id | The contact id used in some requests | string | No | |
10 | | -| client_id | The client id used for auth purposes | string | Yes | |
11 | | -| client_secret | The client secret used for auth purposes | string | Yes | |
12 | | -| ship_it_api_url | Gls provides multiple ship it urls, provide yours | string | No | |
13 | | -| auth_url | Gls provides multiple auth urls, provide yours ending in /token | string | No | |
14 | | -| shipper | And default shipper which is replaced in the request if provided | GLS_SHIPPER | No | |
| 8 | +The GLS action requires a few credentials to authenticate with the GLS ShipIT API. These are set as **configuration values** in the Hercules admin panel (not as environment variables). |
15 | 9 |
|
| 10 | +--- |
| 11 | + |
| 12 | +## Configuration reference |
| 13 | + |
| 14 | +| Config Name | Type | Required | Default | Description | |
| 15 | +|-----------------|-------------|----------|---------|-------------| |
| 16 | +| `client_id` | string | **Yes** | — | OAuth2 client ID for authenticating with the GLS API | |
| 17 | +| `client_secret` | string | **Yes** | — | OAuth2 client secret for authenticating with the GLS API | |
| 18 | +| `contact_id` | string | No | `""` | GLS contact ID used in some API requests (see note below) | |
| 19 | +| `ship_it_api_url` | string | No | `https://api.gls-group.net/shipit-farm/v1/backend/rs` | GLS ShipIT API base URL | |
| 20 | +| `auth_url` | string | No | `https://api.gls-group.net/oauth2/v2/token` | GLS OAuth2 token endpoint — must end in `/token` | |
| 21 | +| `shipper` | GLS_SHIPPER | No | — | Default shipper address used when no shipper is provided in the shipment data | |
| 22 | + |
| 23 | +> **`contact_id`:** This identifier is required for certain shipment operations (e.g. end-of-day reports and some services). It is issued by GLS support — contact them directly to request it. |
| 24 | +
|
| 25 | +--- |
| 26 | + |
| 27 | +## How to obtain your credentials |
| 28 | + |
| 29 | +### Step 1 — Create a GLS Developer account |
| 30 | + |
| 31 | +1. Go to [https://dev-portal.gls-group.net/get-started](https://dev-portal.gls-group.net/get-started) |
| 32 | +2. Click **Sign In** and register a new account, or log in with an existing GLS account |
| 33 | +3. Complete the registration and verify your email address |
| 34 | + |
| 35 | +### Step 2 — Create an application |
| 36 | + |
| 37 | +1. After logging in, navigate to **My Apps** in the top navigation |
| 38 | +2. Click **Create App** (or **New Application**) |
| 39 | +3. Fill in the application name and description |
| 40 | +4. Select the required API scopes (typically **ShipIT**) |
| 41 | +5. Submit the form |
| 42 | + |
| 43 | +### Step 3 — Retrieve your credentials |
| 44 | + |
| 45 | +1. Open the application you just created in **My Apps** |
| 46 | +2. Copy the **Client ID** — this is your `client_id` |
| 47 | +3. Copy the **Client Secret** — this is your `client_secret` |
| 48 | + |
| 49 | +> Keep the `client_secret` confidential. Do not commit it to source control. |
| 50 | +
|
| 51 | +### Step 4 — Get your Contact ID (optional) |
| 52 | + |
| 53 | +The `contact_id` is not available in the developer portal. You must contact **GLS support** directly and ask them to provide you with a Contact ID linked to your GLS contract. |
| 54 | + |
| 55 | +--- |
| 56 | + |
| 57 | +## API endpoints |
| 58 | + |
| 59 | +GLS provides different API endpoints depending on your region and environment. The defaults point to the global production API: |
| 60 | + |
| 61 | +| Setting | Default URL | |
| 62 | +|---------|-------------| |
| 63 | +| `ship_it_api_url` | `https://api.gls-group.net/shipit-farm/v1/backend/rs` | |
| 64 | +| `auth_url` | `https://api.gls-group.net/oauth2/v2/token` | |
| 65 | + |
| 66 | +If you are using a regional or sandbox endpoint, update these values accordingly. Always ensure `auth_url` ends with `/token`. |
| 67 | + |
| 68 | +--- |
| 69 | + |
| 70 | +## Authentication flow |
| 71 | + |
| 72 | +The GLS Action authenticates using **OAuth2 client credentials**: |
| 73 | + |
| 74 | +``` |
| 75 | +GLS Action |
| 76 | + │ |
| 77 | + ├── POST {auth_url} |
| 78 | + │ body: grant_type=client_credentials |
| 79 | + │ client_id=<your-client-id> |
| 80 | + │ client_secret=<your-client-secret> |
| 81 | + │ |
| 82 | + │◄── { access_token, expires_in } |
| 83 | + │ |
| 84 | + └── All subsequent API calls include: |
| 85 | + Authorization: Bearer <access_token> |
| 86 | +``` |
| 87 | + |
| 88 | +Tokens are **cached** and automatically refreshed 60 seconds before they expire. You do not need to manage token lifecycle manually. |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +## Default shipper |
| 93 | + |
| 94 | +The optional `shipper` config allows you to set a **default sender address** that is applied to all shipments when no shipper is explicitly provided in the shipment data. This is useful when all your shipments originate from the same address. |
16 | 95 |
|
17 | | -For you to receive that credentials you need to follow this guide: https://dev-portal.gls-group.net/get-started#sign-in |
| 96 | +The value must be a valid `GLS_SHIPPER` object: |
18 | 97 |
|
19 | | -You can receive the client id and secret under "My Apps" after creating one. |
| 98 | +```json |
| 99 | +{ |
| 100 | + "Address": { |
| 101 | + "Name1": "My Company GmbH", |
| 102 | + "CountryCode": "DE", |
| 103 | + "City": "Berlin", |
| 104 | + "Street": "Hauptstrasse", |
| 105 | + "ZIPCode": "10115" |
| 106 | + } |
| 107 | +} |
| 108 | +``` |
20 | 109 |
|
21 | | -The Contact id needs to be retrieved from GLS support, so you need to contact them and ask for it. |
| 110 | +See [Types — GLS_SHIPPER](../types/#GLS_SHIPPER) for the full field reference. |
0 commit comments