Shipping Method API
The Shipping Method API allows you to programmatically retrieve available shipping methods for orders in your EverShop store. These methods can be presented to customers during checkout to provide shipping options.
Get Available Shipping Methods
Retrieves all available shipping methods that can be applied to orders in your store.
Request Schema (application/json)
No request body requiredGET/api/shippingMethods
- cURL
- JavaScript
curl
-H "Accept: application/json"
https://<your domain>/api/shippingMethods
fetch('https://<your domain>/api/shippingMethods', {
headers: {
'Accept': 'application/json',
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"data": {
"methods": [
{
"code": "free",
"name": "Free Shipping"
},
{
"code": "standard",
"name": "Standard Shipping",
"cost": 5.99
},
{
"code": "express",
"name": "Express Shipping",
"cost": 15.99
}
]
}
}
Set Shipping Method for Cart
Applies a selected shipping method to a specific shopping cart.
Request Schema (application/json)
Field Name | Field Type | Required |
---|---|---|
method_code | string | Yes |
POST/api/carts/{cart_id}/shippingMethods
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
https://<your domain>/api/carts/{cart_id}/shippingMethods
fetch('https://<your domain>/api/carts/{cart_id}/shippingMethods', {
headers: {
'Accept': 'application/json',
'Cookie': 'asid=<your admin cookie>'
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"data": {
"shipping_method": "standard",
"shipping_fee_excl_tax": 5.99,
"shipping_fee_incl_tax": 5.99
}
}
Path Parameters
Parameter | Type | Required | Description |
---|---|---|---|
cart_id | string | Yes | The UUID of the cart to apply the shipping method to |
Get Cart Shipping Method
Retrieves the currently selected shipping method for a specific cart.
Request Schema (application/json)
No request body requiredGET/api/carts/{cart_id}/shippingMethods
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
https://<your domain>/api/carts/{cart_id}/shippingMethods
fetch('https://<your domain>/api/carts/{cart_id}/shippingMethods', {
headers: {
'Accept': 'application/json',
'Cookie': 'asid=<your admin cookie>'
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"data": {
"shipping_method": "standard",
"shipping_fee_excl_tax": 5.99,
"shipping_fee_incl_tax": 5.99
}
}
Path Parameters
Parameter | Type | Required | Description |
---|---|---|---|
cart_id | string | Yes | The UUID of the cart to retrieve the shipping method for |
Troubleshooting
Common Error Codes
Status Code | Description | Solution |
---|---|---|
400 | Bad Request | Check that the shipping method code is valid |
401 | Unauthorized | Ensure your API credentials are correct |
404 | Not Found | Verify the cart ID exists |
422 | Unprocessable Entity | The cart may be missing required information (like shipping address) |
500 | Server Error | Contact support if the issue persists |