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.
Parameter | Data Type | Necessity | Description |
---|---|---|---|
currency | Text | Required | Avarda checkout site currency code (ISO 4217 standard) E.g. SEK or EUR |
language | Text | Required | Avarda checkout form language code (ISO 639-1 standard) E.g. “sv” = Swedish, “en” = English |
tocountry | Text | Required | The delivery address country code (alpha-2 country code from the ISO 3166-1 standard) E.g. “SE” = Sweden, “DK” = Denmark |
tozipcode | Text | Required | The delivery address zip code |
date | Date | Required | Current date in Avarda checkout site local timezone (yyyy-MM-dd) E.g. “2023-07-21” |
time | Time | Required | Current time in Avarda checkout site local timezone (HH:mm) E.g. “13:30” |
currentutcdatetime | Date and time | Required | Current UTC date and time (MM/dd/yyyy HH:mm:ss) E.g. “07/21/2023 11:39:08” |
cartprice | Decimal number | Required | Total cart price E.g. “50.0” |
tostreet | Text | Required | The delivery address full street name, including street number. |
tocity | Text | Required | The delivery address city |
tosms | Text | Required | The customer’s phone number |
toemail | Text | Required | The 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:
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.
Parameter | Data Type | Necessity | Description |
---|---|---|---|
height | Integer | Optional | Height of the item in millimeters |
length | Integer | Optional | Length of the item in millimeters |
width | Integer | Optional | Width of the item in millimeters |
weight | Integer | Optional | Weight of the item in grams |
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.
Parameter | Data Type | Necessity | Description |
---|---|---|---|
attributes | string[] | Optional | Attributes 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 within 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.