Ingrid [Draft]
Ingrid Delivery Platform connects retailers, carriers and consumers to create a better shopping experience for everyone.
IngridIngrid documentation
How to get started​
Contact Walley Merchant Services for help with the setup. Merchant Services will need your Ingrid API key.
Extending regular Walley API requests​
Walley checkout with Ingrid requires more information than a regular walley checkout. Below are examples of how to extend the regular Walley API requests to include the necessary information for Ingrid.
- Initilize checkout
- Update checkout
- Update cart
- Get checkout
/*
POST /checkouts HTTP/1.1
Host: api.uat.walleydev.com // (Please note! Different hostname in production)
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...
Content-Type: application/json
*/
{
...,
"cart": {
"items": [
{
"id": "10001",
"description": "A product description",
"unitPrice": 5.0,
"quantity": 1,
"vat": 25.0,
"requiresElectronicId": true,
"sku": "1111-111-1111",
"shipping": {
"tags": ["session-cart-item-tag"],
"unitWeight": 10.0,
"dimensions": {
"height": 10,
"length": 10,
"width": 10
},
"shippingInterval": {
"startDate": "2024-01-01T00:00:00",
"endDate": "2024-01-07T00:00:00",
"alternatives": [
{
"name": "alternative-name",
"shippingInterval": {
"startDate": "2024-01-01T00:00:00",
"endDate": "2024-01-07T00:00:00"
}
}
]
}
}
}
],
},
...,
"shipping": {
"tags": ["session-cart-tag"],
"shipments": [
{
"tags": ["session-shipment-tag"],
"id": "shipment-1",
"contents": [
{
"quantity": 1,
"sku": "1111-111-1111"
}
]
}
],
"shippingInterval": {
"startDate": "2024-01-01T00:00:00",
"endDate": "2024-01-07T00:00:00",
"alternatives": [
{
"name": "alternative-name",
"shippingInterval": {
"startDate": "2024-01-01T00:00:00",
"endDate": "2024-01-07T00:00:00"
}
}
]
}
},
...
}
/*
PUT /checkouts/1eec44b5-66d3-4058-a31f-3444229fb727/ HTTP/1.1
Host: api.uat.walleydev.com // (Please note! Different hostname in production)
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...
Content-Type: application/json
*/
{
"cart": [
{
"id": "10001",
"description": "A product description",
"unitPrice": 5.0,
"quantity": 1,
"vat": 25.0,
"requiresElectronicId": true,
"sku": "1111-111-1111",
"shipping": {
"tags": ["session-cart-item-tag"],
"unitWeight": 10,
"dimensions": {
"height": 10,
"length": 10,
"width": 10
},
"shippingInterval": {
"startDate": "2024-01-01T00:00:00",
"endDate": "2024-01-07T00:00:00",
"alternatives": [
{
"name": "alternative-name",
"shippingInterval": {
"startDate": "2024-01-01T00:00:00",
"endDate": "2024-01-07T00:00:00"
}
}
]
}
}
},
{
"id": "10002",
"description": "Item two",
"unitPrice": 2.0,
"quantity": 1,
"vat": 25.0,
"shipping": {
"tags": ["session-cart-item-tag"],
"unitWeight": 10.0,
"dimensions": {
"height": 10,
"length": 10,
"width": 10
},
"shippingInterval": {
"startDate": "2024-01-01T00:00:00",
"endDate": "2024-01-07T00:00:00",
"alternatives": [
{
"name": "alternative-name",
"shippingInterval": {
"startDate": "2024-01-01T00:00:00",
"endDate": "2024-01-07T00:00:00"
}
}
]
}
}
}
],
"shipping": {
"tags": ["session-cart-tag"],
"shipments": [
{
"tags": ["session-shipment-tag"],
"id": "shipment-1",
"contents": [
{
"quantity": 1,
"sku": "1111-111-1111"
}
]
},
{
"tags": ["session-shipment-tag"],
"id": "shipment-2",
"contents": [
{
"quantity": 1,
"sku": "10002"
}
]
},
],
"shippingInterval": {
"startDate": "2024-01-01T00:00:00",
"endDate": "2024-01-07T00:00:00",
"alternatives": [
{
"name": "alternative-name",
"shippingInterval": {
"startDate": "2024-01-01T00:00:00",
"endDate": "2024-01-07T00:00:00"
}
}
]
}
}
}
/*
PUT /checkouts/1eec44b5-66d3-4058-a31f-3444229fb727/cart HTTP/1.1
Host: api.uat.walleydev.com // (Please note! Different hostname in production)
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...
Content-Type: application/json
*/
{
"items": [
{
"id": "10001",
"description": "A product description",
"unitPrice": 5.0,
"quantity": 1,
"vat": 25.0,
"requiresElectronicId": true,
"sku": "1111-111-1111",
"shipping": {
"tags": ["session-cart-item-tag"],
"unitWeight": 10.0,
"dimensions": {
"height": 10,
"length": 10,
"width": 10
},
"shippingInterval": {
"startDate": "2024-01-01T00:00:00",
"endDate": "2024-01-07T00:00:00",
"alternatives": [
{
"name": "alternative-name",
"shippingInterval": {
"startDate": "2024-01-01T00:00:00",
"endDate": "2024-01-07T00:00:00"
}
}
]
}
}
},
{
"id": "10002",
"description": "Item two",
"unitPrice": 2.0,
"quantity": 1,
"vat": 25.0,
"shipping": {
"tags": ["session-cart-item-tag"],
"unitWeight": 10.0,
"dimensions": {
"height": 10,
"length": 10,
"width": 10
},
"shippingInterval": {
"startDate": "2024-01-01T00:00:00",
"endDate": "2024-01-07T00:00:00",
"alternatives": [
{
"name": "alternative-name",
"shippingInterval": {
"startDate": "2024-01-01T00:00:00",
"endDate": "2024-01-07T00:00:00"
}
}
]
}
}
}
]
}
/*
GET /checkouts/1eec44b5-66d3-4058-a31f-3444229fb727 HTTP/1.1
Host: api.uat.walleydev.com // (Please note! Different hostname in production)
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...
*/
/* Response example */
{
"id": "1eec44b5-66d3-4058-a31f-3444229fb727",
"data": {
"customer": { ... },
...,
"status": "PurchaseCompleted",
"order": {
"totalAmount": 2757,
"items": [
{
"id": "10001",
"description": "A product description",
"unitPrice": 5,
"quantity": 1,
"vat": 25,
"sku": "Item one sku"
},
{
"id": "10002",
"description": "Item two",
"unitPrice": 2,
"quantity": 1,
"vat": 25,
"sku": "Item two sku"
},
{
"id": "Frakt-1",
"description": "PostNord - MyPack Home",
"unitPrice": 100,
"quantity": 1,
"vat": 25
},
{
"id": "Frakt-2",
"description": "PostNord - MyPack Home",
"unitPrice": 100,
"quantity": 1,
"vat": 25
}
]
},
"shipping": {
"provider": "Ingrid",
"shippingFee": 210.0,
"shipments": [
{
"id": "shipment-1",
"externalShipmentId": "01GE6FJ2J52Z2NHRY17HDJ1977",
"feeItemId": "Frakt-1",
"metadata": {
"customerDeliveryPromise": {
"earliest": "2024-01-01T00:00:00",
"latest": "2024-01-07T00:00:00"
},
"carrierDeliveryPromise": {
"earliest": "2024-01-01T00:00:00",
"latest": "2024-01-07T00:00:00"
},
"pickupFromMerchant": {
"earliest": "2024-01-01T00:00:00",
"latest": "2024-01-07T00:00:00"
}
},
"shippingChoice": {
"id": "pnl",
"name": "PostNord - MyPack Home",
"fee": 100.0,
"metadata": null,
"destination": {
"id": "location-external-id",
"name": "Gothenburg",
"metadata": {
"address": {
"addressLines": ["Street 1", "Street 2"],
"apartmentNumber": "1",
"attn": "",
"careOf": "",
"city": "City",
"companyName": "Company name",
"country": "SE",
"firstName": "First Name",
"lastName": "Last Name",
"postalCode": "12345",
"region": "Region",
"street": "Street 1",
"streetNumber": "1"
}
}
}
}
},
{
"id": "shipment-2",
"externalShipmentId": "01GE6FJ2J5D3QHTD57XX0B38TS",
"feeItemId": "Frakt-2",
"metadata": { ... },
"shippingChoice": {
"id": "pnl",
"name": "PostNord - MyPack Home",
"fee": 100.0,
"metadata": { ... },
"destination": { ... },
"options": [
{
"id": "b225eaee-c31d-4c30-b6cf-1770f1d208cd",
"value": "express",
"fee": 10
}
]
}
}
]
},
...
}
}
Walley checkout cart items properties | Ingrid request properties |
---|---|
id | cart.items.sku (if sku is not present) |
description | cart.items.name |
unitPrice | cart.items.price |
quantity | cart.items.quantity |
sku | cart.items.sku |
shipping.tags | cart.items.attributes |
shipping.unitWeight | cart.items.weight |
shipping.dimensions | cart.items.dimensions |
shipping.shippingInterval.startDate | cart.items.shipping_date.start |
shipping.shippingInterval.endDate | cart.items.shipping_date.end |
shipping.shippingInterval.alternatives[].name | cart.items.shipping_date.category_tags.name |
shipping.shippingInterval.alternatives[].shippingInterval.startDate | cart.items.shipping_date.category_tags.shipping_data.start |
shipping.shippingInterval.alternatives[].shippingInterval.endDate | cart.items.shipping_date.category_tags.shipping_data.end |
Walley checkout cart shipping properties | Ingrid request properties |
---|---|
tags | cart.attributes |
shipments[].tags | cart.groups.attributes |
shipments[].id | cart.groups.group_id |
shipments[].contents[].sku | cart.groups.contents.sku |
shipments[].contents[].quantity | cart.groups.contents.quantity |
shippingInterval.startDate | cart.shipping_data.start |
shippingInterval.endDate | cart.shipping_data.end |
shippingInterval.alternatives[].name | cart.shipping_date.category_tags.name |
shippingInterval.alternatives[].shippingInterval.startDate | cart.shipping_date.category_tags.shipping_data.start |
shippingInterval.alternatives[].shippingInterval.endDate | cart.shipping_date.category_tags.shipping_data.end |
Walley checkout merchant response proeprties | Ingrid session response properties | Walley provided values |
---|---|---|
shipping.provider | - | Ingrid or FallbackMerchant |
shipping.shippingFee | - | Sum cost of all deliveries |
shipping.shipments[].id | session.delivery_groups.group_id | |
shipping.shipments[].externalShipmentId | session.delivery_groups.tos_id | |
shipping.shipments[].feeItemId | - | Id for the shipping fee item |
shipping.shipments[].metadata.customerDeliveryPromise.earliest | session.delivery_groups.delivery_time.customer_delivery_promise.earliest | |
shipping.shipments[].metadata.customerDeliveryPromise.latest | session.delivery_groups.delivery_time.customer_delivery_promise.latest | |
shipping.shipments[].metadata.carrierDeliveryPromise.earliest | session.delivery_groups.delivery_time.carrier_delivery_promise.earliest | |
shipping.shipments[].metadata.carrierDeliveryPromise.latest | session.delivery_groups.delivery_time.carrier_delivery_promise.latest | |
shipping.shipments[].metadata.pickupFromMerchant.earliest | session.delivery_groups.delivery_time.pickup_from_merchant.earliest | |
shipping.shipments[].metadata.pickupFromMerchant.latest | session.delivery_groups.delivery_time.pickup_from_merchant.latest | |
shipping.shipments[].shippingChoice.id | session.delivery_groups.shipping.carrier_product_id | |
shipping.shipments[].shippingChoice.name | session.delivery_groups.shipping.product (carrier used if product missing) | |
shipping.shipments[].shippingChoice.fee | session.delivery_groups.pricing.price / 100 | |
shipping.shipments[].shippingChoice.metadata | session.delivery_groups.shipping.meta | |
shipping.shipments[].shippingChoice.destination.id | session.delivery_groups.address.location.external_id | |
shipping.shipments[].shippingChoice.destination.name | session.delivery_groups.address.location.name | |
shipping.shipments[].shippingChoice.destination.metadata.address.addressLines | session.delivery_groups.address.location.address.addressLines | |
shipping.shipments[].shippingChoice.destination.metadata.address.apartmentNumber | session.delivery_groups.address.location.address.apartmentNumber | |
shipping.shipments[].shippingChoice.destination.metadata.address.attn | session.delivery_groups.address.location.address.attn | |
shipping.shipments[].shippingChoice.destination.metadata.address.careOf | session.delivery_groups.address.location.address.careOf | |
shipping.shipments[].shippingChoice.destination.metadata.address.city | session.delivery_groups.address.location.address.city | |
shipping.shipments[].shippingChoice.destination.metadata.address.companyName | session.delivery_groups.address.location.address.companyName | |
shipping.shipments[].shippingChoice.destination.metadata.address.country | session.delivery_groups.address.location.address.country | |
shipping.shipments[].shippingChoice.destination.metadata.address.firstName | session.delivery_groups.address.location.address.firstName | |
shipping.shipments[].shippingChoice.destination.metadata.address.lastName | session.delivery_groups.address.location.address.lastName | |
shipping.shipments[].shippingChoice.destination.metadata.address.postalCode | session.delivery_groups.address.location.address.postalCode | |
shipping.shipments[].shippingChoice.destination.metadata.address.region | session.delivery_groups.address.location.address.region | |
shipping.shipments[].shippingChoice.destination.metadata.address.street | session.delivery_groups.address.location.address.street | |
shipping.shipments[].shippingChoice.destination.metadata.address.streetNumber | session.delivery_groups.address.location.address.streetNumber | |
shipping.shipments[].shippingChoice.options[].id | session.delivery_groups[].shipping.delivery_addons[].id | |
shipping.shipments[].shippingChoice.options[].value | session.delivery_groups[].shipping.delivery_addons[].external_addon_id | |
shipping.shipments[].shippingChoice.options[].fee | session.delivery_groups[].shipping.pricing.price_components[].value |
Fallback strategy​
If, for any reasons, Walley Checkout does not receive any delivery methods from Ingrid, or if there is a problem with establishing an Ingrid session, there is a setting set by Merchant Services help@walley.se for your profile that will decide if the purchase should be stopped or not.
- true: We will show an error and stop the purchase if we cannot create an ingrid session, or fetch at least one valid delivery method.
- false: We will allow the customer to complete the purchase, with a fallback shipping cost. This fallback fee amount can be set when initializing the checkout session using the
fees.shipping
property. If not set then the default is zero.
Client-side event​
A client side event is sent every time the delivery method information is changed. This event can be used to display the most recent delivery information outside Walley Checkout. When this event is received, the information can be fetched by Acquire Checkout Information in the data.shipping
object.
// Start listening to the shipping updated event
document.addEventListener("walleyCheckoutShippingUpdated", listener);