Skip to main content
PUT
/
settings
/
shipping
/
rates
Update Shipping Rates
curl --request PUT \
  --url https://staging-api.puppetvendors.com/settings/shipping/rates \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "method": "<string>",
  "amount": 123,
  "ranges": [
    {}
  ],
  "warehouseId": 123,
  "realtimeOption": "<string>"
}
'
import requests

url = "https://staging-api.puppetvendors.com/settings/shipping/rates"

payload = {
"method": "<string>",
"amount": 123,
"ranges": [{}],
"warehouseId": 123,
"realtimeOption": "<string>"
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
method: '<string>',
amount: 123,
ranges: [{}],
warehouseId: 123,
realtimeOption: '<string>'
})
};

fetch('https://staging-api.puppetvendors.com/settings/shipping/rates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://staging-api.puppetvendors.com/settings/shipping/rates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'method' => '<string>',
'amount' => 123,
'ranges' => [
[

]
],
'warehouseId' => 123,
'realtimeOption' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://staging-api.puppetvendors.com/settings/shipping/rates"

payload := strings.NewReader("{\n \"method\": \"<string>\",\n \"amount\": 123,\n \"ranges\": [\n {}\n ],\n \"warehouseId\": 123,\n \"realtimeOption\": \"<string>\"\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://staging-api.puppetvendors.com/settings/shipping/rates")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"method\": \"<string>\",\n \"amount\": 123,\n \"ranges\": [\n {}\n ],\n \"warehouseId\": 123,\n \"realtimeOption\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://staging-api.puppetvendors.com/settings/shipping/rates")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method\": \"<string>\",\n \"amount\": 123,\n \"ranges\": [\n {}\n ],\n \"warehouseId\": 123,\n \"realtimeOption\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
V2 Preview — This endpoint is part of the V2 API preview. Breaking changes may occur.

Overview

Set or update the vendor’s shipping rate configuration. Choose a calculation method and provide the relevant details. Vendor scope required.

Request Body

method
string
required
One of order, lineItem, orderRange, orderWeight, realtime.
amount
number
Fixed amount — required when method is order or lineItem.
ranges
array
Array of { from, to, rate } — required when method is orderRange or orderWeight (grams for weight).
warehouseId
integer
Warehouse index to ship from — used when method is realtime.
realtimeOption
string
fastest or cheapest — used when method is realtime.

Response

200
{ "success": true }

Examples

Fixed per order
curl -X PUT "https://staging-api.puppetvendors.com/settings/shipping/rates" \
  -H "x-access-token: YOUR_VENDOR_JWT" \
  -H "Content-Type: application/json" \
  -d '{ "method": "order", "amount": 7.99 }'
Weight ranges (grams)
curl -X PUT "https://staging-api.puppetvendors.com/settings/shipping/rates" \
  -H "x-access-token: YOUR_VENDOR_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "method": "orderWeight",
    "ranges": [
      { "from": 0, "to": 500, "rate": 3.5 },
      { "from": 500, "to": 2000, "rate": 7 }
    ]
  }'
Realtime carrier rates
curl -X PUT "https://staging-api.puppetvendors.com/settings/shipping/rates" \
  -H "x-access-token: YOUR_VENDOR_JWT" \
  -H "Content-Type: application/json" \
  -d '{ "method": "realtime", "warehouseId": 0, "realtimeOption": "cheapest" }'

More Examples

Flat rate per order
curl -X PUT "https://staging-api.puppetvendors.com/settings/shipping/rates" \
  -H "Content-Type: application/json" \
  -H "x-access-token: YOUR_TOKEN" \
  -d '{"method": "order", "amount": 5.99}'
Weight-based ranges
curl -X PUT "https://staging-api.puppetvendors.com/settings/shipping/rates" \
  -H "Content-Type: application/json" \
  -H "x-access-token: YOUR_TOKEN" \
  -d '{
    "method": "orderWeight",
    "ranges": [
      {"from": 0, "to": 1, "rate": 4.99},
      {"from": 1, "to": 5, "rate": 9.99},
      {"from": 5, "to": 50, "rate": 14.99}
    ]
  }'
Real-time rates from warehouse
curl -X PUT "https://staging-api.puppetvendors.com/settings/shipping/rates" \
  -H "Content-Type: application/json" \
  -H "x-access-token: YOUR_TOKEN" \
  -d '{"method": "realtime", "warehouseId": "507f1f77bcf86cd799439012", "realtimeOption": "cheapest"}'