NShift

Using nShift Checkout (opens in a new tab) you can present accurate and relevant delivery options in your webshop, as well as customize shipping experience for your customer.

This page expands upon the Common Integration Process, offering more in-depth information specifically concerning nShift.

1. Sign agreement

Contact nShift for more information: https://nshift.com/solutions/delivery-management (opens in a new tab)

2. Configure shipping broker

Follow the guidelines provided by nShift to configure their service according to your specific requirements. https://help.unifaun.com/phc-se/en/16401-18249-nshift-checkout-and-delivery.html (opens in a new tab)

Parameters

Add parameters that allow customization of how shipping options are displayed.

  • Required default parameters: the following parameters are required to be configured in your nShift setup (some might be already be configured by default). It’s crucial that all of these parameters are available and have the correct type, since they’re sent by default from Avarda to nShift on every request if the data is available in the checkout form.
ParameterData TypeNecessityDescription
currencyTextRequiredAvarda checkout site currency code (ISO 4217 standard)

E.g. SEK or EUR
languageTextRequiredAvarda checkout form language code (ISO 639-1 standard)

E.g. “sv” = Swedish, “en” = English
tocountryTextRequiredThe delivery address country code (alpha-2 country code from the ISO 3166-1 standard)

E.g. “SE” = Sweden, “DK” = Denmark
tozipcodeTextRequiredThe delivery address zip code
dateDateRequiredCurrent date in Avarda checkout site local timezone (yyyy-MM-dd)

E.g. “2023-07-21”
timeTimeRequiredCurrent time in Avarda checkout site local timezone
(HH:mm)

E.g. “13:30”
currentutcdatetimeDate and timeRequiredCurrent UTC date and time
(MM/dd/yyyy HH:mm:ss)

E.g. “07/21/2023 11:39:08”
cartpriceDecimal numberRequiredTotal cart price

E.g. “50.0”
tostreetTextRequiredThe delivery address full street name, including street number.
tocityTextRequiredThe delivery address city
tosmsTextRequiredThe customer’s phone number
toemailTextRequiredThe customer’s email address
  • Custom parameters: on top of the required default parameters, you can also add your own custom parameters in the nShift configuration. Remember that the names of these custom parameters must not conflict with the above required default parameters.

    The custom parameters and their values must be explicitly passed in the “attributes” field in shipping settings. See shipping settings section below for more information.

3. Activate shipping broker

Contact us and provide us with the necessary configuration details that you acquired from nShift in the previous steps. We will need:

  • nShift Key
  • nShift Secret
  • nShift Delivery Checkout Id
  • Fallback shipping text: any text of your choice that will be used in case shipping broker fails and can’t display the shipping widget.

We will then enable nShift in your checkout form.

4. Extend API requests

See example of a fully extended request below:

{
  "items": [
    {
      "description": "Product One",
      "notes": "Some notes",
      "amount": 50,
      "taxCode": "tax46",
      "taxAmount": 2,
      "quantity": 1,
      "articleNumber": "ASDASD86",
      // Extended shipping parameters ↓
      "shippingParameters": {
        "height": 300,
        "length": 300,
        "width": 30,
        "weight": 30
      }
    },
    // Extended default shipping item ↓
    {
      "Description": "Shipping",
      "Notes": "SHI001",
      "Amount": 55.0,
      "TaxCode": "0",
      "TaxAmount": 9.8,
      "Quantity": 1
    }
  ],
  // Extended shipping settings ↓
  "shippingSettings": {
    "attributes": ["freefreight=true", "isbulky=false", "customParameter=value"]
  }
}

Default shipping item

View Default Shipping Item section in the Common Integration Guide for more information.

Shipping parameters

The shipping parameters are specific for a single item. This is extra information nShift will use when preparing a shipment. View Shipping Parameters section in the Common Integration Guide for more information.

ParameterData TypeNecessityDescription
heightIntegerOptionalHeight of the item in millimeters
lengthIntegerOptionalLength of the item in millimeters
widthIntegerOptionalWidth of the item in millimeters
weightIntegerOptionalWeight of the item in grams
attributesstring[]OptionalCurrently not used with nShift

Shipping settings

The shipping settings affect the entire cart and are used by nShift to provide better shipping options. View Shipping Settings section in the Common Integration Guide for more information.

ParameterData TypeNecessityDescription
vouchersstring[]OptionalCurrently not used with nShift
attributesstring[]OptionalAttributes of the entire cart. nShift can set varied delivery scenarios based on such attributes.

Must be specified as key-value pairs and separated by “=”. The key of each attribute must be available in the nShift configuration and the value must be of the configured type (text, date etc.)

E.g. [“freefreight=true”, “weight=1000”]

5. Obtain shipping details

After a purchase is successfully completed, the payment status response will include additional shipping data withi­n the “modules” section, encompassing all essential shipping information.

6. Frontend shipping bundle

By default, Checkout3 frontend loads and displays the shipping module automatically. However, in situations where automatic loading of third-party resources is not preferred due to alternative script-loading methods (e.g., RequireJS), we provide the option to deactivate this automatic loading behaviour by configuring the appropriate flag in the initial setup. Detailed information on this process can be found in the documentation section titled Extra flag.

If automatic loading is disabled, it’s the developer’s responsibility to load the required script. Include the script using your chosen module loader. For detailed instructions, please consult the Installation section of the NShift installation page (opens in a new tab).

Before loading the Checkout3 bundle, ensure that the script is available and it’s attached to the window object as window.UnifaunCheckout.