> ## Documentation Index
> Fetch the complete documentation index at: https://dev.puppetvendors.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Shipping Rates

> Set or update the vendor's shipping rate configuration

<Note>
  **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur.
</Note>

## Overview

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

## Request Body

<ParamField body="method" type="string" required>
  One of `order`, `lineItem`, `orderRange`, `orderWeight`, `realtime`.
</ParamField>

<ParamField body="amount" type="number">
  Fixed amount — required when `method` is `order` or `lineItem`.
</ParamField>

<ParamField body="ranges" type="array">
  Array of `{ from, to, rate }` — required when `method` is `orderRange` or `orderWeight` (grams for weight).
</ParamField>

<ParamField body="warehouseId" type="integer">
  Warehouse index to ship from — used when `method` is `realtime`.
</ParamField>

<ParamField body="realtimeOption" type="string">
  `fastest` or `cheapest` — used when `method` is `realtime`.
</ParamField>

## Response

```json 200 theme={null}
{ "success": true }
```

## Examples

```bash Fixed per order theme={null}
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 }'
```

```bash Weight ranges (grams) theme={null}
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 }
    ]
  }'
```

```bash Realtime carrier rates theme={null}
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**

```bash theme={null}
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**

```bash theme={null}
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**

```bash theme={null}
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"}'
```
