This return available shipping rates for country based on order amount
POST https://services.leadconnectorhq.com/store/shipping-zone/shipping-rates
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.
Body
altId
string
default:"6578278e879ad2646715ba9c"
required
Account Id or Agency Id
Posibles valores: ‘account’
country
string
default:"US"
required
Country code of the customer Posibles valores: ‘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’
it will not calculate the order amount form backend if it is true Posibles valores: ‘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
default:"99.99"
required
The amount of the price. ( min: 0.01 )
Flag to pass when the weight is already calculated and should not calculate again
totalOrderWeight
number
default:"10"
required
Estimated weight of the order calculated from the order creation side in kg(s)
An array of price IDs and quantity
Respuestas
201 - Successful response
status
boolean
default:"True"
required
Status of api action
message
string
default:"Successfully created"
Success message
Shipping rate data
name
string
default:"North zone"
required
Name of the shipping zone
description
string
default:"Ships next day"
Delivery description
currency
string
default:"USD"
required
The currency of the amount of the rate / handling fee
amount
number
default:"99.99"
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).
shippingCarrierId
string
default:"655b33a82209e60b6adb87a5"
required
Shipping carrier id
Percentage of rate fee if it is a carrier rate.
An array of items
name
string
default:"Priority Mail Express International"
required
Name of the shipping carrier service
value
string
default:"PriorityMailExpressInternational"
required
Value of the shipping carrier service
_id
string
default:"655b33a82209e60b6adb87a5"
required
The unique identifier for the product.
shippingZoneId
string
default:"655b33a82209e60b6adb87a5"
required
The unique identifier for the shipping zone.
{
"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"
}
]
}
422 - Unprocessable Entity
Ejemplo
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);