Documentation

SIW API

Overview

Note

All of the examples below are HTTP requests that can be roughly translated to the generated client method calls. The main goal is to get the overall feeling of the API and the data flows.

SIW is responsible for maintaining life cycle of a session that has all the data needed by the shipping selector widget. When a user visits checkout page, makes any changes to cart contents, selects shipping options and completes a purchase, all the relevant data are stored in the session.

Every session contains result field which provides information about currently selected delivery option. It contains all important information like:

Result field should be used in integration to get final result of session. The example result looks as follows:

{
"session": {
"result": {
"shipping": {
"shipping_method": "pnl-mpc",
"delivery_type": "pickup",
"carrier": "PostNord",
"product": "MyPack Collect",
"location": {
"external_id": "586287",
"name": "Direkten Sveavägen",
"address": {
"name": "Direkten Sveavägen",
"address_lines": ["Sveavägen 137"],
"city": "Stockholm",
"postal_code": "11346",
"country": "SE",
"coordinates": {
"lat": 59.34909509999998,
"lng": 18.050284299999994
}
},
"distance": {
"walking": {
"value": 450,
"duration": 5
},
"driving": {
"value": 771,
"duration": 1
}
},
"operational_hours": {
"mon": "08:00-20:00",
"tue": "08:00-20:00",
"wed": "08:00-20:00",
"thu": "08:00-20:00",
"fri": "08:00-20:00",
"sat": "09:00-17:00",
"sun": "10:00-16:00"
}
},
"delivery_time": {
"id": "VMzp-Ei2Lx7PAbmQMbnbFg",
"expires": "2019-07-04T15:00:00+02:00",
"start": "2019-07-05T00:00:00+02:00",
"end": "2019-07-09T00:00:00+02:00"
},
"external_method_id": "pnl-mypack",
"supports": {}
},
"category": {
"id": "category-pickup",
"name": "Category Pickup"
},
"pricing": {
"currency": "SEK",
"price": 1900
}
}
}
}

Create Session

The session.create method is used to create a new session. It returns the newly created Session as well as a html_snippet that can be embedded in the checkout page. Session can be created with minimal set of properties - purchase_country, purchase_currency, locale and cart.

SIW also supports embedding multiple widgets on a single page, see Multiple widgets.

Generic Flow

The sequence diagram below describes the flow between the Customer, Merchant, Shipping Selector and SIW API when creating a new session and rendering shipping selector for that session onto the checkout page.

sequenceDiagram participant C as Customer participant M as Merchant participant A as SIW API C->>M: Load checkout page M->>A: Create new session A->>M: Return shipping selector html snippet and session state M->>C: Render shipping selector html snippet on the page
  1. Customer loads the checkout page
  2. Merchant calls the session.create method
  3. SIW returns a new Session and the html_snippet needed to render the shipping selector.
  4. Merchant renders html_snippet on the page.

A minimal set of fields required to create a session is purchase_country, purchase_currency, locale and cart. A new session is returned along with an identifier and a token for authorization.

Note

We support Canada and United States regions, such as states and army regions that can be passed in the address (and on which the filtering of configured shipping methods can be done).

Supported Languages

The following locales are supported:

Example Calls

Request

POST /v1/siw/session.create HTTP/1.1
Host: api.ingrid.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer base64-encoded-api-token

{
"purchase_country": "SE",
"purchase_currency": "SEK",
"locales": [
"sv-SE"
],
"search_address": {
"postal_code": "11239",
"country": "SE"
},
"cart": {
"cart_id": "unique_id",
"total_value": 129900,
"currency": "SEK",
"items": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": 1,
"attributes": [
"shoes",
"indigo",
"class_one"
]
}
]
}
}

Response

HTTP/1.1 200 OK
Date: Tue, 17 Jan 2023 14:26:02 GMT
Content-Type: application/json
Content-Length: 311
Connection: close
Vary: Accept-Encoding
x-trace-id: S20220729090834D2MFFTS52PH1H9W0

{
"session": {
"id": "6a687afe-0ef8-4d6b-af3e-93ad373055ee",
"status": "ACTIVE",
"cart": {
"total_value": 129900,
"total_discount": 0,
"currency": "SEK",
"pre_order": false,
"items": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"attributes": [
"shoes",
"indigo",
"class_one"
],
"out_of_stock": false,
"quantity": 1,
"price": 0
}
],
"cart_id": "unique_id"
},
"selected_shipping_option": {
"shipping_method": "dummy-std",
"delivery_type": "pickup",
"carrier": "Dummy",
"product": "Dummy Product",
"price": 1000,
"currency": "SEK",
"location": {
"external_id": "loc-1",
"name": "41:an City Tobak",
"address": {
"name": "41:an City Tobak",
"address_lines": [
"Sankt Eriksgatan 41"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE",
"coordinates": {
"lat": 59.333978,
"lng": 18.031931
}
},
"distance": {
"walking": {
"value": 333,
"duration": 4
},
"driving": {
"value": 959,
"duration": 3
}
},
"operational_hours": {
"mon": "08:00-16:00",
"tue": "08:00-16:00",
"wed": "08:00-16:00",
"thu": "08:00-16:00",
"fri": "08:00-16:00"
},
"location_type": "POSTOFFICE"
},
"time_slot": {
"id": "0aSwec10To3F9zASJGpDQg",
"expires": "2023-01-18T15:00:00+01:00",
"start": "2023-01-19T15:00:00+01:00",
"end": "2023-01-19T15:00:00+01:00"
}
},
"shipping_price": 1000,
"expires_at": "2023-01-18T15:00:00+01:00",
"search_address": {
"postal_code": "11239",
"country": "SE",
"coordinates": {
"lat": 59.33122199302237,
"lng": 18.030565761645196
}
},
"result": {
"shipping": {
"shipping_method": "dummy-std",
"delivery_type": "pickup",
"carrier": "Dummy",
"product": "Dummy Product",
"location": {
"external_id": "loc-1",
"name": "41:an City Tobak",
"address": {
"name": "41:an City Tobak",
"address_lines": [
"Sankt Eriksgatan 41"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE",
"coordinates": {
"lat": 59.333978,
"lng": 18.031931
}
},
"distance": {
"walking": {
"value": 333,
"duration": 4
},
"driving": {
"value": 959,
"duration": 3
}
},
"operational_hours": {
"mon": "08:00-16:00",
"tue": "08:00-16:00",
"wed": "08:00-16:00",
"thu": "08:00-16:00",
"fri": "08:00-16:00"
},
"location_type": "POSTOFFICE"
},
"delivery_time": {
"id": "0aSwec10To3F9zASJGpDQg",
"expires": "2023-01-18T15:00:00+01:00",
"start": "2023-01-19T15:00:00+01:00",
"end": "2023-01-19T15:00:00+01:00"
},
"supports": {},
"warehouse": {
"address": {
"name": "Snowball AB",
"address_lines": [
"Storvägen 19"
],
"city": "Kvikkjokk",
"postal_code": "96202",
"country": "SE",
"coordinates": {}
}
}
},
"category": {
"id": "category-delivery",
"name": "Dummy pickup",
"presented_category_name": "Dummy pickup"
},
"pricing": {
"currency": "SEK",
"price": 1000,
"price_components": [
{
"type": "PRICE_COMPONENT_TYPE_SHIPPING",
"value": 1000
}
]
},
"selection": "PRESELECTED_CHOICE",
"delivery_time": {
"pickup_from_merchant": {
"earliest": "2023-01-18T15:00:00+01:00",
"latest": "2023-01-18T15:00:00+01:00"
},
"customer_delivery_promise": {
"earliest": "2023-01-19T15:00:00+01:00",
"latest": "2023-01-19T15:00:00+01:00"
},
"carrier_delivery_promise": {
"earliest": "2023-01-19T15:00:00+01:00",
"latest": "2023-01-19T15:00:00+01:00"
}
}
}
},
"html_snippet": "<div id=\"shipwallet-container\"> ... </div>"
}

Update Session

The session.update method can be used to update the Cart or Customer of the session if needed. You can updated either Cart, Customer or both at the same time.

There are two flows that should be used when it comes to updating the session.

  1. When customer changes the shipping option
  2. When cart contents change

Generic flow when customer changes shipping option

The sequence diagram below describes the flow between the Customer, Merchant, Shipping Selector and SIW API when updating a session. In this scenario shipping selector is the master so there is no need to suspend it.

sequenceDiagram participant C as Customer participant SS as Shipping Selector participant CO as Checkout participant M as Merchant participant A as SIW API C->>SS: Change the shipping option SS->>CO: Fire option changed JS event CO->>M: Do Ajax call to backend M->>A: Call /session.get A->>M: Return Session state M->>M: Update order with new shipping cost M->>CO: Return new shipping cost CO->>CO: Update total cost CO->>C: Show new total
  1. Customer changes shipping option
  2. Merchant is notified via JS event subscription
  3. Merchant makes the Ajax call to its backend
  4. Merchant fetches Ingrid Session using session.get and extracts the shipping cost
  5. Merchant updates its order data in the backend
  6. Merchant completes Ajax call and returns updated shipping cost
  7. Merchant updates total cart cost with newly updated shipping cost

Generic flow when cart contents change

The sequence diagram below describes the flow between the Customer, Merchant, Shipping Selector and SIW API when updating a session and checkout page is master.

sequenceDiagram participant C as Customer participant SS as Shipping Selector participant CO as Checkout participant M as Merchant participant A as SIW API C->>CO: Update cart CO->>SS: Suspend CO->>M: Ajax call to backend M->>A: Call /session.update A->>M: Return updated session state M->>M: Update order with updated shipping cost M->>CO: Return Ajax call CO->>CO: Update cart and totals CO->>SS: Resume shipping selector SS->>M: Refresh state A->>SS: Return updated state SS->>C: Display fresh shipping options
  1. Put shipping selector in suspend mode using the Javascript API
  2. Call Merchant backend to make the change, for example remove item from the cart.
  3. Apply the update to the Session using the session.update call
  4. Updated session is returned
  5. Merchant update order with updated shipping cost
  6. Complete the Ajax call in the checkout
  7. Resume shipping selector using the Javascript API
  8. Shipping selector will then refresh its state

Example Calls

Request

POST /v1/siw/session.update HTTP/1.1
Host: api.ingrid.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer base64-encoded-api-token

{
"id": "6a687afe-0ef8-4d6b-af3e-93ad373055ee",
"cart": {
"cart_id": "unique_id",
"total_value": 274800,
"currency": "SEK",
"items": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": 1,
"price": 129900,
"attributes": [
"shoes",
"indigo",
"class_one"
]
},
{
"sku": "SKU65432",
"name": "Michigan Coat XL",
"quantity": 1,
"price": 144900,
"attributes": [
"tops",
"spring_campaign"
]
}
]
}
}

Response

HTTP/1.1 200 OK
Date: Tue, 17 Jan 2023 14:26:03 GMT
Content-Type: application/json
Content-Length: 357
Connection: close
Vary: Accept-Encoding
x-trace-id: S20220729090835PJWTGA8BAD6QMP31

{
"session": {
"id": "6a687afe-0ef8-4d6b-af3e-93ad373055ee",
"status": "ACTIVE",
"cart": {
"total_value": 274800,
"total_discount": 0,
"currency": "SEK",
"pre_order": false,
"items": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"attributes": [
"shoes",
"indigo",
"class_one"
],
"out_of_stock": false,
"quantity": 1,
"price": 129900
},
{
"sku": "SKU65432",
"name": "Michigan Coat XL",
"attributes": [
"tops",
"spring_campaign"
],
"out_of_stock": false,
"quantity": 1,
"price": 144900
}
],
"cart_id": "unique_id"
},
"selected_shipping_option": {
"shipping_method": "dummy-std",
"delivery_type": "pickup",
"carrier": "Dummy",
"product": "Dummy Product",
"price": 1000,
"currency": "SEK",
"location": {
"external_id": "loc-1",
"name": "41:an City Tobak",
"address": {
"name": "41:an City Tobak",
"address_lines": [
"Sankt Eriksgatan 41"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE",
"coordinates": {
"lat": 59.333978,
"lng": 18.031931
}
},
"distance": {
"walking": {
"value": 333,
"duration": 4
},
"driving": {
"value": 959,
"duration": 3
}
},
"operational_hours": {
"mon": "08:00-16:00",
"tue": "08:00-16:00",
"wed": "08:00-16:00",
"thu": "08:00-16:00",
"fri": "08:00-16:00"
},
"location_type": "POSTOFFICE"
},
"time_slot": {
"id": "0aSwec10To3F9zASJGpDQg",
"expires": "2023-01-18T15:00:00+01:00",
"start": "2023-01-19T15:00:00+01:00",
"end": "2023-01-19T15:00:00+01:00"
}
},
"shipping_price": 1000,
"expires_at": "2023-01-18T15:00:00+01:00",
"search_address": {
"postal_code": "11239",
"country": "SE",
"coordinates": {
"lat": 59.33122199302237,
"lng": 18.030565761645196
}
},
"result": {
"shipping": {
"shipping_method": "dummy-std",
"delivery_type": "pickup",
"carrier": "Dummy",
"product": "Dummy Product",
"location": {
"external_id": "loc-1",
"name": "41:an City Tobak",
"address": {
"name": "41:an City Tobak",
"address_lines": [
"Sankt Eriksgatan 41"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE",
"coordinates": {
"lat": 59.333978,
"lng": 18.031931
}
},
"distance": {
"walking": {
"value": 333,
"duration": 4
},
"driving": {
"value": 959,
"duration": 3
}
},
"operational_hours": {
"mon": "08:00-16:00",
"tue": "08:00-16:00",
"wed": "08:00-16:00",
"thu": "08:00-16:00",
"fri": "08:00-16:00"
},
"location_type": "POSTOFFICE"
},
"delivery_time": {
"id": "0aSwec10To3F9zASJGpDQg",
"expires": "2023-01-18T15:00:00+01:00",
"start": "2023-01-19T15:00:00+01:00",
"end": "2023-01-19T15:00:00+01:00"
},
"supports": {},
"warehouse": {
"address": {
"name": "Snowball AB",
"address_lines": [
"Storvägen 19"
],
"city": "Kvikkjokk",
"postal_code": "96202",
"country": "SE",
"coordinates": {}
}
}
},
"category": {
"id": "category-delivery",
"name": "Dummy pickup",
"presented_category_name": "Dummy pickup"
},
"pricing": {
"currency": "SEK",
"price": 1000,
"price_components": [
{
"type": "PRICE_COMPONENT_TYPE_SHIPPING",
"value": 1000
}
]
},
"selection": "PRESELECTED_CHOICE",
"delivery_time": {
"pickup_from_merchant": {
"earliest": "2023-01-18T15:00:00+01:00",
"latest": "2023-01-18T15:00:00+01:00"
},
"customer_delivery_promise": {
"earliest": "2023-01-19T15:00:00+01:00",
"latest": "2023-01-19T15:00:00+01:00"
},
"carrier_delivery_promise": {
"earliest": "2023-01-19T15:00:00+01:00",
"latest": "2023-01-19T15:00:00+01:00"
}
}
}
},
"html_snippet": "<div id=\"shipwallet-container\"> ... </div>"
}
Note

The difference between the search address and the customer address is that the first one simply points us to which area package should be delivered, but it doesn't need to be customer real address. The customer address must be provided by the merchant.

For example, if you want to have a package delivered close to your work, you can fill search address with your office address. The customer is a customer home address. It allows performing fraud detection if someone is ordering an expensive item and customer and search addresses are distant to each other. The merchant could compare both addresses and verify if the order is valid by contacting the customer before shipping goods.

Complete Session

The session.complete method is used to mark a session as complete. At this point, if the customer haven't made a choice we'll generate one for the customer based on the information in the Customer property provided in the request.

::: tip Search address and customer address are two different entities, that serve separate purposes during session lifetime. Search address is provided by the customer and the customer address is always provided by merchant. Search address is used to generate the shipping options that will be presented to the customer. Customer address is the address where the parcel will be sent and should be provided sometime during session lifetime (at the latest during session.complete).

Shipping options may be regenerated under some conditions when the customer address is provided and it differs from the search address. :::

The sequence diagram below describes the flow between the Customer, Merchant, Shipping Selector and SIW API when completing a session when the customer checkout.

sequenceDiagram participant C as Customer participant M as Merchant participant A as SIW API C->>M: Completes the order M->>A: Call /session.complete A->>M: Return completed session state M->>C: Redirects to confirmation page
  1. Customer completes the transaction
  2. Merchant completes the session using session.complete method
  3. SIW API returns session in a completed state. The SelectedShippingOption and tos_id are also returned.
  4. Merchant redirects the customer to the confirmation page

On session complete call a tos_id will be returned. This id is important if you need to re-open a session as a completed session is "frozen" and cannot be modified. You can use tos_id to clone a completed session.

Example Calls

Request

POST /v1/siw/session.complete HTTP/1.1
Host: api.ingrid.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer base64-encoded-api-token

{
"id": "6a687afe-0ef8-4d6b-af3e-93ad373055ee",
"customer": {
"email": "erik@ingrid.com",
"phone": "0709997711",
"address": {
"name": "Erik Johansson",
"address_lines": [
"Industrigatan 5"
],
"city": "Stockholm",
"postal_code": "11239",
"country": "SE"
}
}
}

Response

HTTP/1.1 200 OK
Date: Tue, 17 Jan 2023 14:26:03 GMT
Content-Type: application/json
Content-Length: 233
Connection: close
Vary: Accept-Encoding
x-trace-id: S20220729090835FA6HZX4EWMSKNSZM

{
"session": {
"id": "6a687afe-0ef8-4d6b-af3e-93ad373055ee",
"status": "COMPLETE",
"cart": {
"total_value": 274800,
"total_discount": 0,
"currency": "SEK",
"pre_order": false,
"items": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"attributes": [
"shoes",
"indigo",
"class_one"
],
"out_of_stock": false,
"quantity": 1,
"price": 129900
},
{
"sku": "SKU65432",
"name": "Michigan Coat XL",
"attributes": [
"tops",
"spring_campaign"
],
"out_of_stock": false,
"quantity": 1,
"price": 144900
}
],
"cart_id": "unique_id"
},
"selected_shipping_option": {
"shipping_method": "dummy-std",
"delivery_type": "pickup",
"carrier": "Dummy",
"product": "Dummy Product",
"price": 1000,
"currency": "SEK",
"location": {
"external_id": "loc-1",
"name": "41:an City Tobak",
"address": {
"name": "41:an City Tobak",
"address_lines": [
"Sankt Eriksgatan 41"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE",
"coordinates": {
"lat": 59.333978,
"lng": 18.031931
}
},
"distance": {
"walking": {
"value": 333,
"duration": 4
},
"driving": {
"value": 959,
"duration": 3
}
},
"operational_hours": {
"mon": "08:00-16:00",
"tue": "08:00-16:00",
"wed": "08:00-16:00",
"thu": "08:00-16:00",
"fri": "08:00-16:00"
},
"location_type": "POSTOFFICE"
},
"time_slot": {
"id": "0aSwec10To3F9zASJGpDQg",
"expires": "2023-01-18T15:00:00+01:00",
"start": "2023-01-19T15:00:00+01:00",
"end": "2023-01-19T15:00:00+01:00"
}
},
"shipping_price": 1000,
"expires_at": "2023-01-18T15:00:00+01:00",
"customer": {
"address": {
"name": "Erik Johansson",
"address_lines": [
"Industrigatan 5"
],
"city": "Stockholm",
"postal_code": "11239",
"country": "SE"
},
"phone": "0709997711",
"email": "erik@ingrid.com"
},
"search_address": {
"postal_code": "11239",
"country": "SE",
"coordinates": {
"lat": 59.33122199302237,
"lng": 18.030565761645196
}
},
"tos_id": "01GQ01YVGYXKNEX6AF08QQ1KR0",
"result": {
"shipping": {
"shipping_method": "dummy-std",
"delivery_type": "pickup",
"carrier": "Dummy",
"product": "Dummy Product",
"location": {
"external_id": "loc-1",
"name": "41:an City Tobak",
"address": {
"name": "41:an City Tobak",
"address_lines": [
"Sankt Eriksgatan 41"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE",
"coordinates": {
"lat": 59.333978,
"lng": 18.031931
}
},
"distance": {
"walking": {
"value": 333,
"duration": 4
},
"driving": {
"value": 959,
"duration": 3
}
},
"operational_hours": {
"mon": "08:00-16:00",
"tue": "08:00-16:00",
"wed": "08:00-16:00",
"thu": "08:00-16:00",
"fri": "08:00-16:00"
},
"location_type": "POSTOFFICE"
},
"delivery_time": {
"id": "0aSwec10To3F9zASJGpDQg",
"expires": "2023-01-18T15:00:00+01:00",
"start": "2023-01-19T15:00:00+01:00",
"end": "2023-01-19T15:00:00+01:00"
},
"supports": {},
"warehouse": {
"address": {
"name": "Snowball AB",
"address_lines": [
"Storvägen 19"
],
"city": "Kvikkjokk",
"postal_code": "96202",
"country": "SE",
"coordinates": {}
}
}
},
"category": {
"id": "category-delivery",
"name": "Dummy pickup",
"presented_category_name": "Dummy pickup"
},
"pricing": {
"currency": "SEK",
"price": 1000,
"price_components": [
{
"type": "PRICE_COMPONENT_TYPE_SHIPPING",
"value": 1000
}
]
},
"selection": "PRESELECTED_CHOICE",
"delivery_time": {
"pickup_from_merchant": {
"earliest": "2023-01-18T15:00:00+01:00",
"latest": "2023-01-18T15:00:00+01:00"
},
"customer_delivery_promise": {
"earliest": "2023-01-19T15:00:00+01:00",
"latest": "2023-01-19T15:00:00+01:00"
},
"carrier_delivery_promise": {
"earliest": "2023-01-19T15:00:00+01:00",
"latest": "2023-01-19T15:00:00+01:00"
}
}
}
},
"tos_id": "01GQ01YVGYXKNEX6AF08QQ1KR0"
}
  1. Customer loads the checkout page
  2. Merchant calls the session.get method
  3. SIW API returns a new Session and the html_snippet to render shipping selector
  4. Merchant renders html_snippet in the checkout page

Get Session

The session.get method is used to get session details.

Example Calls

Request

GET /v1/siw/session.get?id=6a687afe-0ef8-4d6b-af3e-93ad373055ee HTTP/1.1
Host: api.ingrid.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer base64-encoded-api-token


Response

HTTP/1.1 200 OK
Date: Tue, 17 Jan 2023 14:26:03 GMT
Content-Type: application/json

Connection: close
Vary: Accept-Encoding
x-trace-id: S202301171426033AN573Q4D6PFYGE8

{
"session": {
"id": "6a687afe-0ef8-4d6b-af3e-93ad373055ee",
"status": "COMPLETE",
"cart": {
"total_value": 274800,
"total_discount": 0,
"currency": "SEK",
"pre_order": false,
"items": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"attributes": [
"shoes",
"indigo",
"class_one"
],
"out_of_stock": false,
"quantity": 1,
"price": 129900
},
{
"sku": "SKU65432",
"name": "Michigan Coat XL",
"attributes": [
"tops",
"spring_campaign"
],
"out_of_stock": false,
"quantity": 1,
"price": 144900
}
],
"cart_id": "unique_id"
},
"selected_shipping_option": {
"shipping_method": "dummy-std",
"delivery_type": "pickup",
"carrier": "Dummy",
"product": "Dummy Product",
"price": 1000,
"currency": "SEK",
"location": {
"external_id": "loc-1",
"name": "41:an City Tobak",
"address": {
"name": "41:an City Tobak",
"address_lines": [
"Sankt Eriksgatan 41"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE",
"coordinates": {
"lat": 59.333978,
"lng": 18.031931
}
},
"distance": {
"walking": {
"value": 333,
"duration": 4
},
"driving": {
"value": 959,
"duration": 3
}
},
"operational_hours": {
"mon": "08:00-16:00",
"tue": "08:00-16:00",
"wed": "08:00-16:00",
"thu": "08:00-16:00",
"fri": "08:00-16:00"
},
"location_type": "POSTOFFICE"
},
"time_slot": {
"id": "0aSwec10To3F9zASJGpDQg",
"expires": "2023-01-18T15:00:00+01:00",
"start": "2023-01-19T15:00:00+01:00",
"end": "2023-01-19T15:00:00+01:00"
}
},
"shipping_price": 1000,
"expires_at": "2023-01-18T15:00:00+01:00",
"customer": {
"address": {
"name": "Erik Johansson",
"address_lines": [
"Industrigatan 5"
],
"city": "Stockholm",
"postal_code": "11239",
"country": "SE"
},
"phone": "0709997711",
"email": "erik@ingrid.com"
},
"search_address": {
"postal_code": "11239",
"country": "SE",
"coordinates": {
"lat": 59.33122199302237,
"lng": 18.030565761645196
}
},
"tos_id": "01GQ01YVGYXKNEX6AF08QQ1KR0",
"result": {
"shipping": {
"shipping_method": "dummy-std",
"delivery_type": "pickup",
"carrier": "Dummy",
"product": "Dummy Product",
"location": {
"external_id": "loc-1",
"name": "41:an City Tobak",
"address": {
"name": "41:an City Tobak",
"address_lines": [
"Sankt Eriksgatan 41"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE",
"coordinates": {
"lat": 59.333978,
"lng": 18.031931
}
},
"distance": {
"walking": {
"value": 333,
"duration": 4
},
"driving": {
"value": 959,
"duration": 3
}
},
"operational_hours": {
"mon": "08:00-16:00",
"tue": "08:00-16:00",
"wed": "08:00-16:00",
"thu": "08:00-16:00",
"fri": "08:00-16:00"
},
"location_type": "POSTOFFICE"
},
"delivery_time": {
"id": "0aSwec10To3F9zASJGpDQg",
"expires": "2023-01-18T15:00:00+01:00",
"start": "2023-01-19T15:00:00+01:00",
"end": "2023-01-19T15:00:00+01:00"
},
"supports": {},
"warehouse": {
"address": {
"name": "Snowball AB",
"address_lines": [
"Storvägen 19"
],
"city": "Kvikkjokk",
"postal_code": "96202",
"country": "SE",
"coordinates": {}
}
}
},
"category": {
"id": "category-delivery",
"name": "Dummy pickup",
"presented_category_name": "Dummy pickup"
},
"pricing": {
"currency": "SEK",
"price": 1000,
"price_components": [
{
"type": "PRICE_COMPONENT_TYPE_SHIPPING",
"value": 1000
}
]
},
"selection": "PRESELECTED_CHOICE",
"delivery_time": {
"pickup_from_merchant": {
"earliest": "2023-01-18T15:00:00+01:00",
"latest": "2023-01-18T15:00:00+01:00"
},
"customer_delivery_promise": {
"earliest": "2023-01-19T15:00:00+01:00",
"latest": "2023-01-19T15:00:00+01:00"
},
"carrier_delivery_promise": {
"earliest": "2023-01-19T15:00:00+01:00",
"latest": "2023-01-19T15:00:00+01:00"
}
}
}
},
"html_snippet": "<div id=\"shipwallet-container\"> ... </div>"
}

Errors

Concurrent updates

Session get, update and complete calls can fail when another concurrent call is made, that updates the session resource. In that case, the response to this call would be a message with HTTP 409 Conflict code, and the call would have to be made again.

Last updated: Fri, Apr 19, 06:15 AM