# PostShippingRatesShippingRateToken

From **Stripe API**.

`POST /v1/shipping_rates/{shipping_rate_token}`

<p>Updates an existing shipping rate object.</p>

## Parameters

### `shipping_rate_token`

- Location: path
- Required: true
- Type: `string`
- maxLength: `5000`

## Request body

- Required: false
### `application/x-www-form-urlencoded`

- Type: `object`

```json
{"additionalProperties":false,"properties":{"active":{"description":"Whether the shipping rate can be used for new purchases. Defaults to `true`.","type":"boolean"},"expand":{"description":"Specifies which fields in the response should be expanded.","items":{"maxLength":5000,"type":"string"},"type":"array"},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"enum":[""],"type":"string"}],"description":"Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`."}},"type":"object"}
```

## Security

### `basicAuth`

- Type: `http`
- Request header: `Authorization`
- Scheme: `basic`
Send credentials in the `Authorization` request header using the `Basic` scheme.

Basic HTTP authentication. Allowed headers-- Authorization: Basic <api_key> | Authorization: Basic <base64 hash of `api_key:`>

### `bearerAuth`

- Type: `http`
- Request header: `Authorization`
- Scheme: `bearer`
- Bearer format: `auth-scheme`
Send the token in the `Authorization` request header using the `Bearer` scheme.

Bearer HTTP authentication. Allowed headers-- Authorization: Bearer <api_key>

## Responses

### `200`

Successful response.

### `application/json`

- Type: `object`

Shipping rates describe the price of shipping presented to your customers and can be
applied to [Checkout Sessions](https://stripe.com/docs/payments/checkout/shipping) to collect shipping costs.

```json
{"description":"Shipping rates describe the price of shipping presented to your customers and can be\napplied to [Checkout Sessions](https://stripe.com/docs/payments/checkout/shipping) to collect shipping costs.","properties":{"active":{"description":"Whether the shipping rate can be used for new purchases. Defaults to `true`.","type":"boolean"},"created":{"description":"Time at which the object was created. Measured in seconds since the Unix epoch.","format":"unix-time","type":"integer"},"delivery_estimate":{"anyOf":[{"$ref":"#/components/schemas/shipping_rate_delivery_estimate"}],"description":"The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.","nullable":true},"display_name":{"description":"The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.","maxLength":5000,"nullable":true,"type":"string"},"fixed_amount":{"$ref":"#/components/schemas/shipping_rate_fixed_amount"},"id":{"description":"Unique identifier for the object.","maxLength":5000,"type":"string"},"livemode":{"description":"Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.","type":"boolean"},"metadata":{"additionalProperties":{"maxLength":500,"type":"string"},"description":"Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.","type":"object"},"object":{"description":"String representing the object's type. Objects of the same type share the same value.","enum":["shipping_rate"],"type":"string"},"tax_behavior":{"description":"Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.","enum":["exclusive","inclusive","unspecified"],"nullable":true,"type":"string"},"tax_code":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/tax_code"}],"description":"A [tax code](https://stripe.com/docs/tax/tax-codes) ID. The Shipping tax code is `txcd_92010001`.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/tax_code"}]}},"type":{"description":"The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now.","enum":["fixed_amount"],"type":"string"}},"required":["active","created","id","livemode","metadata","object","type"],"title":"ShippingRate","type":"object","x-expandableFields":["delivery_estimate","fixed_amount","tax_code"],"x-resourceId":"shipping_rate"}
```

### `default`

Error response.

### `application/json`

- Type: `object`

An error response from the Stripe API

```json
{"description":"An error response from the Stripe API","properties":{"error":{"$ref":"#/components/schemas/api_errors"}},"required":["error"],"type":"object"}
```

## Request examples

### cURL

```shell
curl --request POST \
  --url https://api.stripe.com/v1/shipping_rates/{shipping_rate_token} \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data '{
  "active": true,
  "expand": [
    "string"
  ],
  "metadata": "string"
}'
```
