# Shipping Cost

Manage shipping costs

## Calculating the final shipping cost

> The endpoint returns shipping methods, which contain the matching fee for all zones.

```json
{"openapi":"3.0.0","info":{"title":"Shipping Service","version":"0.0.1"},"tags":[{"name":"Shipping Cost","description":"Manage shipping costs"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"oAuth2":[]}],"components":{"securitySchemes":{"oAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"shipping.shipping_manage":"Needed to manage shipping settings.","shipping.shipping_read":"Needed to read shipping settings."}}}}},"parameters":{"tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}},"site":{"description":"Site unique identifier. A site is a specific shop.\n\nIf the tenant owns only one shop, the value should be set to `main`.\n","name":"site","in":"path","required":true,"schema":{"type":"string"}}},"schemas":{"QuotePayload":{"title":"Quote request payload","description":"Example of payload for shipping cost calculation.","type":"object","properties":{"customerId":{"description":"Customer unique identifier.","type":"string"},"cartTotal":{"description":"Total amount for the given cart.","type":"object","required":["amount","currency"],"properties":{"amount":{"description":"Amount in specified currency.","type":"number","minimum":0},"currency":{"type":"string","description":"Three-letter currency code, compliant with the ISO 4217 standard.","pattern":"[A-Z]{3}"}}},"shipFromAddress":{"$ref":"#/components/schemas/Address"},"shipToAddress":{"$ref":"#/components/schemas/Address"}},"required":["cartTotal","shipToAddress"]},"Address":{"title":"Address","description":"Address of billing or delivery that contains customer or company name and location including street, street number, zipcode, and country.","type":"object","properties":{"street":{"description":"Name of the street.","type":"string"},"streetNumber":{"type":"string"},"extraLine1":{"type":"string"},"extraLine2":{"type":"string"},"extraLine3":{"type":"string"},"extraLine4":{"type":"string"},"zipCode":{"maxLength":9,"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"country":{"type":"string"}},"required":["zipCode","country"]},"QuoteResponse":{"title":"Quote response","description":"Example quote response which contains a list of fees for various methods and delivery zone.","type":"array","items":{"$ref":"#/components/schemas/QuoteResponseItem"}},"QuoteResponseItem":{"title":"Quote response item","type":"object","description":"Example quote response which contains fee for specific method and zone.","properties":{"zone":{"type":"object","properties":{"id":{"description":"Delivery zone's unique identifier.","type":"string"},"name":{"$ref":"#/components/schemas/LocalizedValue"}}},"methods":{"type":"array","items":{"$ref":"#/components/schemas/QuoteResponseMethods"}}}},"LocalizedValue":{"oneOf":[{"type":"string","description":"String value in the specified language."},{"type":"object","additionalProperties":{"type":"string"},"description":"Map of translations in form of language:translation pairs.\nThe keys (languages) should be ISO language codes."}]},"QuoteResponseMethods":{"title":"Quote response shipping methods","type":"object","description":"Example quote response which contains fee for specific method.","properties":{"id":{"type":"string"},"name":{"$ref":"#/components/schemas/LocalizedValue"},"fee":{"$ref":"#/components/schemas/MonetaryAmount"},"shippingTaxCode":{"type":"string"}}},"MonetaryAmount":{"title":"Monetary amount","description":"Amount of money in a given currency.","type":"object","properties":{"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"amount":{"type":"number","minimum":0,"description":"Amount in specified currency."}},"required":["currency","amount"]},"errorMessage":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"errorCode":{"type":"string","description":"The error code which specify the problem"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","anyOf":[{"type":"string"},{"type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error, eg shipTo[0].country, this can be empty if violation was not field specific","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}}}]}}},"required":["status","type"]}},"responses":{"quote_400":{"description":"Request syntactically incorrect. Details of the error are included in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"unauthorized_401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"notFound_404":{"description":"The requested resource does not exist.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"internalError_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}}}},"paths":{"/shipping/{tenant}/{site}/quote":{"post":{"tags":["Shipping Cost"],"summary":"Calculating the final shipping cost","operationId":"POST-shipping-calculate-shipping-cost","description":"The endpoint returns shipping methods, which contain the matching fee for all zones.","parameters":[{"$ref":"#/components/parameters/tenant"},{"$ref":"#/components/parameters/site"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuotePayload"}}}},"responses":{"200":{"description":"Shipping costs calculated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteResponse"}}}},"400":{"$ref":"#/components/responses/quote_400"},"401":{"$ref":"#/components/responses/unauthorized_401"},"404":{"$ref":"#/components/responses/notFound_404"},"500":{"$ref":"#/components/responses/internalError_500"}}}}}}
```

## Calculating the minimum shipping cost

> Retrieves the minimum shipping cost.

```json
{"openapi":"3.0.0","info":{"title":"Shipping Service","version":"0.0.1"},"tags":[{"name":"Shipping Cost","description":"Manage shipping costs"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"oAuth2":[]}],"components":{"securitySchemes":{"oAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"shipping.shipping_manage":"Needed to manage shipping settings.","shipping.shipping_read":"Needed to read shipping settings."}}}}},"parameters":{"tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}},"site":{"description":"Site unique identifier. A site is a specific shop.\n\nIf the tenant owns only one shop, the value should be set to `main`.\n","name":"site","in":"path","required":true,"schema":{"type":"string"}}},"schemas":{"QuotePayload":{"title":"Quote request payload","description":"Example of payload for shipping cost calculation.","type":"object","properties":{"customerId":{"description":"Customer unique identifier.","type":"string"},"cartTotal":{"description":"Total amount for the given cart.","type":"object","required":["amount","currency"],"properties":{"amount":{"description":"Amount in specified currency.","type":"number","minimum":0},"currency":{"type":"string","description":"Three-letter currency code, compliant with the ISO 4217 standard.","pattern":"[A-Z]{3}"}}},"shipFromAddress":{"$ref":"#/components/schemas/Address"},"shipToAddress":{"$ref":"#/components/schemas/Address"}},"required":["cartTotal","shipToAddress"]},"Address":{"title":"Address","description":"Address of billing or delivery that contains customer or company name and location including street, street number, zipcode, and country.","type":"object","properties":{"street":{"description":"Name of the street.","type":"string"},"streetNumber":{"type":"string"},"extraLine1":{"type":"string"},"extraLine2":{"type":"string"},"extraLine3":{"type":"string"},"extraLine4":{"type":"string"},"zipCode":{"maxLength":9,"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"country":{"type":"string"}},"required":["zipCode","country"]},"MinimumFee":{"title":"Minimum fee","type":"object","description":"Minimum available delivery fee for given parameters.","properties":{"fee":{"$ref":"#/components/schemas/MonetaryAmount"}}},"MonetaryAmount":{"title":"Monetary amount","description":"Amount of money in a given currency.","type":"object","properties":{"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"amount":{"type":"number","minimum":0,"description":"Amount in specified currency."}},"required":["currency","amount"]},"errorMessage":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"errorCode":{"type":"string","description":"The error code which specify the problem"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","anyOf":[{"type":"string"},{"type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error, eg shipTo[0].country, this can be empty if violation was not field specific","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}}}]}}},"required":["status","type"]}},"responses":{"quote_400":{"description":"Request syntactically incorrect. Details of the error are included in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"unauthorized_401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"notFound_404":{"description":"The requested resource does not exist.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"internalError_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}}}},"paths":{"/shipping/{tenant}/{site}/quote/minimum":{"post":{"tags":["Shipping Cost"],"summary":"Calculating the minimum shipping cost","operationId":"POST-shipping-calculate-min-shipping-cost","description":"Retrieves the minimum shipping cost.","parameters":[{"$ref":"#/components/parameters/tenant"},{"$ref":"#/components/parameters/site"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuotePayload"}}}},"responses":{"200":{"description":"Shipping costs calculated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MinimumFee"}}}},"400":{"$ref":"#/components/responses/quote_400"},"401":{"$ref":"#/components/responses/unauthorized_401"},"404":{"$ref":"#/components/responses/notFound_404"},"500":{"$ref":"#/components/responses/internalError_500"}}}}}}
```

## Calculating the shipping cost for a given slot

> Retrieves the minimum shipping cost related to a particular slot.

```json
{"openapi":"3.0.0","info":{"title":"Shipping Service","version":"0.0.1"},"tags":[{"name":"Shipping Cost","description":"Manage shipping costs"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"oAuth2":[]}],"components":{"securitySchemes":{"oAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"shipping.shipping_manage":"Needed to manage shipping settings.","shipping.shipping_read":"Needed to read shipping settings."}}}}},"parameters":{"tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}},"site":{"description":"Site unique identifier. A site is a specific shop.\n\nIf the tenant owns only one shop, the value should be set to `main`.\n","name":"site","in":"path","required":true,"schema":{"type":"string"}}},"schemas":{"QuoteSlot":{"title":"Quote slot request schema","description":"Example of payload for shipping cost calculation.","type":"object","properties":{"customerId":{"description":"Customer unique identifier.","type":"string"},"cartTotal":{"description":"Total amount for the given cart.","type":"object","required":["amount","currency"],"properties":{"amount":{"description":"Amount in specified currency.","type":"number","minimum":0},"currency":{"type":"string","description":"Three-letter currency code, compliant with the ISO 4217 standard.","pattern":"[A-Z]{3}"}}},"shipFromAddress":{"$ref":"#/components/schemas/Address"},"shipToAddress":{"$ref":"#/components/schemas/Address"},"slotId":{"type":"string","description":"The `slotId`` which the quote should be calculated for."},"deliveryWindowId":{"type":"string","description":"The delivery window id which the slot with selected shipping method exists for."}},"required":["cartTotal","slotId","deliveryWindowId"]},"Address":{"title":"Address","description":"Address of billing or delivery that contains customer or company name and location including street, street number, zipcode, and country.","type":"object","properties":{"street":{"description":"Name of the street.","type":"string"},"streetNumber":{"type":"string"},"extraLine1":{"type":"string"},"extraLine2":{"type":"string"},"extraLine3":{"type":"string"},"extraLine4":{"type":"string"},"zipCode":{"maxLength":9,"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"country":{"type":"string"}},"required":["zipCode","country"]},"MinimumFee":{"title":"Minimum fee","type":"object","description":"Minimum available delivery fee for given parameters.","properties":{"fee":{"$ref":"#/components/schemas/MonetaryAmount"}}},"MonetaryAmount":{"title":"Monetary amount","description":"Amount of money in a given currency.","type":"object","properties":{"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"amount":{"type":"number","minimum":0,"description":"Amount in specified currency."}},"required":["currency","amount"]},"errorMessage":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"errorCode":{"type":"string","description":"The error code which specify the problem"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","anyOf":[{"type":"string"},{"type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error, eg shipTo[0].country, this can be empty if violation was not field specific","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}}}]}}},"required":["status","type"]}},"responses":{"quote_400":{"description":"Request syntactically incorrect. Details of the error are included in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"unauthorized_401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"notFound_404":{"description":"The requested resource does not exist.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"internalError_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}}}},"paths":{"/shipping/{tenant}/{site}/quote/slot":{"post":{"tags":["Shipping Cost"],"summary":"Calculating the shipping cost for a given slot","operationId":"POST-shipping-calculate-slot-shipping-cost","description":"Retrieves the minimum shipping cost related to a particular slot.","parameters":[{"$ref":"#/components/parameters/tenant"},{"$ref":"#/components/parameters/site"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteSlot"}}}},"responses":{"200":{"description":"Shipping costs calculated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MinimumFee"}}}},"400":{"$ref":"#/components/responses/quote_400"},"401":{"$ref":"#/components/responses/unauthorized_401"},"404":{"$ref":"#/components/responses/notFound_404"},"500":{"$ref":"#/components/responses/internalError_500"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.emporix.io/api-references/api-guides/delivery-and-shipping/shipping-1/api-reference/shipping-cost.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
