UDC Super SE

Unifaun DeliveryCheckout

Using Unifaun DeliveryCheckout you can present precise and relevant delivery options for every customer in your webshop.

To implement Unifaun DeliveryCheckout you need to:

There is a variety of possibilities for you to create flexible and personalized delivery options for your customers, for example:

  • Use different languages and currencies.

  • Set up conditions by using parameters, e.g. weight limitations, cart price and destination.

  • Add additional services not connected to a carrier, e.g. 'Gift wrapping'.

  • Add custom agents, e.g. your own physical shops.

  • Add extra data fields, e.g. door code and contact information.

  • Connect delivery checkouts to profile groups by using profile management. Mainly used if the delivery checkout set-up is hosted by a 3PL.

The delivery options are always validated using zip codes provided by the carrier. For some carriers you may have to upload zip code lists yourself. Please refer to Condition lists.

Tip

To get the most out of Unifaun DeliveryCheckout, it’s important to consider your requirements from the very beginning.

The starting point is always the practice that is or should be established within the company or organization.

You should take into account how many webshops you have, in which countries you operate and which languages and currencies to support.

Also consider which transport services to support in different markets, under which circumstances and for which deliveries they should be available.

Checkout flow

Set-up

Delivery checkout ID is always the highest level. You can build your entire structure from one ID. If you have more than one webshop, operate on different markets with different carriers, support several countries, languages and currencies, it's a good idea to consider more than one delivery checkout.

A delivery option is either a service, e.g. "PostNord MyPack Collect" and "DHL Paket", or a container for services, e.g. agent delivery services.

Sublevel is optional and is used to group services

Tip

A general recommendation is not to display too many overlapping delivery options.

Addons, carrier specific or custom addons, can be added for services on delivery option level or sublevel.

Thus, the set-up can be either flat or hierarchical.

Create a delivery checkout

Notice

Before you begin, make sure you have at least one sender in your address book. Please refer to Add a new sender in the GUI or Import address book.

  1. Go to Maintenance > Delivery checkout.

  2. Click New delivery checkout.

    The delivery checkout is assigned a unique Delivery checkout ID.

  3. Select a Default sender to automatically get e.g. log in information and customer number.

  4. Check the Advanced route handling box if you need to add another default sender for bulk services from abroad.

  5. Template should be set to “Unifaun standard”.

  6. Click Add.

  7. In the Languages section, select and add the languages that should be available in the delivery checkout, e.g. "en".

  8. In the Currencies section, select and add the currencies that should be available in the delivery checkout, e.g. "EUR".

  9. Add new parameters, extra data fields and custom addons if applicable.

  10. When you have added languages and currencies, the section Delivery options is shown.

  11. Click New option.

Notice

For most delivery options, sublevels and services it is possible to enter appliance conditions.

Delivery options

  1. The name you give the delivery option, e.g. "Home", is for internal use only.

  2. Click New in the Fields for titles section.

    1. In the Language section, enter the title to be shown in the webshop in the languages you defined earlier, e.g. ”Home delivery” in the en field.

  3. Click New in the Captions for field X sections to add texts. Relevant text/information depends on your webshop set-up.

    1. In the Language section, enter the text in the languages you defined earlier, e.g. ”Relevant text” in the en field.

  4. Click New in the Sort order section to specify in what place the delivery option should appear.

  5. Click New sublevel in the Delivery options section.

    Important

    If you do not want a hierarchical structure, i.e. use sublevels, select services in the dropdown list i the Service section and click Add service.

Delivery options - sublevel

  1. The name you give the sublevel, e.g. "DBS parcel", is for internal use only.

  2. Click New in the Fields for titles section.

    1. In the Language section, enter the title to be shown in the webshop in the languages you defined earlier, e.g. ”DB Schenker parcel” in the en field.

  3. Click New in the Captions for field X sections to add texts. Relevant text/information depends on your webshop set-up.

    1. In the Language section, enter the text in the languages you defined earlier, e.g. ”Relevant text” in the en field.

  4. Click New in the Sort order section to specify in what place the sublevel should appear.

  5. Select a service, e.g. "DB SCHENKERparcel" in the Service section.

  6. Click Add service.

New service

  • Click New in the Prices section to enter prices for the service.

    1. In each currency section, enter the price to be displayed for each language, e.g. "€ 7" in en and the price as a numerical value, e.g. "7.0" in Price.

    2. In the Addons section, click to the left of an addon you want to activate or edit.

      1. Check Preselected, Mandatory or both if the addon should be preselected and/or mandatory in the webshop.

      2. Click New in the Prices section to enter prices for the addon.

        1. In each currency section, enter the price to be displayed for each language, e.g. "€ 1" in en and the price as a numerical value, e.g. "1.0" in Price.

      Important

      If you click OK when leaving the Edit addon page the addon is activated even if you have not entered any information.

To add other services for "Home delivery", click New sublevel on the New option page and follow the steps above.

To add more delivery options for the delivery checkout, click New option on the New delivery checkout page and follow the steps above.

For some items, such as delivery options and prices you can change the order in which the appear in the webshop. Use the UO_Up_icon.png or UO_Down_icon.png icon next to an item row or use Sort order as described above.

Notice

Custom agents are treated as services and are added in the same way.

Click Test to see how the delivery options and sublevels will be displayed in the webshop depending on which parameters you enter.

Important

"tocity" and "tozipcode" are always mandatory but for some carriers other parameters may be required as well.

To show, edit or delete a delivery checkout use the search functionality.

Conditions and parameters

You use parameters to state under which conditions the different delivery options, services and prices are shown in the webshop.

Parameters

Some parameters already exist in the system, but you can also add your own.

Parameters are configured in the UI. If there is no default value, the parameter must be sent in the API call. Parameters connected to the sender are sent automatically.

The following parameters comes with the system.

Parameter

Type

date

Date (YYYY-MM-DD)

time

Time (HH:MM)

fromcountry

Text

tocountry

Text

fromzipcode

Text

tozipcode

Text

tostreet

Text

fromstreet

Text

tocity

Text

fromcity

Text

fromstate

Text

tostate

Text

tosms

Text

toemail

Text

todoorcode

Text

weight

Decimal number (0.0)

cartprice

Decimal number (0.0)

uselatestlist

Boolean

Create and add your own parameters

You can add parameters to a new or existing delivery checkout.

  1. Go to Maintenance > Delivery checkout.

  2. When creating a new delivery checkout you create new parameters on the New delivery checkout page.

    To add new parameters on an existing delivery checkout, click to the left of the delivery checkout on the Delivery checkout page.

  3. In the Parameters section you can enter name, type and default value.

  4. Click New parameter.

You delete the parameter by clicking next to it.

Carrier specific parameters

For some carriers there are parameters that should only be used for their services.

Carrier

Parameter

Type

Description

helthjem/Svosj

helthjem_active_subscription

Boolean

Gets set to true if there is an active Svosj-subscription with the recipients email.

helthjem/Svosj

svosj_trial_eligible

Boolean

Gets set to true if the recipient is eligible for a 30 day free Svosj trial account.

Instabox

instaboxexp_recommendable

Boolean

Gets set to true if there is an Instabox locker closer than x meters from the zipcode of the receiver (where "x" is a number configured by the merchant and Instabox).

Operators

The following operators are used to state conditions.

Operator

Meaning

>

greater than

>=

greater than or equal to

<

less than

<=

less than or equal to

=

equal to

!=

not equal to

!

not

&

and

|

or

?

list <parameter> ? "<list name>"

Tip

  • When using only &-operators in an expression, all expressions must be true for the entire expression to be true.

    Example:

    tocountry = "SE" & fromcountry = "SE"

  • When using only |-operators in an expression at least one of the expressions must be true for the entire expression to be true.

    Example:

    tocountry = "SE" | tocountry = "DK" | tocountry = "FI"

  • Always use excluding conditions in e.g. a price list. Otherwise it's the order that decides.

    Example:

    cartprice >= 500.0

    cartprice < 500.0

  • Use parentheses to decide in which order expressions should be evaluated to render the expected result.

    Example:

    weight <=20.0 & tocountry = ”SE” | tocountry = ”DK”

    results in

    weight = 40.0 and tocountry=DK is true

    weight = 10.0 and tocountry=DK is true

    while

    weight <=20.0 & (tocountry = ”SE” | tocountry = ”DK”)

    results in

    weight = 40.0 and tocountry=DK is false

    weight = 10.0 and tocountry=DK is true

  • Instead of creating new parameters or having to write long and complicated expressions you can use ! and != to invert boolean expressions.

    Example:

    !newaccount is true if newaccount is false

    tocountry != "SE" is true if tocountry is not SE

  • Use condition lists to evaluate against a large amount of values, e.g. zip codes.

    Example:

    tozipcode ? "zipcodes_in_gbg_sthlm"

Examples of useful conditions

Example: Price

If the cart contains items for €50 or more the delivery is free of charge.

cartprice >= 500.0

cartprice < 500.0

Example: Weight

This delivery option should only be shown if the weight of the parcel is less than 20 kg.

weight < 20.0

weight >= 20.0

Example: Date range

Delivery is free from Christmas Eve to December 27th.

(Date >= ”2020-12-24" & Date <=”2020-12-27”)

Example: Own parameters

This delivery is bulky goods sent to a business customer that is not a in the partner program.

bulky = true

b2b = true

VIP = false

Example: Titles/headings

Orders made before 1 p.m. are delivered within the day.

time < 13:00

Condition lists

Condition lists make it easy to import large amounts of data.

Create a list in .txt format with, for example, zip code ranges and/or single zip code items. The ranges and items must be entered on separate rows. Use a semicolon (;) between items to indicate a range.

Example

11130;11140

11145

11160;11170

11175

11180;11190

41130;41140

41145

41160;41170

41175

41180;41190

You need to upload and activate the condition list.

  1. Go to Maintenance > Delivery checkout.

  2. Click Condition lists.

  3. Click Import and select the condition list file.

  4. Search for the list to activate it. The list has status "OK".

  5. Click to the left of the list and then Activate. An active list has status "OK (Active)".

You can change the name of the list or delete it, but you can't deactivate it.

Custom addons

You can add up to six additional services to a new or existing delivery checkout. The custom addons can be used for all services.

  1. Go to Maintenance > Delivery checkout.

  2. When creating a new delivery checkout you enable custom addons on the New delivery checkout page.

    To create custom addons on an existing delivery checkout, click to the left of the delivery checkout on the Delivery checkout page.

  3. Click the left of an addon row in the Custom addons section.

    Important

    If you click OK when leaving the Edit addon page the addon is activated even if you have not entered any information.

You disable the custom addon by clicking to the left of the addon row.

Extra data fields

You can add extra data fields to a new or existing delivery checkout. The extra data fields are not related to certain services.

  • Door code

  • Delivery instruction

  • Contact

  • Phone

  • Email

  1. Go to Maintenance > Delivery checkout.

  2. When creating a new delivery checkout you enable extra data fields on the New delivery checkout page.

    To create extra data fields on an existing delivery checkout, click to the left of the delivery checkout on the Delivery checkout page.

  3. Click the left of a data field row in the Extra data fields section.

    Important

    If you click OK when leaving an Extra data field page the data field is activated even if you have not entered any information.

You disable an extra data field by clicking to the left of the data field row.

Versions

When you create or edit a delivery checkout you can work with different versions.

  • If you edit an active version, primarily when creating a delivery checkout, you can save the changes by clicking Finish. Then you only have one version of the delivery checkout.

  • If you edit an active version but want to activate the changes at a later occasion, click Save as new version. Then you have two delivery checkouts with the same delivery checkout ID, but the new version is not active.

  • You can copy an existing delivery checkout to create a new delivery checkout ID. It can be used when a new version of the webshop is released in order to synchronize the new code with the new version of the delivery checkout.

    1. Click to the left of the delivery checkout.

    2. Click Copy and give the delivery checkout a new name.

    The delivery checkout gets a new delivery checkout ID and the version is set to active.

  • Activate another version of an existing delivery checkout by clicking to the left of the version that is not active, and then Activate.

Integrate

Unifaun's REST API framework is used for communication between Unifaun DeliveryCheckout and your webshop.

Before you start you need to create an API key for authentication towards the Unifaun REST API framework.

Tip

We recommend you to prepare a fallback solution for every checkout session in case you do not get a response from our API, e.g. due to maintenance.

This way you ensure that your customers are always presented with shipping options.

Checkout flow

GET /delivery-checkouts/{deliveryCheckoutId}

This endpoint returns the delivery options that are available in the delivery checkout.

Endpoint

https://api.unifaun.com/rs-extapi/v1/delivery-checkouts/

Authorization

Basic authentication using an API key or custom bearer token based on API key.

URI parameters

deliveryCheckoutId

From the set-up. Required.

Query parameters

currency

Required

language

Required

tocountry

Required

tozipcode

Required

  • It is important that the language and currency used as query parameters are configured for the delivery checkout in .

  • "tocountry" and "tozipcode" are mandatory address information.

    Important

    Some carriers may require more address parameters to consider the address complete.

  • If sender is not selected in the delivery checkout configuration "fromcountry" and "fromzipcode" must be set as query parameters.

Please refer to the parameter list for values and other parameters that can be added in the query.

Response example

{
  "deliveryCheckoutId": "ece27d51-614d-4339-9728-4113e16b87ff+37",
  "options":    [
    {
      "id": "121f80bf-2652-43c7-9870-74de9d3157d9",
      "name": "Hemleverans",
      "description1": "Få paket hem",
      "description2": "",
      "description3": "",
      "description4": "",
      "description5": "",
      "carrierId": null,
      "priceDescription": null,
      "priceValue": null,
      "subOptions": [         {
        "id": "aa59c047-21cc-46fa-bb62-3ca2566b6bbe",
        "name": "PostNord Parcel",
        "description1": "Leverans 1-2 vardagar",
        "description2": "",
        "description3": "",
        "description4": "",
        "deliveryTime": "",
        "carrierId": "PLAB",
        "priceDescription": "20 kr",
        "priceValue": 20,
        "subOptions": [],
        "agents": []
      }],
      "agents": []
    },
    {
      "id": "199e9ed0-5abf-4109-9899-270cf39f7138",
      "name": "MyPack Collect",
      "description1": "",
      "description2": "",
      "description3": "",
      "description4": "",
      "description5": "",
      "carrierId": "PLAB",
      "priceDescription": "29 SEK",
      "priceValue": 29,
      "subOptions": [],
      "agents": [
        {
          "id": "74383",
          "name": "Agent name",
          "address1": "Agentstreet 1",
          "address2": null,
          "zipCode": "11111",
          "city": "STOCKHOLM",
          "country": "SE"
        },
        {
          "id": "43333",
          "name": "Agent name",
          "address1": "Agentstreet 2",
          "address2": null,
          "zipCode": "11111",
          "city": "STOCKHOLM",
          "country": "SE"
        }
      ],
      "fields": null
      "addons": [
        {
          "id": "FCNOTIFYEMAIL",
          "description": "E-postavisering",
          "selected": false,
          "priceDescription": "Gratis!",
          "price": 0,
          "oneOf": null,
          "atLeastOneOf": [
            "FCNOTIFYEMAIL",
            "FCNOTIFYSMS",
            "FCNOTIFYLETTER"
          ],
          "exclude": [
            "FCNOTIFYLETTER"
          ],
          "fields": [
            {
              "id": "email",
              "description": "E-post",
              "type": "EMAIL",
              "value": null,
              "mandatory": true,
              "min": null,
              "max": null,
              "pattern": null,
              "items": []
            }
          ]
        },
        {
          "id": "FCNOTIFYSMS",
          "description": "SMS-avisering",
          "selected": false,
          "priceDescription": "40 SEK",
          "price": 40,
          "oneOf": null,
          "atLeastOneOf": [
            "FCNOTIFYEMAIL",
            "FCNOTIFYSMS",
            "FCNOTIFYLETTER"
          ],
          "exclude": [
            "FCNOTIFYLETTER"
          ],
          "fields": [
            {
              "id": "sms",
              "description": "Sms",
              "type": "PHONE",
              "value": null,
              "mandatory": true,
              "min": null,
              "max": null,
              "pattern": null,
              "items": []
            }
          ]
        },
        {
          "id": "FCNOTIFYLETTER",
          "description": "Brevavisering",
          "selected": false,
          "priceDescription": "49 SEK",
          "price": 49,
          "oneOf": null,
          "atLeastOneOf": [
            "FCNOTIFYEMAIL",
            "FCNOTIFYSMS",
            "FCNOTIFYLETTER"
          ],
          "exclude": [
            "FCNOTIFYSMS",
            "FCNOTIFYEMAIL"
          ],
          "fields": []
        }
      ]
    }
  ]
}

For testing the method, please refer to https://api.unifaun.com/rs-docs/ and navigate to /delivery-checkouts GET.

POST /delivery-checkouts/{deliveryCheckoutId}

This endpoint creates a prepared shipment based on the delivery option the consumer has selected in the webshop.

Important

This endpoint is mandatory.

Endpoint

https://api.unifaun.com/rs-extapi/v1/delivery-checkouts/

Authorization

Basic authentication using an API key or custom bearer token based on API key.

URI parameters

deliveryCheckoutId

Required.

returnShipmentData

If set to "true" shipment data will be returned in the response.

Important

Always use the complete delivery checkout ID since version of the delivery checkout is included in the ID.

Body example

{
  "shipment": {
    "receiver": {
      "name": "Unifaun AB",
      "address1": "Tegnérgatan 34",
      "zipcode": "11359",
      "city": "STOCKHOLM",
      "country": "SE",
      "phone": "+46 8 34 35 15",
      "email": "email2@example.com"
    },
    "agent": {
          "quickId": "74383",
          "name": "Agent name",
          "address1": "Agentstreet 1",
          "address2": null,
          "zipcode": "11111",
          "city": "STOCKHOLM",
          "country": "SE"
    },
    "orderNo": "order number 123",
    "senderReference": "sender ref 234",
    "receiverReference": "receiver ref 345",
    "options": [{
      "message": "This is order number 123",
      "to": "email2@example.com",
      "id": "ENOT",
      "languageCode": "SE",
      "from": "email1@example.com"
    }]
  },
  "selectedOptionId": "199e9ed0-5abf-4109-9899-270cf39f7138",
  "selectedAddons": [{
    "id": "FCNOTIFYSMS",
    "fields": [{
      "id": "sms",
       "value": "070000000"
    }]
  }],
  "prepareId": "100012",
  "returnShipmentData": true
}

Response example

{
    "developerId": null,
    "sender": {
        "quickId": "1",
        "orgNo": null,
        "vatNo": null,
        "name": "Unifaun AB",
        "address1": "Skeppsbron 5-6",
        "address2": null,
        "zipcode": "41121",
        "city": "GÖTEBORG",
        "state": null,
        "country": "SE",
        "contact": null,
        "phone": "+46 31 725 35 00",
        "fax": null,
        "email": "email1@example.com",
        "mobile": null,
        "doorCode": null,
        "houseNumber": null,
        "addition": null
    },
    "senderPartners": [],
    "dispatch": null,
    "receiver": {
        "quickId": null,
        "orgNo": null,
        "vatNo": null,
        "name": "Unifaun AB",
        "address1": "Tegnérgatan 34",
        "address2": null,
        "zipcode": "11359",
        "city": "STOCKHOLM",
        "state": null,
        "country": "SE",
        "contact": null,
        "phone": "+46 8 34 35 15",
        "fax": null,
        "email": "email2@example.com",
        "mobile": null,
        "doorCode": null,
        "houseNumber": null,
        "addition": null
    },
    "receiverPartners": [],
    "delivery": null,
    "agent": null,
    "returnPart": null,
    "freightPayer": null,
    "freightPayerPartners": null,
    "taxPayer": null,
    "taxPayerPartners": null,
    "customsPayer": null,
    "customsPayerPartners": null,
    "favorite": null,
    "profileGroup": "Grundprofilgrupp",
    "note": null,
    "route": null,
    "test": null,
    "linkPrintKey": null,
    "orderNo": "order number 123",
    "mergeId": null,
    "freeText1": null,
    "freeText2": null,
    "freeText3": null,
    "freeText4": null,
    "senderReference": "sender ref 234",
    "receiverReference": "receiver ref 345",
    "goodsDescription": null,
    "bulkId": null,
    "totalEurPallets": null,
    "totalHalfPallets": null,
    "totalQuarterPallets": null,
    "totalWeight": null,
    "totalVolume": null,
    "totalLoadingMeters": null,
    "totalSortCode": null,
    "totalQuantity": null,
    "totalPieces": null,
    "totalPallets": null,
    "waybillFreeText1": null,
    "waybillFreeText2": null,
    "waybillFreeText3": null,
    "waybillFreeText4": null,
    "waybillFreeText5": null,
    "waybillSpecialAgreement": null,
    "waybillDocuments1": null,
    "waybillDocuments2": null,
    "waybillCondition": null,
    "termsType": null,
    "termsCode": null,
    "termsLocation": null,
    "termsLocationIdentifier": null,
    "printSet": [],
    "shipDate": null,
    "pickupTime": null,
    "deliveryDate": null,
    "deliveryTimeEarliest": null,
    "deliveryTimeLatest": null,
    "shipmentNo": null,
    "customsNo": null,
    "ediForward": false,
    "tplFormat": null,
    "pdfInsert": null,
    "deliveryInstruction": null,
    "customLabelText1": null,
    "customLabelText2": null,
    "customLabelText3": null,
    "customLabelText4": null,
    "customLabelText5": null,
    "customLabelText6": null,
    "service": {
        "id": "P19",
        "name": "PostNord MyPack Collect",
        "subId": null,
        "normalShipment": true,
        "returnShipment": null,
        "referenceAsBarcode": null,
        "labelType": null,
        "nonDeliveryType": null,
        "valueAmount": null,
        "valueCurrencyCode": null,
        "paymentMethodType": null,
        "sortPos": null,
        "destinationLocation": null,
        "notifyCode1": null,
        "notifyCode2": null,
        "notifyCode3": null,
        "bookingId": null,
        "bookingOffice": null,
        "infoCode": null,
        "contractVersion": null,
        "terminal": null,
        "handOverCode": null,
        "externalIdentifier": null,
        "waybillInvoice": null,
        "waybillEurCertificate": null,
        "waybillExportNotification": null,
        "waybillUnits332": null,
        "waybillWeight332": null,
        "waybillUnits334": null,
        "waybillWeight334": null,
        "waybillUnits336": null,
        "waybillWeight336": null,
        "waybillUnits342": null,
        "waybillWeight342": null,
        "waybillCod": null,
        "waybillCod342": null,
        "waybillHomeDelivery342": null,
        "shipperLoadAndCount": null,
        "pickupBooking": null,
        "pickupDate": null,
        "pickupTimeFrom": null,
        "pickupTimeTo": null,
        "pickupText1": null,
        "pickupMisc": null,
        "addons": [
            {
                "id": "NOTSMS",
                "amount": null,
                "account": null,
                "accountType": null,
                "bank": null,
                "currencyCode": null,
                "custNo": null,
                "custNoIssuerCode": null,
                "misc": "070000000",
                "miscType": null,
                "contact": null,
                "reference": null,
                "referenceType": null,
                "tempMin": null,
                "tempMax": null,
                "email": null,
                "text1": null,
                "text2": null,
                "text3": null,
                "text4": null,
                "text5": null,
                "text6": null,
                "text7": null,
                "text8": null,
                "text9": null,
                "text10": null,
                "length": null,
                "width": null,
                "declarant": null,
                "passengerFlight": false,
                "cargoFlight": false,
                "documentType": null,
                "date": null,
                "timeFrom": null,
                "timeTo": null,
                "handoverDate": null,
                "handoverTime": null,
                "confirmation": null,
                "confirmationMisc": null
            }
        ]
    },
    "parcels": [
        {
            "valuePerParcel": true,
            "copies": 1,
            "marking": null,
            "packageCode": null,
            "packageText": null,
            "weight": 1.2,
            "volume": null,
            "length": null,
            "width": null,
            "height": null,
            "loadingMeters": null,
            "itemNo": null,
            "contents": "important things",
            "stackable": null,
            "dangerousGoods": null,
            "reference": null,
            "customLabelText1": null,
            "customLabelText2": null,
            "customLabelText3": null,
            "customLabelText4": null,
            "customLabelText5": null,
            "customLabelText6": null,
            "parcelNos": null,
            "articles": [],
            "partOrderNo": null,
            "parcelCountStart": null,
            "parcelCountTotal": null
        }
    ],
    "customsDeclaration": null,
    "options": [
        {
            "id": "ENOT",
            "from": "email1@example.com",
            "to": "email2@example.com",
            "cc": null,
            "bcc": null,
            "errorTo": null,
            "message": "This is order number 123",
            "languageCode": "SE",
            "key": null,
            "sendEmail": null,
            "mailTemplate": null
        }
    ],
    "unitCode": null,
    "prepareId": "100012"
}

For testing the method, please refer to https://api.unifaun.com/rs-docs/ and navigate to /delivery-checkouts POST.

POST /prepared-shipments/{prepareId}/stored-shipments

This endpoint creates a stored shipment from a prepared shipment.

For a stored shipment to be created as 'ready' the values provided must fulfill the specific requirements of the shipment's service.

Endpoint

https://api.unifaun.com/rs-extapi/v1/prepared-shipments/

Authorization

Basic authentication using an API key or custom bearer token based on API key.

URI parameters

prepareId

Identification of the prepared shipment.

Query parameters

keepPreparedShipment

Should be set to "true" if the prepare ID should be used again.

Notice

"keepPreparedShipment" can be used, for example, if an order contains shipments that should be sent from different locations or if an item in the order is backordered.

Body example

{
  "sender": {
    "quickId": "1",
    "name": "Unifaun AB",
    "address1": "Skeppsbron 5-6",
    "zipcode": "41121",
    "city": "GÖTEBORG",
    "country": "SE",
    "phone": "+46 31 725 35 00",
    "email": "email1@example.com"
  },
  "receiver": {
    "name": "Unifaun AB",
    "address1": "Tegnérgatan 34",
    "zipcode": "11359",
    "city": "STOCKHOLM",
    "country": "SE",
    "phone": "+46 8 34 35 15",
    "email": "email2@example.com"
  },
  "parcels": [{
    "copies": "1",
    "weight": "37.5",
    "contents": "important things",
    "valuePerParcel": true
  }],
  "orderNo": "order number 123",
  "senderReference": "sender ref 234",
  "receiverReference": "receiver ref 345",
  "options": [{
    "message": "This is order number 123",
    "to": "email2@example.com",
    "id": "ENOT",
    "languageCode": "SE",
    "from": "email1@example.com"
  }]
} 

Response example

{
  "href": "https://api.unifaun.com/ufoweb-prod-202002111305/rs-extapi/v1/stored-shipments/4127538",
  "id": "4127538",
  "sndName": "Unifaun AB",
  "sndZipcode": "41121",
  "sndCity": "GÖTEBORG",
  "sndCountry": "SE",
  "rcvName": "Unifaun AB",
  "rcvZipcode": "11359",
  "rcvCity": "STOCKHOLM",
  "rcvCountry": "SE",
  "serviceId": "P15",
  "orderNo": "order number 123",
  "reference": "sender ref 234",
  "parcelCount": 1,
  "normalShipment": true,
  "returnShipment": false,
  "status": "READY",
  "shipDate": "2015-06-02T14:05:56.342+0000",
  "created": "2015-06-02T14:05:56.569+0000",
  "changed": "2015-06-02T14:05:56.569+0000",
  "statuses": [{
    "message": "maximum value (35) exceeded",
    "messageCode": "MaximumFlt",
    "field": "ParcelGroup_Weight",
    "location": "ParcelGroupWeight",
    "type": "ignorable"
  }]
}

For testing the method, please refer to https://api.unifaun.com/rs-docs/ and navigate to /prepare-shipments/stored-shipments POST.

POST /prepared-shipments/{prepareId}/shipments

This endpoint creates one or more shipments from a prepared shipment. Multiple shipments can be created if the stored shipment represent a combined normal and return shipment.

PDF or ZPL documents will be created according to the provided print configuration. By default the documents are returned as a URL. As an option the documents can be inline in the print objects in the result. By default the documents have to be requested from the URL contained in the href value of prints objects in the result. As an option the documents can be inline in the objects in the result.

Important

The generated documents will only be available for one hour.

Endpoint

https://api.unifaun.com/rs-extapi/v1/prepared-shipments/

Authorization

Basic authentication using an API key or custom bearer token based on API key.

URI parameters

prepareID

Identification of the prepared shipment.

Query parameters

returnFile

Should be set to 'true' if the PDF/ZPL file should be returned inline.

keepPreparedShipment

Should be set to 'true' if the prepare ID should be used again.

Notice

"keepPreparedShipment" is used, for example, if an order contains shipments that should be sent from different locations, if an item in the order is backordered or for a return service.

Body example

{
  "printConfig": {
    "target1Media": "thermo-250",
    "target1Type": "zpl",
    "target1XOffset": 0,
    "target1YOffset": 0,
    "target1Options": [{
      "key": "mode",
      "value": "DT"
    }],
    "target2Media": "laser-a4",
    "target2Type": "pdf",
    "target2XOffset": 0,
    "target2YOffset": 0,
    "target3Media": null,
    "target3Type": null,
    "target3XOffset": 0,
    "target3YOffset": 0,
    "target4Media": null,
    "target4Type": null,
    "target4XOffset": 0,
    "target4YOffset": 0
  },
  "shipment": {
    "parcels": [{
      "copies": "1",
      "weight": "2.75",
      "contents": "important things",
      "valuePerParcel": true
    }],
    "orderNo": "order number 123",
    "senderReference": "sender ref 234",
    "receiverReference": "receiver ref 345",
    "options": [{
      "message": "This is order number 123",
      "to": "email2@example.com",
      "id": "ENOT",
      "languageCode": "SE",
      "from": "email1@example.com"
    }]
  }
}

Response example

{
  "href": "https://api.unifaun.com/ufoweb-prod-202002111305/rs-extapi/v1/stored-shipments/4127538",
  "id": "4127538",
  "sndName": "Unifaun AB",
  "sndZipcode": "41121",
  "sndCity": "GÖTEBORG",
  "sndCountry": "SE",
  "rcvName": "Unifaun AB",
  "rcvZipcode": "11359",
  "rcvCity": "STOCKHOLM",
  "rcvCountry": "SE",
  "serviceId": "P15",
  "orderNo": "order number 123",
  "reference": "sender ref 234",
  "parcelCount": 1,
  "normalShipment": true,
  "returnShipment": false,
  "status": "READY",
  "shipDate": "2015-06-02T14:05:56.342+0000",
  "created": "2015-06-02T14:05:56.569+0000",
  "changed": "2015-06-02T14:05:56.569+0000",
  "statuses": [{
    "message": "maximum value (35) exceeded",
    "messageCode": "MaximumFlt",
    "field": "ParcelGroup_Weight",
    "location": "ParcelGroupWeight",
    "type": "ignorable"
  }]
}

For testing the method, please refer to https://api.unifaun.com/rs-docs/ and navigate to /prepare-shipments/stored-shipments POST.

GET /prepared-shipments/{prepareId}

This endpoint returns a prepared shipment that was previously created.

Endpoint

https://api.unifaun.com/rs-extapi/v1/delivery-checkouts/

Authorization

Basic authentication using an API key or custom bearer token based on API key.

URI parameters

prepareID

Identification of the prepared shipment.

Response example

{
  "sender": {
    "quickId": "1",
    "name": "Unifaun AB",
    "address1": "Skeppsbron 5-6",
    "zipcode": "41121",
    "city": "GÖTEBORG",
    "country": "SE",
    "phone": "+46 31 725 35 00",
    "email": "email1@example.com"
    },
    "senderPartners": [{
      "id": "PLAB",
      "custNo": "XX"
   }],
   "receiver": {
     "name": "Unifaun AB",
     "address1": "Tegnérgatan 34",
     "zipcode": "11359",
     "city": "STOCKHOLM",
     "country": "SE",
     "phone": "+46 8 34 35 15",
     "email": "email2@example.com"
   },
   "service": {
     "id": "P15"
   },
  "parcels": [{
    "copies": "1",
    "weight": "37.5",
    "contents": "important things",
    "valuePerParcel": true
  }],
  "orderNo": "order number 123",
  "senderReference": "sender ref 234",
  "receiverReference": "receiver ref 345",
  "options": [{
    "message": "This is order number 123",
    "to": "email2@example.com",
    "id": "ENOT",
    "languageCode": "SE",
    "from": "email1@example.com"
  }]
} 

For testing the method, please refer to https://api.unifaun.com/rs-docs/ and navigate to /prepared-shipments GET.

DELETE /prepared-shipments/{prepareId}

This endpoint deletes the prepared shipment from the system. No further operation will be possible on the ID of the prepared shipment.

Endpoint

https://api.unifaun.com/rs-extapi/v1/prepared-shipments/

Authorization

Basic authentication using an API key or custom bearer token based on API key.

URI parameters

prepareID

Identification of the prepared shipment.

No response body is returned when a prepared shipment is successfully deleted.

For testing the method, please refer to https://api.unifaun.com/rs-docs/ and navigate to /prepare-shipments/ DELETE.

POST /agents

This endpoint uploads custom agents.

Endpoint

https://api.unifaun.com/rs-extapi/v1/agents/

Authorization

Basic authentication using an API key or custom bearer token based on API key.

URI parameters - geolocation

key

Required.

activate

Required. Set to "true" if you want to activate the list at once.

countryCode

Required.

type

Set to "normal".

"mapLongitude"

Required.

"mapLatitude"

Required.

Body example

{
  "key": "test_geo",
  "activate": "true",
  "type": "normal",
  "countryCode": "SE",
  "agents": [{
    "id": "1",
    "name": "Agent name 1",
    "address1": "Test gatan 1",
    "address2": "",
    "zipcode": "41118",
    "city": "Göteborg",
    "state": "",
    "countryCode": "SE",
    "mapLongitude": "22.2",
    "mapLatitude": "11.1",
    "phone": "07443332211",
    "email": "test@test.com",
    "additionalInfo": "Additional information",
    "flags": ["express", "hem"],
    "openingHourWeekdays": [{
      "weekday": "monday",
        "hours": [{
          "start": "08:00",
          "stop": "22:00"
        }]
      },
      {
        "weekday": "tuesday",
        "hours": [{
          "start": "08:00",
          "stop": "22:00"
        }]
      },
      {
        "weekday": "wednesday",
        "hours": [{
          "start": "08:00",
          "stop": "22:00"
        }]
      },
      {
        "weekday": "thursday",
        "hours": [{
          "start": "08:00",
          "stop": "22:00"
        }]
      },
      {
        "weekday": "friday",
          "hours": [{
            "start": "08:00",
            "stop": "22:00"
          }]
      },
      {
        "weekday": "saturday",
        "hours": [{
          "start": "08:00",
          "stop": "22:00"
        }]
      },
      {
        "weekday": "sunday",
        "hours": [ {
          "start": "08:00",
          "stop": "22:00"
        }]
      }
      ],
      "openingHourSpecialDays": [{
        "date": "2018-04-27",
        "hours": [ {
          "start": "10:00",
          "stop": "16:00"
        }]
      },
      {
        "date": "2018-04-28",
        "hours": [ {
          "start": "10:00",
          "stop": "16:00"
        }]
      },
      {
        "date": "2018-10-10",
        "hours": [ {
          "start": "10:00",
          "stop": "16:00"
        }]
      }
      ]
    },
    {
    "id": "2",
    "name": "Agent name 2",
    "address1": "Testvägen 10",
    "address2": "",
    "zipcode": "11359",
    "city": "Stockholm",
    "state": "",
    "countryCode": "SE",
    "mapLongitude": "33.3",
    "mapLatitude": "17.4",
    "phone": "0700331122",
    "email": "test2@test2.com",
    "additionalInfo": "Additional information",
    "flags": ["hem"],
    "openingHourWeekdays": [{
      "weekday": "monday",
        "hours": [{
          "start": "10:00",
          "stop": "23:00"
        }]
      },
      {
        "weekday": "tuesday",
        "hours": [{
          "start": "10:00",
          "stop": "23:00"
        }]
      },
      {
        "weekday": "wednesday",
        "hours": [{
          "start": "10:00",
          "stop": "23:00"
        }]
      },
      {
        "weekday": "thursday",
        "hours": [{
          "start": "10:00",
          "stop": "23:00"
        }]
      },
      {
        "weekday": "friday",
          "hours": [{
          "start": "10:00",
          "stop": "23:00"
          }]
      },
      {
        "weekday": "saturday",
        "hours": [{
          "start": "10:00",
          "stop": "23:00"
        }]
      },
      {
        "weekday": "sunday",
        "hours": [ {
          "start": "10:00",
          "stop": "23:00"
        }]
      }
      ],
      "openingHourSpecialDays": [{
        "date": "2020-12-24",
        "hours": [ {
          "start": "10:00",
          "stop": "16:00"
        }]
      },
      {
        "date": "2020-12-25",
        "hours": [ {
          "start": "10:00",
          "stop": "16:00"
        }]
      },
      {
        "date": "2020-12-26",
        "hours": [ {
          "start": "10:00",
          "stop": "16:00"
        }]
      }
      ]
    }
  ]
}  

URI parameters - zip code

key

Required.

activate

Required. Set to "true" if you want to activate the list at once.

countryCode

Required.

type

Set to "zipcode".

agentZipcodes

Required for each agent.

Body example

{
  "key": "test_zipcode",
  "activate": "true",
  "type": "zipcode",
  "countryCode": "SE",
  "agents": [{
    "id": "1",
    "name": "Agent name 1",
    "address1": "Test gatan 1",
    "address2": "",
    "zipcode": "41118",
    "city": "Göteborg",
    "state": "",
    "countryCode": "SE",
    "mapLongitude": "22.2",
    "mapLatitude": "11.1",
    "phone": "07443332211",
    "email": "test@test.com",
    "additionalInfo": "Additional information",
    "flags": ["express", "hem"],
    "agentZipcodes": [ {
      "from": "40000",
      "to": "45000"  
    },
    {
      "from": "46000",
      "to": ""
    }
    ],
    "openingHourWeekdays": [{
      "weekday": "monday",
        "hours": [{
          "start": "08:00",
          "stop": "22:00"
        }]
      },
      {
        "weekday": "tuesday",
        "hours": [{
          "start": "08:00",
          "stop": "22:00"
        }]
      },
      {
        "weekday": "wednesday",
        "hours": [{
          "start": "08:00",
          "stop": "22:00"
        }]
      },
      {
        "weekday": "thursday",
        "hours": [{
          "start": "08:00",
          "stop": "22:00"
        }]
      },
      {
        "weekday": "friday",
          "hours": [{
            "start": "08:00",
            "stop": "22:00"
          }]
      },
      {
        "weekday": "saturday",
        "hours": [{
          "start": "08:00",
          "stop": "22:00"
        }]
      },
      {
        "weekday": "sunday",
        "hours": [ {
          "start": "08:00",
          "stop": "22:00"
        }]
      }
      ],
      "openingHourSpecialDays": [{
        "date": "2018-04-27",
        "hours": [ {
          "start": "10:00",
          "stop": "16:00"
        }]
      },
      {
        "date": "2018-04-28",
        "hours": [ {
          "start": "10:00",
          "stop": "16:00"
        }]
      },
      {
        "date": "2018-10-10",
        "hours": [ {
          "start": "10:00",
          "stop": "16:00"
        }]
      }
      ]
    }
  ]
}  

URI parameters - all

key

Required.

activate

Required. Set to "true" if you want to activate the list at once.

countryCode

Required.

type

Set to "normal".

Body example

{
  "key": "test_all",
  "activate": "true",
  "type": "normal",
  "countryCode": "SE",
  "agents": [{
    "id": "1",
    "name": "Agent name 1",
    "address1": "Test gatan 1",
    "address2": "",
    "zipcode": "41118",
    "city": "Göteborg",
    "state": "",
    "countryCode": "SE",
    "phone": "07443332211",
    "email": "test@test.com",
    "additionalInfo": "Additional information",
    "flags": ["express", "hem"],
    "openingHourWeekdays": [{
      "weekday": "monday",
        "hours": [{
          "start": "08:00",
          "stop": "22:00"
        }]
      },
      {
        "weekday": "tuesday",
        "hours": [{
          "start": "08:00",
          "stop": "22:00"
        }]
      },
      {
        "weekday": "wednesday",
        "hours": [{
          "start": "08:00",
          "stop": "22:00"
        }]
      },
      {
        "weekday": "thursday",
        "hours": [{
          "start": "08:00",
          "stop": "22:00"
        }]
      },
      {
        "weekday": "friday",
          "hours": [{
            "start": "08:00",
            "stop": "22:00"
          }]
      },
      {
        "weekday": "saturday",
        "hours": [{
          "start": "08:00",
          "stop": "22:00"
        }]
      },
      {
        "weekday": "sunday",
        "hours": [ {
          "start": "08:00",
          "stop": "22:00"
        }]
      }
      ],
      "openingHourSpecialDays": [{
        "date": "2018-04-27",
        "hours": [ {
          "start": "10:00",
          "stop": "16:00"
        }]
      },
      {
        "date": "2018-04-28",
        "hours": [ {
          "start": "10:00",
          "stop": "16:00"
        }]
      },
      {
        "date": "2018-10-10",
        "hours": [ {
          "start": "10:00",
          "stop": "16:00"
        }]
      }
      ]
    }
  ]
}  

Response example

For testing the method, please refer to https://api.unifaun.com/rs-docs/ and navigate to /agents POST.

Custom agents

You can add your own agents, e.g. physical stores by uploading custom agent lists.

There are three different ways of showing custom agents in your webshop.

  • Geolocation - Show custom agents within a certain area. When the list is posted the distance to the nearest custom agents is calculated for every zip code. For example, "20" means that agents within a radius of 20 km from a defined GPS coordinate are shown.

    Geolocation can only be used in Denmark (DK), Finland (FI), Norway (NO), Sweden (SE) and Åland (AX).

  • Zip code range - Show custom agents within one or several zip code ranges.

    Notice

    Update the lists on a regular basis to ensure that new zip codes are activated.

  • All - Show all custom agents available in a country.

Regardless of how you want to show the custom agents the following applies:

  • You activate the list on uploading or later in the delivery checkout configuration.

  • You have to create one list per country.

Upload custom agent lists.

Set up custom agents

When you have uploaded the lists you can activate or delete them in the UI. Go to Maintenance > Delivery checkout and click Agent lists.

Custom agents are added as a service connected to a delivery option or sublevel.

  1. Go to Maintenance > Delivery checkout.

  2. Click to the left of a delivery checkout or create a new delivery checkout.

  3. Depending on your set-up:

    • Click New option, if you want to add custom agents as a delivery option, and select "Delivery checkout - Custom agents" from the Service dropdown list.

    • Click to the left of a delivery option and New sublevel, if you want to add custom agents on sublevel, and select "Delivery checkout - Custom agents" from the Service dropdown list.

  4. Select an agent list from the Name (Key for the list) drop-down list.

  5. Enter a value in the Maximum radius (km) field if you want to show custom agents based on geolocation, otherwise it should be set to "0".

  6. With Maximum number of agents you can limit the number of agents that is shown based on geolocation. Max. 15 custom agents.

  7. Click New in the Prices section to add prices for the service.

    • In each currency section add the price to be displayed for each language, e.g. "€ 5", in en and the price as a numerical value, e.g. "5.0", in Price.

Neutral services

You can add neutral services, i.e. services from carriers without specific requirements.

If you have added a neutral carrier in Unifaun Online and assigned it a subId (service code) you can refer to that ID from your checkout.

Set up neutral services

Neutral services are added as a service connected to a delivery option or sublevel.

  1. Go to Maintenance > Delivery checkout.

  2. Click to the left of a delivery checkout or create a new delivery checkout.

  3. Depending on your set-up:

    • Click New option, if you want to add a neutral service as a delivery option, and select "Delivery checkout - Neutral" from the Service dropdown list.

    • Click to the left of a delivery option and New sublevel, if you want to add a neutral service on sublevel, and select "Delivery checkout - Neutral" from the Service dropdown list.

  4. Enter the carrier's subId (service code) for the service to be stored when creating the prepared shipment.

    Important

    If you do not enter the carrier's subId you have to post the service in a later call, before printing or storing the prepared shipment.

  5. Click New in the Prices section to add prices for the service.

    • In each currency section, add the price to be displayed for each language, e.g. "€ 5", in en ,and the price as a numerical value, e.g. "5.0", in Price.

  6. In the Addons section, click to the left of an addon you want to activate or edit.

    1. Check Preselected, Mandatory or both if the addon should be preselected and/or mandatory in the webshop.

    2. Click New in the Prices section to add prices for the addon.

      • In each currency section add the price to be displayed for each language, e.g. "€ 1", in en and the price as a numerical value, e.g. 1.0, in Price.

Widget

You can install the delivery checkout widget to graphically present the delivery options in your webshop.

Installation

To use the widget on a page the javascript file containing the widget code must be included. There are two possible javascript files to include. Both are UMD modules which means that they can be included either with a simple script tag or using a module loading system like RequireJS. The difference between the files is that one does not contain ReactJS and instead expects global variables window.React and window.ReactDOM to reference the react and react-dom modules respectively.

The javascript file without ReactJS can be accessed at:

https://api.unifaun.com/rs-extapi/v1/delivery-checkouts-widget/unifaun-checkout.min.js

The javascript file with all dependencies bundled can be accessed at:

https://api.unifaun.com/rs-extapi/v1/delivery-checkouts-widget/unifaun-checkout-all.min.js

Once one of the files has been included on the page you can access it depending on your method of inclusion. If you use a module loading system, refer to the standard way of accessing modules in that system. If you include the module with a script tag the module can be accessed through a global variable window.UnifaunCheckout.

Usage

To display the widget on a page and to get notified when a buyer makes choices in the widget, an instance of the widget must be created. An instance is created with the createAt function exported from the module.

var widget = UnifaunCheckout.createAt(containerElement, config;)

As argument containerElement pass an element selector as a string or a DOM element. The widget UI will be injected as a child to the containerElement.

The config argument must be a javascript object with any of these keys:

Key

Description

Type

Value

language

Language code for the language to be used in the UI

string

da, de, cs, en, es, et, fi, fr, it, nl, no, pl, ru, sv

useIcons

Use carrier logo icons or not

boolean

true, false

iconsInFront

Place carrier logo icons before the title and description of the delivery option. Otherwise after.

boolean

true, false

iconsBaseUrl

Base URL to use for carrier logo icon images.

string

Logos from Unifaun: rs-extapi/v1/delivery-checkouts-widget/logos

installCSS

Install standard CSS rules for the widget. The CSS rules will be inserted as a style tag at the start of the head tag.

string

false = No design

true = Design 1

unifaun = Design 2

unifaun-mp = Design 3

narrowDisplay

Toggle narrow display mode on. When on the widget layout will stack some UI elements vertically to work better on screens with low horizontal resolution.

boolean

true, false

narrowBreakpointWidth

The min. width of the widget element when narrow mode will be activated. If this value is supplied an event listener will be added to the window to track size changes.

number

ultraNarrowBreakpointWidth

The min. width of the widget element when ultra narrow mode will be activated.

number

resultCallback

Callback function that will be called whenever a buyer makes a selection or data entry in the widget UI.

function

enableMap

Enable an interactive map where the user can select a pickup point from a map interface.

Only visible if pickup points with valid latitude and longitude coordinates are available for the selected option.

boolean

true, false (default)

Once a widget instance has been created it can be used to control the widget. The methods available on the widget are:

Method

Description

installCSS()

Call this method to install the CSS rules.

uninstallCSS()

Call this method to remove the CSS rules from the page.

changeNarrowDisplay(narrow)

Call this method with a boolean argument to change the UI to, or from, narrow mode.

changeNarrowBreakpointWidth(narrowWidth, ultraNarrowWidth)

Call this method with the pixel width of the widget element when the widget UI should change to narrow mode. A second optional argument sets the pixel width of the widget element when ultra narrow mode should be activated.

checkWidthBreakpoints()

Call this method to let the widget check the width of its element and update, to or from, narrow/ultra narrow mode.

enable()

Call this method to enable the widget UI and allow users to change options.

disable()

Call this method to disable the widget UI and stop users from making changes.

updateList(optionsList)

Call this method with the result of a call to the /delivery-checkouts REST API. The optionsList object should contain the data to be displayed by the widget.

getResult

Call this method to get the result object last sent to the resultCallback.

setResult(result)

Call this method with a result object like the parameter to the resultCallback.The widget state will update to reflect the selections made in the result object.

Styling

A default style sheet can be injected into the page by setting the installCSS property in the widget configuration or by calling the installCSS method on the widget instance. The source of the injected style sheet in the form of a SASS file can be accessed at:

https://api.unifaun.com/rs-extapi/v1/delivery-checkouts-widget/unifaun-checkout.scs

User interaction

There are two types of user interaction that affect the widget:

  • External changes

  • Internal changes

External changes

When first created and every time the user makes changes to one of the input variables sent to the /delivery-checkouts API this sequence of actions should occur:

  • Disable the widget with a call to the disable method.

  • Make an AJAX request to the /delivery-checkouts API. The web shop backend will normally act as a proxy for this type of call so that a secret API key can be sent to the REST API.

  • When a response arrives, call the updateList method and then enable the widget with a call to the enable method.

// Disable widget while AJAX request is in progress.
widget.disable();
fetch(url).then(function(response) {
    return response.json();
}).then(function(data) {
    //Update the widget with new data.
    widget.updateList(data);
}).catch(function() {
    //Handle error
}).then(function() {
    //Always enable widget
    widget.enable();
});

Internal changes

Whenever the user selects one of the delivery checkout options or updates any value connected to the selected option, the resultCallback function in the widget configuration will be called. The callback function will receive a single argument in the form of a javascript object with the following properties:

Property

Description

Type

Value

valid

Indicates if the current values in the widget are all valid. Only if this is true should the user be able to proceed with the checkout.

boolean

true, false

deliveryCheckoutId

The delivery checkout ID including version.

string

 

selectedOptionId

The ID of the currently selected delivery option.

string

 

optionIds

An array of selected delivery checkout option ID:s from highest to lowest level.

string[]

 

price

The total price of all selected delivery options and addons

number

 

agent

The selected agent ID.

string

 

selectedAddons

An array of selected addons.

AddonResult[]

fields

An array of values for additional input related to the selected delivery option.

FieldResult[]