The "update Shipping Rate" API allows update a shipping rate to the system.
http
PUT https://services.leadconnectorhq.com/store/shipping-zone/{shippingZoneId}/shipping-rate/{shippingRateId}Authorization
| 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. |
Path parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
shippingZoneId | string | Yes | 6578278e879ad2646715ba9c | ID of the shipping zone |
shippingRateId | string | Yes | 6578278e879ad2646715ba9c | ID of the shipping rate that needs to be returned |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
altId | string | No | 6578278e879ad2646715ba9c | Account Id or Agency Id |
altType | string | No | Possible values: 'account' | |
name | string | No | North zone | Name of the shipping zone |
description | string | No | Ships next day | Delivery description |
currency | string | No | USD | The currency of the amount of the rate / handling fee |
amount | number | No | 99.99 | 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). |
conditionType | string | No | price | Type of condition to provide the conditional pricing Possible values: 'none', 'price', 'weight' |
minCondition | number | No | 99.99 | Minimum condition for applying this price. set 0 or null if there is no minimum |
maxCondition | number | No | 99.99 | Maximum condition for applying this price. set 0 or null if there is no maximum |
isCarrierRate | boolean | No | True | is this a carrier rate |
shippingCarrierId | string | No | 655b33a82209e60b6adb87a5 | Shipping carrier id |
percentageOfRateFee | number | No | 10.99 | Percentage of rate fee if it is a carrier rate. |
shippingCarrierServices(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
Responses
200 - Successful response
status(boolean, required): Status of api action Example:Truemessage(string): Success message Example:Successfully createddata(object, required): Shipping zone data
json
{
"status": true,
"message": "Successfully created"
}400 - Bad Request
json
{}422 - Unprocessable Entity
json
{}Example
curl -X PUT 'https://services.leadconnectorhq.com/store/shipping-zone/YOUR_shippingZoneId/shipping-rate/YOUR_shippingRateId' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"altId": "6578278e879ad2646715ba9c",
"altType": "account",
"name": "North zone",
"description": "Ships next day",
"currency": "USD",
"amount": 99.99,
"conditionType": "price",
"minCondition": 99.99,
"maxCondition": 99.99,
"isCarrierRate": true,
"shippingCarrierId": "655b33a82209e60b6adb87a5",
"percentageOfRateFee": 10.99,
"shippingCarrierServices": [
{
"name": "Priority Mail Express International",
"value": "PriorityMailExpressInternational"
}
]
}'const response = await fetch('https://services.leadconnectorhq.com/store/shipping-zone/YOUR_shippingZoneId/shipping-rate/YOUR_shippingRateId', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"altId": "6578278e879ad2646715ba9c", "altType": "account", "name": "North zone", "description": "Ships next day", "currency": "USD", "amount": 99.99, "conditionType": "price", "minCondition": 99.99, "maxCondition": 99.99, "isCarrierRate": true, "shippingCarrierId": "655b33a82209e60b6adb87a5", "percentageOfRateFee": 10.99, "shippingCarrierServices": [{"name": "Priority Mail Express International", "value": "PriorityMailExpressInternational"}]}),
});
const data = await response.json();import os, requests
response = requests.request(
'PUT',
'https://services.leadconnectorhq.com/store/shipping-zone/YOUR_shippingZoneId/shipping-rate/YOUR_shippingRateId',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"altId": "6578278e879ad2646715ba9c", "altType": "account", "name": "North zone", "description": "Ships next day", "currency": "USD", "amount": 99.99, "conditionType": "price", "minCondition": 99.99, "maxCondition": 99.99, "isCarrierRate": true, "shippingCarrierId": "655b33a82209e60b6adb87a5", "percentageOfRateFee": 10.99, "shippingCarrierServices": [{"name": "Priority Mail Express International", "value": "PriorityMailExpressInternational"}]},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/store/shipping-zone/YOUR_shippingZoneId/shipping-rate/YOUR_shippingRateId');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'altId': '6578278e879ad2646715ba9c', 'altType': 'account', 'name': 'North zone', 'description': 'Ships next day', 'currency': 'USD', 'amount': 99.99, 'conditionType': 'price', 'minCondition': 99.99, 'maxCondition': 99.99, 'isCarrierRate': true, 'shippingCarrierId': '655b33a82209e60b6adb87a5', 'percentageOfRateFee': 10.99, 'shippingCarrierServices': [{'name': 'Priority Mail Express International', 'value': 'PriorityMailExpressInternational'}]}),
]);
$data = json_decode(curl_exec($ch), true);