---
title: "Calculate SLA"
method: POST
path: "/api/logistics/pvt/shipping/calculate"
tags: ["SLA"]
---

# Calculate SLA

`POST /api/logistics/pvt/shipping/calculate`

Checkout uses this endpoint to calculate a Service Level Agreement (SLA), a contract between the store and a customer about their order fulfillment conditions, such as the shipping estimated date.

The calculation of the estimated date considers the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) and [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) related to the order.

## Permissions

Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint:

| **Product** | **Category** | **Resource** |
| --------------- | ----------------- | ----------------- |
| Logistics | Logistics access | **Logistics full access** |
| Logistics | Logistics access | **Logistics viewer** |

You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy):

| **Role** | **Resource** | 
| --------------- | ----------------- | 
| Logistics - Full access | Logistics full access |
| OMS - Full access | Logistics full access |
| Logistics - Full access | Logistics viewer |
| Logistics - Read only | Logistics viewer |

>❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).

## Headers

- `Content-Type` string, required
- `Accept` string, required

## Request body

- object[]
  - `items` object[], required — Items' shipping conditions to calculate the Service Level Agreement (SLA).
    - `id` string, required — SKU ID.
    - `quantity` integer, required — SKU quantity.
    - `price` number, nullable — Item price.
    - `modal` 'CHEMICALS' | 'ELECTRONICS' | 'FURNITURE' | 'GLASS' | 'LIQUID' | 'MATTRESSES' | 'REFRIGERATED' | 'TIRES' | 'WHITE_GOODS' | 'FIREARMS', nullable — [Modal](https://help.vtex.com/en/tutorial/how-the-modal-works--tutorials_125) is a special freight.
    - `additionalHandlingTime` string — Additional handling time in the format `DD.HH:MM:SS`.
    - `dimension` object, required — Item dimensions.
      - `weight` number — Item weight.
      - `height` number — Item height.
      - `width` number — Item width.
      - `length` number — Item length.
      - `maxSumDimension` number — Maximum sum of dimensions.
    - `kitItem` object[], nullable — [Kit](https://help.vtex.com/en/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28) item information.
      - `id` string, required — Kit SKU ID.
      - `groupItemId` string, nullable — Kit group item ID.
      - `kitItem` string[], nullable — Kit item list.
      - `quantity` integer, required — Kit SKU quantity.
      - `price` number — Kit SKU price.
      - `additionalHandlingTime` string — Kit item additional handling time in the format `DD.HH:MM:SS`.
      - `dimension` object, required — Kit item dimensions.
        - `weight` number — Kit item weight.
        - `height` number — Kit item height.
        - `width` number — Kit item width.
        - `length` number — Kit item length.
        - `maxSumDimension` number — Maximum sum of dimensions.
    - `dockId` string, nullable — [Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID.
    - `wareHouseId` string, nullable — [Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID.
  - `location` object, required — Shipping location information.
    - `zipCode` string, required — Shipping adress postal code.
    - `country` string, required — Three-digit country code of the shipping address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format.
    - `point` number[] — Shipping address coordinates, first longitude then latitude.
    - `inStore` object — Information related to [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc).
      - `IsCheckedIn` boolean — This field is set as `true` when the order is placed via [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc) and `false` when it is not.
      - `StoreId` string, nullable — ID of purchases made in the GoCommerce context.
  - `salesChannel` string — Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) valid for the SLA calculation.
  - `deliveryChannel` string, nullable — Defines if the shipping type is `delivery` or `pickup`.

## Response `200`

OK

- array[]
  - object[] — List of Service Level Agreements (SLA).
    - `itemId` string — SKU ID.
    - `quantity` integer — SKU quantity.
    - `kitItem` object[] — [Kit](https://help.vtex.com/en/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28) items' information.
      - `id` string — Kit SKU ID.
      - `quantity` integer — Kit SKU quantity.
      - `warehouseId` string — [Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID where the kit SKU is stored.
      - `supplyLotId` string, nullable — Kit SKU supply lot ID.
    - `availabilityQuantity` integer — SKU quantity available for sales. [Reserved](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) items do not count.
    - `salesChannel` string — Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) valid for the SLA calculation.
    - `slaType` string — Service Level Agreement (SLA) type.
    - `slaTypeName` string — Service Level Agreement (SLA) name.
    - `freightTableName` string — [Shipping rate template](https://help.vtex.com/en/tutorial/shipping-rate-template--tutorials_127) name.
    - `freightTableId` string — Shipping rate template ID.
    - `listPrice` number — SKU list price.
    - `transitTime` string — Transit time in the format `DD.HH:MM:SS`.
    - `dockTime` string — [Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) processing time in the format `D.HH:MM:SS`. When it was not configured, it returns `00:00:00`.
    - `timeToDockPlusDockTime` string — Time spent in loading dock plus `dockTime` in the format `D.HH:MM:SS`.
    - `aditionalTimeBlockedDays` string — Additional time blocked in the format `DD.HH:MM:SS`.
    - `leadTime` string — [Lead time](https://help.vtex.com/en/tutorial/lead-time-shipping-time-at-sku-level--16yv5Mkj6bTyWR1hCN2f4B) is an optional time configuration for a SKU in a warehouse. It can be handling time, fabrication or how long it takes for the item to be available to be shipped to customers. The lead time is a part of the total shipping time and is considered for shipping date calculation. The format is `DD.HH:MM:SS`.
    - `totalTime` string — SLA total time in the format `DD.HH:MM:SS`.
    - `deliveryWindows` object[] — [Delivery windows](https://help.vtex.com/en/tutorial/managing-delivery-capacity--2y217FQZCjD0I1n62yxVcz) configurations.
      - `startDateUtc` string — Delivery window starting date and time, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`.
      - `endDateUtc` string — Delivery window ending date and time, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`.
      - `listPrice` number — List price.
    - `wareHouseId` string — [Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID.
    - `dockId` string — [Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID.
    - `location` object — Shipping location information.
      - `zipCode` string — Shipping adress postal code.
      - `country` string — Three-digit country code of the shipping address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format.
      - `point` number[], nullable — Shipping address coordinates, first longitude then latitude.
      - `inStore` object — Information related to [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc).
        - `isCheckedIn` boolean — This field is set as `true` when the order is placed via [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc) and `false` when it is not.
        - `storeId` string, nullable — ID of purchases made in the GoCommerce context.
    - `deliveryOnWeekends` boolean — Defines if the delivery on weekends configuration is active (`true`) or inactive (`false`).
    - `weekendAndHolidays` object, nullable — Delivery on weekends and holidays information.
      - `saturday` boolean — Defines if the delivery on Saturday configuration is active (`true`) or inactive (`false`).
      - `sunday` boolean — Defines if the delivery on Sunday configuration is active (`true`) or inactive (`false`).
      - `holiday` boolean — Defines if the delivery on [holiday](https://help.vtex.com/en/tutorial/registering-holidays--2ItOthSEAoyAmcwsuiO6Yk) configuration is active (`true`) or inactive (`false`).
    - `carrierSchedule` object[] — Schedule sent by the carrier.
      - `dayOfWeek` 0 | 1 | 2 | 3 | 4 | 5 | 6 — Day of the week, from `0` (Sunday) to `6` (Saturday).
      - `timeLimit` string — Time limit.
    - `totalTimePlusCarrierSchedule` string — Total shipping time plus carrier schedule, in the format `DD.HH:MM:SS`.
    - `restrictedFreight` string[], nullable — List of postal codes where the delivery is restricted for the carrier.
    - `coordinates` number[], nullable — Shipping address geolocation coordinates, first longitude then latitude.
    - `pickupStoreInfo` object — Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).
      - `isPickupStore` boolean, nullable — Defines if the shipping type was pickup (`true`) or not (`false`).
      - `storeId` string, nullable — Store ID for stores that acted as pickup points.
      - `friendlyName` string, nullable — Name of the pickup point displayed at checkout.
      - `address` object, nullable — Pickup point address information.
        - `postalCode` string — Pickup point address postal code.
        - `country` object — Information about the pickup point address country.
          - `acronym` string — Three-digit country code of the pickup point address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format.
          - `name` string — Country name of the pickup point address.
        - `city` string — Pickup point address city.
        - `state` string — Pickup point address state.
        - `neighborhood` string — Pickup point address neighborhood.
        - `street` string — Pickup point address street.
        - `number` string — Pickup point address number.
        - `complement` string, nullable — Pickup point address complement.
        - `reference` string, nullable — Pickup point address reference point.
        - `location` object — Pickup point address geolocation coordinates.
          - `latitude` number — Latitude coordinate.
          - `longitude` number — Longitude coordinate.
      - `additionalInfo` string, nullable — Additional information about the delivery or the pickup point.
      - `dockId` string, nullable — ID of the [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj related to the delivery or the pickup point ID.
      - `distance` number, nullable — Distance in kilometers between the pickup point and the customer's address, measured as a straight line.
      - `businessHours` string, nullable — Pickup point business hours configurations.
      - `pickupHolidays` string, nullable — Holiday's configurations applicable to the pickup point.
      - `sellerId` string, nullable — Seller ID.
      - `isThirdPartyPickup` boolean — Defines if the pickup was third party (`true`) or not (`false`).
    - `timeToPresale` string — Time to presale in the format `DD.HH:MM:SS`.
    - `deliveryChannel` string — Defines if the shipping type is `delivery` or `pickup`.
    - `availabilityQuantityByDeliveryChannel` integer — Availability and quantity by the given delivery channel.
    - `polygonName` string — [Polygon](https://help.vtex.com/en/tutorial/registering-geolocation--tutorials_138) ID (same as the polygon name).
    - `distanceLevel` string — SLA distance level.
    - `accountCarrier` string — Account carrier.
    - `carrierBusinessHours` object[] — Carrier business hours configurations for the week.
      - `openingTime` string — Carrier opening time in `HH:MM:SS` format.
      - `closingTime` string — Carrier closing time in `HH:MM:SS` format.
      - `dayOfWeek` 0 | 1 | 2 | 3 | 4 | 5 | 6 — Day of the week, from `0` (Sunday) to `6` (Saturday).
    - `provider` string, nullable — Provider system.
    - `dateOfSupplyUtc` string, nullable — Supply date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`.
    - `estimateDate` string — Delivery estimate date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`.
    - `supplyLotId` string, nullable — Supply lot ID.
    - `isExternal` boolean — Defines if the SLA request is external (`true`) or not (`false`).

---

[API](https://skmtc.net/vtex/apis/logistics-api.md) · [All operations](https://skmtc.net/vtex/apis/logistics-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vtex/logistics-api/revisions/c08af805d8b3/schema)
