Test scenarios
Use these inputs in pre-prod to trigger specific results, so you can test how your integration handles fallbacks, limits and errors before you go live.
All scenarios use the pre-prod environment (https://api.pre.helthjem.no) and the test shop shopId: 16. Unless a scenario says otherwise, use the standard test data:
| Party | Name | Address |
|---|---|---|
| Consumer | Ola Nordmann | Kongsberggata 18, 0468 Oslo |
| C2C sender | Kari Nordmann | Herslebs gate 2F, 0561 Oslo |
| Shop | Test shop | Sandakerveien 121, 0480 Oslo |
Use 12345678 as the phone number and test@example.com as the email address. Pre-prod sends no SMS or email and triggers no real pickups or deliveries. See Environments.
Delivery methods and fallback
| Scenario | Endpoint | Input | Expected result |
|---|---|---|---|
| Home delivery available | Check address coverage | Consumer address, transportSolutionId: 2, weight: 1000 |
200 with "productName": "HELTHJEM" |
| Home delivery booked | Book a parcel | Consumer address, transportSolutionId: 1, weight: 1000 |
201 with freightProductId: 1 |
| Commercial address falls back | Book a parcel | Consignee at Sandakerveien 121, 0480 Oslo (a business address), transportSolutionId: 1 |
201 with freightProductId: 55 (Helthjem service point). Home delivery isn't available for commercial addresses. |
| Rural address, service point | Check address coverage | Å-veien 45, 8392 Sørvågen, transportSolutionId: 62 |
200 with "productName": "Helthjem_SHOP" |
| No home delivery coverage | Check address coverage | Å-veien 45, 8392 Sørvågen, transportSolutionId: 2 |
400 with errorKey: no.carrier.support |
| Fallback is tracked | Get tracking events | A booking that fell back, for example the commercial address above | Tracking event 154 (fallback shipment solution was triggered) |
Parcel limits
Weight is in grams, and dimensions are in centimetres. See Delivery methods for the limits of each freight product.
| Scenario | Endpoint | Input | Expected result |
|---|---|---|---|
| Too heavy for home delivery and lockers | Book a parcel | transportSolutionId: 1, weight: 6000 |
201 with freightProductId: 55. FP 1 and FP 95 allow up to 5000 g, so the booking falls back to a Helthjem service point. |
| Too heavy for Helthjem service points | Book a parcel | transportSolutionId: 1, weight: 25000 |
201 with freightProductId: 3. FP 55 allows up to 20000 g, so the booking falls back to a PostNord service point (up to 90000 g). |
| Too heavy, no fallback | Check address coverage or Book a parcel | transportSolutionId: 2, weight: 25000 |
400 with errorKey: no.carrier.support.package.too.heavy |
| Too heavy for any service point | Book a parcel | transportSolutionId: 1, weight: 95000 |
400 with errorKey: no.carrier.support.package.too.heavy |
| Too big for a parcel locker | Book a parcel | transportSolutionId: 137, item length: 60, width: 45, height: 50 |
400 with errorKey: no.carrier.support.package.too.big. Parcel lockers take up to 590 x 450 x 500 mm. |
| Content value too high | Book a parcel | transportSolutionId: 2, item contentValue: 6000 |
400 with errorKey: no.carrier.support.package.too.expensive. Home delivery allows up to 5000 kr. |
Request validation
| Scenario | Endpoint | Input | Expected result |
|---|---|---|---|
| Missing transport solution | Any request that needs one | Leave out transportSolutionId |
400 with errorKey: transportSolutionId.required |
| Date in the wrong format | Book a parcel | "desiredDeliveryDate": "2026-10-14" (with dashes) |
400 with errorKey: invalid.format.desiredDeliveryDate |
| Date in the past | Book a parcel | "desiredDeliveryDate" set to yesterday, in YYYYMMDD format |
400 with errorKey: desiredDeliveryDate.must.be.in.future |
| No consignee | Book a parcel | parties without a consignee |
400 with errorKey: party.type.consignee.required |
| No items | Book a parcel | "items": [] |
400 with errorKey: item.required |
Authentication and access
| Scenario | Endpoint | Input | Expected result |
|---|---|---|---|
| Wrong credentials | Get an access token | An invalid client_secret |
401 |
| Missing token | Any endpoint | No Authorization header |
401 with errorKey: authentication.missing |
| Another shop | Any endpoint with shopId |
A shopId your credentials don't have access to |
403 with errorKey: no.access.shop.id |
Idempotency and duplicates
| Scenario | Endpoint | Input | Expected result |
|---|---|---|---|
| Safe retry | Book a parcel | Send the same booking twice with the same idempotency-key |
Both responses are the same, and only one shipment is created. |
| Key too long | Book a parcel | An idempotency-key with 41 characters |
400 with errorKey: over.max.length.of.idempotency.key |
| Duplicate shipment ID | Book a parcel | Two bookings with the same shipmentId and different idempotency-key values |
The second returns 400 with errorKey: shipment.id.already.exists |
Labels, tracking and cancellation
| Scenario | Endpoint | Input | Expected result |
|---|---|---|---|
| Label for an unknown shipment | Get a label | A shipmentId that doesn't exist |
404 |
| Tracking for an unknown shipment | Get tracking events | A tracking number that doesn't exist | 200 with an empty array [] |
| Cancel an unknown booking | Cancel a booking | A shipmentId that doesn't exist |
400 with errorKey: order.not.found |
| Cancel a booking | Cancel a booking | The shipmentId (without (401)) of a booking you made earlier |
200 with no response body. Tracking then shows event 073 (order cancelled). |
See also
- Errors: every error key and what to do about it.
- Delivery methods: transport solutions, fallbacks and limits.
- Go-live checklist: check your integration before you switch to production.
Last updated
