Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The API provides a list of future distribution dates that have coverage for delivery or pickup coverage for of a product for on the specified address. The product are determined from the Freight Product freight product (freightProductId). The remaining fields along with the customer name field will be used to lookup the address in the carrier system.

The coverage check is based on the coverage available from the carrier. We continuously receive updated information from the carrier, and therefore the delivery option result may vary with time
To determine coverage we also look at previous shipment to similar addresses and consumers, this help correct misspellings and find coverage.

Tip

Integration tips

  • We recommend to always include all information you have available, and use the same information in other relevant APIs to ensure the results are consistent

  • For delivery address where there are households and businesses it is necessary to specify Specify household number where possible, e.g. H0201, in order for the system to know which match of the options you wantaddress as exact as possible

Setup

Example

Description

Username (see Authentication section)

wsfoobar

A valid username.

Password (see Authentication section)

a-very-very-long-password

A password matching given username.

shopId

12345

All bookings are The coverage check is made with respect to a given shop. 

freightProductId

55

An identifier for a valid freight product.

...

Info
  • Clients using this API should not fail if new optional fields are added to the API. If a new field is added to the request or response on a later stage, existing clients should handle this in a way such as they just ignore the field.For a delivery address where there are households and businesses it is necessary to specify household number, e.g. H0201, to ensure the API identifies correct delivery place

Request header

Field

Value

Content-Type

application/json

Authorization

$SECRET_WS_TOKEN - jwt token from authentication

...

Expand
titleExample
Code Block
curl --location 'https://staging-ws.di.no/ws/json/addressCheck/single/v-1/dates?limit=14' \
--header 'Authorization: Bearer $SECRET_WS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{ 
"shopId": "33",
"freightProductId": "10",
"customerName": "Ola Norrman",
"countryCode" : "NO",
"postalName" : "SEM",
"zipCode": "3171",
"address": "GAMLE RAMNESVEI 38",
"co" : "Kari Norrman"
}'

Response

The endpoint replies with a response object in JSON format, containing the following data

...

Expand
titleExample
Code Block
{
    "distributionDatesdates": [
        "2024-04-16",
        "2024-04-17",
        "2024-04-18",
        "2024-04-19",
        "2024-04-20",
        "2024-04-22",
        "2024-04-23",
        "2024-04-24",
        "2024-04-25",
        "2024-04-26",
        "2024-04-27",
        "2024-04-29"
    ]
}

...

HTTP Status code

Text

Description

400

Client or Validation Error

The request body/query string is not in the correct format.

401

Authentication Failure

Indicates that the Authorization header is either missing or incorrect. You can learn more about the Authorization header here.

403

Access denied

This indicates that the agent whose credentials were used in making this request was not authorized to perform this API call. It could be that you do not have access to the shop or transportsolution you provided in your request. If you believe this is a mistake, please reach out to your contact so it can be rectified.

405

Method not allowed

This API request used the wrong HTTP verb/method. For example a PUT request will result in this error.

4xx

Client error

Generally receiving an error code that starts with 4 indicates that the client needs to change something.

500

Unexpected Server Error

Oops! This may indicates an error on our side. Please try again, if the error continues notify your contact person

...

Please check error list for Booking API for more keys and explanation for some keys. https://jira-di.atlassian.net/wiki/spaces/DIPUB/pages/68026370/Parcel+Booking+API#Error-Keys
Expand
titleList of error keys

error key

status code

required.shop.id

400

wrong.shop.id

400

wrong.freight.product.id

400

no.access.shop.id

403

internal.error

500

...