Shoplazza supports the integration of third-party services related to shipping cost calculation to provide merchants with a more diverse range of shipping plans and calculations. You simply need to register a shipping plan and provide a Callback URL, and when an order is placed in the store, the third-party service will be called to calculate the shipping cost.
Requirements for accessing the CarrierService resource
To access the CarrierService resource, add the write_order permission to your app's requested scopes. For more information, see scope detail.
Providing shipping rates to Shoplazza
When adding a carrier service to a store, you need to provide a POST endpoint rooted in the callback_url property where Shoplazza can retrieve applicable shipping rates. The callback URL should be a public endpoint that expects these requests from Shoplazza.
A sample Shoplazza request for shipping rates:
POST: you callback_url
the json of shipping rate request sent to a carrier service
{
"line_items": [
{
"product_id": "string",
"variant_id": "string",
"quantity": 0,
"length": "string",
"width": "string",
"height": "string",
"dimension_unit": "string",
"weight": "string",
"weight_unit": "string"
}
],
"currency_code": "string",
"from_address": {
"country": "string",
"country_code": "string",
"province": "string",
"province_code": "string",
"city": "string",
"address": "string",
"address1": "string",
"company": "string",
"zip": "string"
},
"to_address": {
"country": "string",
"country_code": "string",
"province": "string",
"province_code": "string",
"city": "string",
"address": "string",
"address1": "string",
"company": "string",
"zip": "string"
}
}
Field | Type | Description | ||
---|---|---|---|---|
line_items | required | |||
product_id | string | required | ||
variant_id | string | required | ||
variant_title | string | required | ||
quantity | string | required | Number of Items | |
length | string | required | ||
width | string | required | ||
height | string | required | ||
dimension_unit | string | required | units of measurement | |
weight | string | required | ||
weight_unit | string | required | ||
currency_code | string | required | Current settlement currency | |
from_address | required | |||
country | string | |||
country_code | string | required | ||
province | string | |||
province_code | string | required | ||
city | string | |||
address | string | |||
address1 | string | |||
company | string | |||
zip | string | required | Postal Code | |
to_address | required | |||
country | string | |||
country_code | string | required | ||
province | string | |||
province_code | string | required | ||
city | string | |||
address | string | |||
address1 | string | |||
company | string | |||
zip | string | required | Postal Code |
**Example
{
"line_items": [
{
"product_id": "01600c6b-7f9b-4740-8b29-82ee83ee0456",
"variant_id": "9fc41b4e-cf4d-463f-ad18-0b18943b9402",
"quantity": 1,
"length": "1.00",
"width": "1.00",
"height": "1.00",
"dimension_unit": "in",
"weight": "2.00",
"weight_unit": "kg"
}
],
"currency_code": "CAD",
"from_address": {
"country_code": "CA",
"province_code": "BC",
"city": "Coquitlam",
"zip": "V3C3R9"
},
"to_address": {
"country_code": "CA",
"province_code": "BC",
"city": "Coquitlam",
"zip": "V3C3R9"
}
}
Response
When Shoplazza requests shipping rates using your callback URL, the response object rates must be a JSON array of objects with the following fields. Required fields must be included in the response for the carrier service integration to work properly.
Here is a example:
{
"service_name": "string",
"description": "string",
"service_code": "string",
"currency": "string",
"total_price": "string"
}
Field | Description |
---|---|
service_name | The name of the rate, which customers see at checkout. |
description | A description of the rate, which customers see at checkout. |
service_code | A unique code associated with the rate. |
currency | The currency of the shipping rate. |
total_price | The total price expressed in subunits.If the currency doesn't use subunits, then the value must be multiplied by 100.For example: "total_price": 500 for 5.00 CAD, "total_price": 100000 for 1000 JPY. |
Response Timeouts
The read timeout for rate requests are dynamic, based on the number of requests per minute (RPM). These limits are applied to each shop-app pair. The timeout values are as follows.
RPM Range | Timeout |
---|---|
Under 1500 | 10s |
1500 to 3000 | 5s |
Over 3000 | 3s |
These values are upper limits and should not be interpretted as a goal to develop towards. Shoplazza is constantly evaluating the performance of the platform and working towards improving resilience as well as app capabilities. As such, these numbers may be adjusted outside of our normal versioning timelines.