This return available shipping rates for country based on order amount
POST https://services.leadconnectorhq.com/store/shipping-zone/shipping-ratesAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
altId | string | Yes | 6578278e879ad2646715ba9c | Account Id or Agency Id |
altType | string | Yes | Possible values: 'account' | |
country | string | Yes | US | Country code of the customer Possible values: 'US', 'CA', 'AF', 'AX', 'AL', 'DZ', 'AS', 'AD', 'AO', 'AI', 'AQ', 'AG', 'AR', 'AM', 'AW', 'AU', 'AT', 'AZ', 'BS', 'BH', 'BD', 'BB', 'BY', 'BE', 'BZ', 'BJ', 'BM', 'BT', 'BO', 'BA', 'BW', 'BV', 'BR', 'IO', 'BN', 'BG', 'BF', 'BI', 'KH', 'CM', 'CV', 'KY', 'CF', 'TD', 'CL', 'CN', 'CX', 'CC', 'CO', 'KM', 'CG', 'CD', 'CK', 'CR', 'CI', 'HR', 'CU', 'CY', 'CZ', 'DK', 'DJ', 'DM', 'DO', 'EC', 'EG', 'SV', 'GQ', 'ER', 'EE', 'ET', 'FK', 'FO', 'FJ', 'FI', 'FR', 'GF', 'PF', 'TF', 'GA', 'GM', 'GE', 'DE', 'GH', 'GI', 'GR', 'GL', 'GD', 'GP', 'GU', 'GT', 'GG', 'GN', 'GW', 'GY', 'HT', 'HM', 'VA', 'HN', 'HK', 'HU', 'IS', 'IN', 'ID', 'IR', 'IQ', 'IE', 'IM', 'IL', 'IT', 'JM', 'JP', 'JE', 'JO', 'KZ', 'KE', 'KI', 'KP', 'XK', 'KW', 'KG', 'LA', 'LV', 'LB', 'LS', 'LR', 'LY', 'LI', 'LT', 'LU', 'MO', 'MK', 'MG', 'MW', 'MY', 'MV', 'ML', 'MT', 'MH', 'MQ', 'MR', 'MU', 'YT', 'MX', 'FM', 'MD', 'MC', 'MN', 'ME', 'MS', 'MA', 'MZ', 'MM', 'NA', 'NR', 'NP', 'NL', 'AN', 'NC', 'NZ', 'NI', 'NE', 'NG', 'NU', 'NF', 'MP', 'NO', 'OM', 'PK', 'PW', 'PS', 'PA', 'PG', 'PY', 'PE', 'PH', 'PN', 'PL', 'PT', 'PR', 'QA', 'RE', 'RO', 'RU', 'RW', 'SH', 'KN', 'LC', 'MF', 'PM', 'VC', 'WS', 'SM', 'ST', 'SA', 'SN', 'RS', 'SC', 'SL', 'SG', 'SX', 'SK', 'SI', 'SB', 'SO', 'ZA', 'GS', 'KR', 'ES', 'LK', 'SD', 'SR', 'SJ', 'SZ', 'SE', 'CH', 'SY', 'TW', 'TJ', 'TZ', 'TH', 'TL', 'TG', 'TK', 'TO', 'TT', 'TN', 'TR', 'TM', 'TC', 'TV', 'UG', 'UA', 'AE', 'GB', 'UM', 'UY', 'UZ', 'VU', 'VE', 'VN', 'VG', 'VI', 'WF', 'EH', 'YE', 'ZM', 'ZW' |
address | object | No | Address of the customer | |
amountAvailable | string | No | US | it will not calculate the order amount form backend if it is true Possible values: 'AF', 'AX', 'AL', 'DZ', 'AS', 'AD', 'AO', 'AI', 'AQ', 'AG', 'AR', 'AM', 'AW', 'AU', 'AT', 'AZ', 'BS', 'BH', 'BD', 'BB', 'BY', 'BE', 'BZ', 'BJ', 'BM', 'BT', 'BO', 'BA', 'BW', 'BV', 'BR', 'IO', 'BN', 'BG', 'BF', 'BI', 'KH', 'CM', 'CA', 'CV', 'KY', 'CF', 'TD', 'CL', 'CN', 'CX', 'CC', 'CO', 'KM', 'CG', 'CD', 'CK', 'CR', 'CI', 'HR', 'CU', 'CY', 'CZ', 'DK', 'DJ', 'DM', 'DO', 'EC', 'EG', 'SV', 'GQ', 'ER', 'EE', 'ET', 'FK', 'FO', 'FJ', 'FI', 'FR', 'GF', 'PF', 'TF', 'GA', 'GM', 'GE', 'DE', 'GH', 'GI', 'GR', 'GL', 'GD', 'GP', 'GU', 'GT', 'GG', 'GN', 'GW', 'GY', 'HT', 'HM', 'VA', 'HN', 'HK', 'HU', 'IS', 'IN', 'ID', 'IR', 'IQ', 'IE', 'IM', 'IL', 'IT', 'JM', 'JP', 'JE', 'JO', 'KZ', 'KE', 'KI', 'KP', 'KR', 'XK', 'KW', 'KG', 'LA', 'LV', 'LB', 'LS', 'LR', 'LY', 'LI', 'LT', 'LU', 'MO', 'MK', 'MG', 'MW', 'MY', 'MV', 'ML', 'MT', 'MH', 'MQ', 'MR', 'MU', 'YT', 'MX', 'FM', 'MD', 'MC', 'MN', 'ME', 'MS', 'MA', 'MZ', 'MM', 'NA', 'NR', 'NP', 'NL', 'AN', 'NC', 'NZ', 'NI', 'NE', 'NG', 'NU', 'NF', 'MP', 'NO', 'OM', 'PK', 'PW', 'PS', 'PA', 'PG', 'PY', 'PE', 'PH', 'PN', 'PL', 'PT', 'PR', 'QA', 'RE', 'RO', 'RU', 'RW', 'SH', 'KN', 'LC', 'MF', 'PM', 'VC', 'WS', 'SM', 'ST', 'SA', 'SN', 'RS', 'SC', 'SL', 'SG', 'SX', 'SK', 'SI', 'SB', 'SO', 'ZA', 'GS', 'ES', 'LK', 'SD', 'SR', 'SJ', 'SZ', 'SE', 'CH', 'SY', 'TW', 'TJ', 'TZ', 'TH', 'TL', 'TG', 'TK', 'TO', 'TT', 'TN', 'TR', 'TM', 'TC', 'TV', 'UG', 'GB', 'UA', 'AE', 'US', 'UM', 'UY', 'UZ', 'VU', 'VE', 'VN', 'VG', 'VI', 'WF', 'EH', 'YE', 'ZM', 'ZW' |
totalOrderAmount | number | Yes | 99.99 | The amount of the price. ( min: 0.01 ) |
weightAvailable | boolean | No | True | Flag to pass when the weight is already calculated and should not calculate again |
totalOrderWeight | number | Yes | 10 | Estimated weight of the order calculated from the order creation side in kg(s) |
source | object | Yes | Source of the order |
products(object[], required): An array of price IDs and quantityid(string, required): id of productqty(number, required): No of quantities
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
couponCode | string | No | TEST | Coupon code |
Responses
201 - Successful response
status(boolean, required): Status of api action Example:Truemessage(string): Success message Example:Successfully createddata(object[], required): Shipping rate dataname(string, required): Name of the shipping zone Example:North zonedescription(string): Delivery description Example:Ships next daycurrency(string, required): The currency of the amount of the rate / handling fee Example:USDamount(number, required): The amount of the shipping rate if it is normal rate (0 means free ). Fixed Handling fee if it is a carrier rate (it will add to the carrier rate). Example:99.99isCarrierRate(boolean): is this a carrier rate Example:TrueshippingCarrierId(string, required): Shipping carrier id Example:655b33a82209e60b6adb87a5percentageOfRateFee(number): Percentage of rate fee if it is a carrier rate. Example:10.99shippingCarrierServices(object[]): An array of itemsname(string, required): Name of the shipping carrier service Example:Priority Mail Express Internationalvalue(string, required): Value of the shipping carrier service Example:PriorityMailExpressInternational
_id(string, required): The unique identifier for the product. Example:655b33a82209e60b6adb87a5shippingZoneId(string, required): The unique identifier for the shipping zone. Example:655b33a82209e60b6adb87a5
{
"status": true,
"message": "Successfully created",
"data": [
{
"name": "North zone",
"description": "Ships next day",
"currency": "USD",
"amount": 99.99,
"isCarrierRate": true,
"shippingCarrierId": "655b33a82209e60b6adb87a5",
"percentageOfRateFee": 10.99,
"shippingCarrierServices": [
{}
],
"_id": "655b33a82209e60b6adb87a5",
"shippingZoneId": "655b33a82209e60b6adb87a5"
}
]
}400 - Bad Request
{}422 - Unprocessable Entity
{}Example
curl -X POST 'https://services.leadconnectorhq.com/store/shipping-zone/shipping-rates' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"altId": "6578278e879ad2646715ba9c",
"altType": "account",
"country": "US",
"amountAvailable": "US",
"totalOrderAmount": 99.99,
"weightAvailable": true,
"totalOrderWeight": 10,
"source": {
"type": "order",
"subType": "store"
},
"products": [
{
"id": "string",
"qty": 0
}
],
"couponCode": "TEST"
}'const response = await fetch('https://services.leadconnectorhq.com/store/shipping-zone/shipping-rates', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"altId": "6578278e879ad2646715ba9c", "altType": "account", "country": "US", "amountAvailable": "US", "totalOrderAmount": 99.99, "weightAvailable": true, "totalOrderWeight": 10, "source": {"type": "order", "subType": "store"}, "products": [{"id": "string", "qty": 0}], "couponCode": "TEST"}),
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/store/shipping-zone/shipping-rates',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"altId": "6578278e879ad2646715ba9c", "altType": "account", "country": "US", "amountAvailable": "US", "totalOrderAmount": 99.99, "weightAvailable": true, "totalOrderWeight": 10, "source": {"type": "order", "subType": "store"}, "products": [{"id": "string", "qty": 0}], "couponCode": "TEST"},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/store/shipping-zone/shipping-rates');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'altId': '6578278e879ad2646715ba9c', 'altType': 'account', 'country': 'US', 'amountAvailable': 'US', 'totalOrderAmount': 99.99, 'weightAvailable': true, 'totalOrderWeight': 10, 'source': {'type': 'order', 'subType': 'store'}, 'products': [{'id': 'string', 'qty': 0}], 'couponCode': 'TEST'}),
]);
$data = json_decode(curl_exec($ch), true);