Quick-start guide

Book a test parcel, print its label and track it, in about 30 minutes.

All examples use the pre-prod (test) environment. You need pre-prod credentials from the Helthjem Integrations Team. See Environments.

This guide covers these steps:

  1. Get an access token
  2. Check coverage
  3. Book a parcel
  4. Get the label
  5. Track the parcel

1. Get an access token

Request an access token with your client credentials.

Request

curl -X POST "https://api.pre.helthjem.no/auth/oauth2/v1/token" \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "your_client_id",
    "client_secret": "your_client_secret",
    "grant_type": "client_credentials"
  }'

Response

{
  "token": "your_token",
  "expires_in": 82800,
  "token_type": "Bearer"
}

Send the token in the header of every following request: Authorization: Bearer your_token. In the examples below, replace your_token with your own token.

Cache the token

A token is valid for 23 hours ( expires_in is in seconds). Store it and reuse it for all requests. Fetch a new one shortly before it expires, or when a request returns 401 . Don't request a new token for every API call.

2. Check coverage

Use the Single Address Check endpoint to confirm that home delivery is available for the address.

Request

curl -X POST "https://api.pre.helthjem.no/parcels/v1/addresses/find/single" \
  -H "Authorization: Bearer your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "shopId": 16,
    "transportSolutionId": 1,
    "customerName": "Ola Nordmann",
    "address": "Kongsberggata 18",
    "zipCode": "0468",
    "postalName": "Oslo",
    "countryCode": "NO",
    "weight": 1000
  }'

Response (trimmed)

{
  "productName": "HELTHJEM",
  "routeName": "21507",
  "routing": "16-0-x21507x1466",
  "routingDescription": "TÅSEN"
}

"productName": "HELTHJEM" confirms that home delivery is available for this address. If the address is not covered, the API responds with 400 and "errorKey": "no.carrier.support".

3. Book a parcel

Book the parcel with the Booking endpoint. Send an idempotency-key header with a unique value for each shipment, so you can safely retry the request without creating a duplicate.

Request

curl -X POST "https://api.pre.helthjem.no/parcels/v1/bookings" \
  -H "Authorization: Bearer your_token" \
  -H "Content-Type: application/json" \
  -H "idempotency-key: 3f1b2c9e-8a7d-4e21-9c55-0a1b2c3d4e5f" \
  -d '{
    "shopId": 16,
    "transportSolutionId": 1,
    "parties": [
      {
        "type": "consignee",
        "name": "Ola Nordmann",
        "countryCode": "NO",
        "postalName": "Oslo",
        "zipCode": "0468",
        "address": "Kongsberggata 18",
        "phone1": "12345678",
        "email": "test@example.com"
      },
      {
        "type": "consignor",
        "name": "Test shop",
        "countryCode": "NO",
        "postalName": "Vestby",
        "zipCode": "1540",
        "address": "Toveien 19",
        "phone1": "12345678"
      }
    ],
    "items": [
      {
        "itemNumber": 1,
        "weight": 1000,
        "width": 12,
        "height": 12,
        "length": 12,
        "contents": "Shoes"
      }
    ]
  }'

Response (trimmed)

{
  "orderId": 89828037,
  "shipmentId": "(401)70724762337121945",
  "freightProductId": 1,
  "items": [
    {
      "itemNumber": 1,
      "trackingReference": "(00)370724762337121953"
    }
  ]
}

Save the shipmentId and trackingReference. When you use them in a URL in the next steps, remove the (401) and (00) prefixes.

Use an idempotency key

If the booking request times out or returns a 5xx error, retry it with the same idempotency-key . You get the original booking back instead of a duplicate shipment. Use one unique key per shipment (max 40 characters; a UUID is recommended), and store it with your order before you send the request.

4. Get the label

Get a printable PDF label for the shipment.

Request

curl -X GET "https://api.pre.helthjem.no/parcels/v1/labels/70724762337121945/unified-large" \
  -H "Authorization: Bearer your_token" \
  -H "Accept: application/pdf" \
  -o label.pdf

The response is a PDF file with one 102 mm x 192 mm label.

5. Track the parcel

Get the tracking events for the parcel.

Request

curl -X GET "https://api.pre.helthjem.no/parcels/v1/tracking/fetch/70724762337121945/EN/false" \
  -H "Authorization: Bearer your_token"

Response (trimmed)

[
  {
    "shipmentNumber": "70724762337121945",
    "shopId": 16,
    "items": [
      {
        "trackingNumber": "370724762337121953",
        "freightProductId": 1,
        "parcelStatus": "WAITING_FOR_PACKAGE",
        "events": [
          {
            "eventTime": "2025-10-13 13:46:07",
            "eventTimeUtc": "2025-10-13T11:46:07.028470Z",
            "eventType": {
              "apiKey": "001",
              "description": "Transport of parcel has been booked."
            }
          }
        ]
      }
    ]
  }
]

Each event has an apiKey that identifies what happened. See Tracking events for the meaning of each code.

Next steps

Last updated