Cart – Shipping Options
This API request uses the POST shippingprices
endpoint to retrieve the available shipping options for a cart.
The POST data for the body of the request should be a JSON object with following parameters:
Items
- required - list of SKU & quantity pairs. Each item must have the following properties defined:SKU
- required - SKU of product variantQuantity
- required - quantity of items with this SKU
ShipToPostalCode
- required - postal codeShipToState
- optional - state code if existsShipToCountry
- required - 2-letter country codeCurrencyCode
- required - currency code
Important: The "Item.ShipCarrierMethodId
" field is considered the "Id
" and it is not the "MethodId
". The value for this field is a result from when you pass the parameter value during the order submission process.
The following parameters would look something like the example below:
{
"ShipToPostalCode": "string",
"ShipToCountry": "string",
"ShipToState": "string",
"CurrencyCode": "string",
"Items": [
{
"SKU": "string",
"Quantity": "integer"
}
]
}
Each API request to the Gooten API must have the RecipeID parameter included in the URL. This is typically used to authenticate to the Gooten API. Please be sure to replace the YourRecipeID
in the example with your proper RecipeID from the Gooten Admin.
You must also replace the YourPartnerBillingKey
in the example with your own Partner Billing Key from the Gooten Admin. This key is used for order related API calls but in this scenario, it will provide you with the shipping options for your items in your cart.
When you provide your partnerBillingKey
, you must encode it in order for the request to work. You can use an Encoder tool to help encode your partnerBillingKey.
After sending the API request, it will display the following response:
{
"Result": [
{
"SKUs": [
"string"
],
"ShipOptions": [
{
"Id": "integer",
"MethodType": "string",
"MethodId": "integer",
"Name": "string",
"CarrierName": "string",
"Price": {
"Price": "decimal",
"CurrencyCode": "string",
"FormattedPrice": "string",
"CurrencyFormat": "string",
"CurrencyDigits": "integer"
},
"PartnerPrice": {
"Price": "decimal",
"CurrencyCode": "string",
"FormattedPrice": "string",
"CurrencyFormat": "string",
"CurrencyDigits": "integer"
},
"EstBusinessDaysTilDelivery": "integer",
"MinDays": "integer",
"MaxDays": "integer"
}
],
"ProductionTimesOptions": [
{
"MinDays": "integer",
"MaxDays": "integer",
"AverageDays": "decimal",
"TopRangePercent": "integer"
}
]
}
]
}