Overview
The CustomAPI shipping provider allows you to integrate your own shipping rates API service, enabling you to provide custom shipping rates for your storefront. This powerful feature gives you full control over the shipping options and rates displayed to your customers, ensuring they receive the most accurate and competitive shipping costs.
Key Features
- Custom Shipping Rates: Integrate your own API to provide tailored shipping rates.
- Seamless Integration: Easily enable and configure the CustomAPI shipping provider within your storefront settings.
- Real-time Rate Calculation: Fetch shipping rates dynamically based on cart contents and shipping destination.
Requirements
Ensure you have an active API endpoint that can return shipping rates in JSON format.
Integration Steps
1. Enabling CustomAPI Shipping Provider
To enable the CustomAPI shipping provider, navigate to Settings > Shipping > Shipping Providers in your admin panel.
Locate the CustomAPI option and click the edit icon to open the settings.
2. Configuring CustomAPI Settings
In the CustomAPI settings, mark the integration as active and provide your Custom Rates API Endpoint URL.
3. Custom Rates API Endpoint
Set your API endpoint URL to receive cart data in JSON format for rate calculation.
When getting rates from your API endpoint, the following cart JSON data will be posted:
{
"ShippingAddress": {
"Address1": "Line 1",
"Address2": "Line 2",
"City": "ShipToCity",
"State": "ShipToState",
"ZipCode": "ShipToZip",
"Country": "US"
},
"Items": [{
"ItemId": 1,
"ItemNr": "Item1",
"Quantity": 1,
"Weight": 2.00,
"Price": 10.00,
"Length": 10,
"Width": 10,
"Height": 10,
"OwnBox": true,
"WarehouseCity": "City",
"WarehouseState": "State",
"WarehouseZipCode": "Zip",
"WarehouseCountry": "US",
"MfgItemNr": "",
"StoreId": 1
}],
"CartId": 123
}
4. Expected Response from Your API
Your API should return rates in JSON format as shown below:
Note: "DeliveryTime" is optional and must be in a date format.
{
"RateResponse": [
{
"ServiceName": "Ground",
"TotalCharge": 10.0,
"DeliveryTime": "2/29/2024"
},
{
"ServiceName": "Express",
"TotalCharge": 20.0,
"DeliveryTime": "2/28/2024"
}
],
"ErrorMessage": "string"
}