> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# Select Shipping Rate for Quote

PUT https://api-b2b.bigcommerce.com/api/v3/io/rfq/{quote_id}/shipping-rate
Content-Type: application/json

Adds a shipping method to a specific quote based on the provided `quoteId`.Use the [Get Available Shipping Rates for a Quote](#get-rfq-quote_id-shipping-rates) or [Get All B2B Quote Custom Shipping Methods](#get-rfq-quote_id-custom-shipping) endpoints to retrieve shipping method information that you can add to the quote.The request body must include either the `shippingMethodId` field to add a static or real-time shipping method, *or* the `customShippingMethodName` **and** the `customShippingMethodCost` fields to add a custom shipping method.This endpoint uses `/shipping-rate` (singular). Don't confuse it with the [Get Available Shipping Rates for a Quote](#get-rfq-quote_id-shipping-rates) endpoint, which uses `/shipping-rates` (plural). Using the wrong URL returns a **405 - Method Not Allowed** error.

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/b2b/management/quotes/rfq-quote-id-select-shipping-rate

## Authentication

- `X-Auth-Token` header (required) — | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts). | For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).
- `X-Store-Hash` header (required) — | Header | Argument | Description | |:-------|:---------|:------------| | `X-Store-Hash` | `store_hash` | The unique store hash associated with a BigCommerce store that has B2B Edition enabled. |

## Request

### Path parameters

- `quote_id` (integer, required) — The internal numeric ID of the sales quote.

### Body (application/json)

This endpoint expects an object.

- `shippingMethodId` (string, optional) — Shipping method ID. Cannot be used with `customShippingMethodName` at the same time.
- `customShippingMethodName` (string, optional) — Custom shipping method name. Cannot be used with `shippingMethodId` at the same time.
- `customShippingMethodCost` (double, optional) — Custom shipping method cost. Required when using custom shipping method.

## Response

### 200

OK

- `code` (integer, optional, default: 200) — HTTP Response Code
- `data` (RfqQuoteIdShippingRatePutResponsesContentApplicationJsonSchemaData, optional)
- `meta` (RfqQuoteIdShippingRatePutResponsesContentApplicationJsonSchemaMeta, optional)

## Errors

### 422 Unprocessable Entity Error

Missing or Invalid Data The 422 error occurs if the fields have incorrect data, such as entering a `shippingMethodId` value which does not correspond to an available shipping method.

- `code` (double, optional) — HTTP Response Code
- `data` (ResponseErrorData, optional)
- `meta` (ResponseErrorMeta, optional)

## Types

### RfqQuoteIdShippingRatePutResponsesContentApplicationJsonSchemaData

### RfqQuoteIdShippingRatePutResponsesContentApplicationJsonSchemaMeta

- `message` (string, optional, default: SUCCESS)

### ResponseErrorData

- `errMsg` (string, optional)

### ResponseErrorMeta

- `message` (string, optional)

## Examples

### Static or real-time method

**Request**

```json
{
  "shippingMethodId": "07a4b3bc067385847b04d80d430486d9"
}
```

**Response**

```json
{
  "code": 200,
  "data": {},
  "meta": {
    "message": "SUCCESS"
  }
}
```

**SDK Code**

```python Static or real-time method
import requests

url = "https://api-b2b.bigcommerce.com/api/v3/io/rfq/123456/shipping-rate"

payload = { "shippingMethodId": "07a4b3bc067385847b04d80d430486d9" }
headers = {
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Static or real-time method
const url = 'https://api-b2b.bigcommerce.com/api/v3/io/rfq/123456/shipping-rate';
const options = {
  method: 'PUT',
  headers: {'X-Auth-Token': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"shippingMethodId":"07a4b3bc067385847b04d80d430486d9"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Static or real-time method
package main

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

func main() {

	url := "https://api-b2b.bigcommerce.com/api/v3/io/rfq/123456/shipping-rate"

	payload := strings.NewReader("{\n  \"shippingMethodId\": \"07a4b3bc067385847b04d80d430486d9\"\n}")

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

	req.Header.Add("X-Auth-Token", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Static or real-time method
require 'uri'
require 'net/http'

url = URI("https://api-b2b.bigcommerce.com/api/v3/io/rfq/123456/shipping-rate")

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

request = Net::HTTP::Put.new(url)
request["X-Auth-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"shippingMethodId\": \"07a4b3bc067385847b04d80d430486d9\"\n}"

response = http.request(request)
puts response.read_body
```

```java Static or real-time method
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api-b2b.bigcommerce.com/api/v3/io/rfq/123456/shipping-rate")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"shippingMethodId\": \"07a4b3bc067385847b04d80d430486d9\"\n}")
  .asString();
```

```php Static or real-time method
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api-b2b.bigcommerce.com/api/v3/io/rfq/123456/shipping-rate', [
  'body' => '{
  "shippingMethodId": "07a4b3bc067385847b04d80d430486d9"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Static or real-time method
using RestSharp;

var client = new RestClient("https://api-b2b.bigcommerce.com/api/v3/io/rfq/123456/shipping-rate");
var request = new RestRequest(Method.PUT);
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"shippingMethodId\": \"07a4b3bc067385847b04d80d430486d9\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Static or real-time method
import Foundation

let headers = [
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["shippingMethodId": "07a4b3bc067385847b04d80d430486d9"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-b2b.bigcommerce.com/api/v3/io/rfq/123456/shipping-rate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Custom method

**Request**

```json
{
  "customShippingMethodName": "LTL Freight",
  "customShippingMethodCost": 175
}
```

**Response**

```json
{
  "code": 200,
  "data": {},
  "meta": {
    "message": "SUCCESS"
  }
}
```

**SDK Code**

```python Custom method
import requests

url = "https://api-b2b.bigcommerce.com/api/v3/io/rfq/123456/shipping-rate"

payload = {
    "customShippingMethodName": "LTL Freight",
    "customShippingMethodCost": 175
}
headers = {
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Custom method
const url = 'https://api-b2b.bigcommerce.com/api/v3/io/rfq/123456/shipping-rate';
const options = {
  method: 'PUT',
  headers: {'X-Auth-Token': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"customShippingMethodName":"LTL Freight","customShippingMethodCost":175}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Custom method
package main

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

func main() {

	url := "https://api-b2b.bigcommerce.com/api/v3/io/rfq/123456/shipping-rate"

	payload := strings.NewReader("{\n  \"customShippingMethodName\": \"LTL Freight\",\n  \"customShippingMethodCost\": 175\n}")

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

	req.Header.Add("X-Auth-Token", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Custom method
require 'uri'
require 'net/http'

url = URI("https://api-b2b.bigcommerce.com/api/v3/io/rfq/123456/shipping-rate")

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

request = Net::HTTP::Put.new(url)
request["X-Auth-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"customShippingMethodName\": \"LTL Freight\",\n  \"customShippingMethodCost\": 175\n}"

response = http.request(request)
puts response.read_body
```

```java Custom method
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api-b2b.bigcommerce.com/api/v3/io/rfq/123456/shipping-rate")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customShippingMethodName\": \"LTL Freight\",\n  \"customShippingMethodCost\": 175\n}")
  .asString();
```

```php Custom method
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api-b2b.bigcommerce.com/api/v3/io/rfq/123456/shipping-rate', [
  'body' => '{
  "customShippingMethodName": "LTL Freight",
  "customShippingMethodCost": 175
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Custom method
using RestSharp;

var client = new RestClient("https://api-b2b.bigcommerce.com/api/v3/io/rfq/123456/shipping-rate");
var request = new RestRequest(Method.PUT);
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customShippingMethodName\": \"LTL Freight\",\n  \"customShippingMethodCost\": 175\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Custom method
import Foundation

let headers = [
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "customShippingMethodName": "LTL Freight",
  "customShippingMethodCost": 175
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-b2b.bigcommerce.com/api/v3/io/rfq/123456/shipping-rate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```