Documentation
Feedback
Guides

Displaying SLA by item in Checkout

This guide describes how to display individual shipping estimates for items in a customer's cart on an ecommerce platform using the Checkout API.

To enhance the customer experience, some stores may want to display precise shipping estimates for each item in the customer's cart. This can be particularly useful for ecommerce platforms that have sellers with different shipping capabilities and delivery times. This guide will walk through the process of displaying the Service Level Agreement (SLA) by item using the Checkout API.

Enable the useIndividualShippingEstimates flag

First, it is necessary to enable the Checkout API behavior to fill the shippingEstimateDate with the SLA information. To do so, you must update the store's orderForm with the Update orderForm configuration endpoint. You must include the flag useIndividualShippingEstimates to true as in the example shown.

Request

_24
{
_24
"paymentConfiguration": {
_24
...
_24
},
_24
"taxConfiguration": null,
_24
"minimumQuantityAccumulatedForItems": 1,
_24
"decimalDigitsPrecision": 2,
_24
"minimumValueAccumulated": null,
_24
"apps": [
_24
...
_24
],
_24
"allowMultipleDeliveries": true,
_24
"allowManualPrice": null,
_24
"savePersonalDataAsOptIn": false,
_24
"maxNumberOfWhiteLabelSellers": null,
_24
"recaptchaValidation": "vtexcriteria",
_24
"recaptchaMinScore": null,
_24
"recaptchaKeys": null,
_24
"maskStateOnAddress": true,
_24
"enableSecureCookies": true,
_24
"useOwnershipCookie": true,
_24
"ignoreProfileData": null,
_24
"useIndividualShippingEstimates": true
_24
}

By enabling this flag, the shippingEstimateDate will be updated with the SLA information configured by the sellers.

Add items to cart

Once you enable the useIndividualShippingEstimates, test if the configuration is correct by adding items to a shopping cart using the Add cart items endpoint. See the request body example presented.

Request

_14
{
_14
"orderItems": [
_14
{
_14
"seller": "1",
_14
"id": 6,
_14
"quantity": 1
_14
},
_14
{
_14
"seller": "1",
_14
"id": 11,
_14
"quantity": 1
_14
}
_14
]
_14
}

Send shipping data attachment

Send the item shipping data to the orderForm using the Add shipping address and select delivery option endpoint as in the example shown.

Once configured, the orderForm will retrieve the variable shippingEstimateDate, which will display the shipping estimate date instead of only the shipping estimate in business days.

Request

_36
{
_36
"selectedAddresses": [
_36
{
_36
"addressId": "5139683010323",
_36
"addressType": "search",
_36
"city": null,
_36
"complement": null,
_36
"country": "BRA",
_36
"neighborhood": null,
_36
"number": null,
_36
"postalCode": "08391705",
_36
"receiverName": "Jane Doe",
_36
"reference": null,
_36
"street": null,
_36
"addressQuery": "",
_36
"isDisposable": null
_36
}
_36
],
_36
"expectedOrderFormSections": [
_36
"items",
_36
"totalizers",
_36
"clientProfileData",
_36
"shippingData",
_36
"paymentData",
_36
"sellers",
_36
"messages",
_36
"marketingData",
_36
"clientPreferencesData",
_36
"storePreferencesData",
_36
"giftRegistryData",
_36
"ratesAndBenefitsData",
_36
"openTextField",
_36
"commercialConditionData",
_36
"customData"
_36
]
_36
}

Response

_28
{
_28
"slas": [
_28
"id": "SEDEX 1",
_28
"deliveryChannel": "delivery",
_28
"name": "SEDEX_1",
_28
"deliveryIds":[1],
_28
"courierId": "1aafbd3",
_28
"warehouseId": "estoqueA",
_28
"dockId": "01",
_28
"courierName": "Correios DistanceLevel Sedex1_Test",
_28
"quantity": 1,
_28
"kitItemDetails": []
_28
"shippingEstimate": "3bd",
_28
"shippingEstimateDate": "2023-07-12T14:52:00+00:00",
_28
"lockTTL": null,
_28
"availableDeliveryWindows": 0,
_28
"deliveryWindow": null,
_28
"price": 31,
_28
"listPrice": 31,
_28
"tax":0,
_28
"pickupStoreInfo": {
_28
"isPickupStore": false,
_28
"friendlyName": null,
_28
"address": null,
_28
"additionalInfo": null,
_28
"dockId": null
_28
}
_28
]}

Enable the useIndividualShippingEstimates flag

First, it is necessary to enable the Checkout API behavior to fill the shippingEstimateDate with the SLA information. To do so, you must update the store's orderForm with the Update orderForm configuration endpoint. You must include the flag useIndividualShippingEstimates to true as in the example shown.

By enabling this flag, the shippingEstimateDate will be updated with the SLA information configured by the sellers.

Add items to cart

Once you enable the useIndividualShippingEstimates, test if the configuration is correct by adding items to a shopping cart using the Add cart items endpoint. See the request body example presented.

Send shipping data attachment

Send the item shipping data to the orderForm using the Add shipping address and select delivery option endpoint as in the example shown.

Once configured, the orderForm will retrieve the variable shippingEstimateDate, which will display the shipping estimate date instead of only the shipping estimate in business days.

Request

_24
{
_24
"paymentConfiguration": {
_24
...
_24
},
_24
"taxConfiguration": null,
_24
"minimumQuantityAccumulatedForItems": 1,
_24
"decimalDigitsPrecision": 2,
_24
"minimumValueAccumulated": null,
_24
"apps": [
_24
...
_24
],
_24
"allowMultipleDeliveries": true,
_24
"allowManualPrice": null,
_24
"savePersonalDataAsOptIn": false,
_24
"maxNumberOfWhiteLabelSellers": null,
_24
"recaptchaValidation": "vtexcriteria",
_24
"recaptchaMinScore": null,
_24
"recaptchaKeys": null,
_24
"maskStateOnAddress": true,
_24
"enableSecureCookies": true,
_24
"useOwnershipCookie": true,
_24
"ignoreProfileData": null,
_24
"useIndividualShippingEstimates": true
_24
}

Contributors
1
Photo of the contributor
+ 1 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
1
Photo of the contributor
+ 1 contributors
On this page