Sample - Stripe API
POST/v1/shipping_rates/{shipping_rate_token}

Update a shipping rate

Updates an existing shipping rate's active state, fixed-amount currency options, metadata, or tax behavior. Supply only the properties you want to change because omitted properties retain their current values. Use expand to include selected response fields inline.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.
  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 5 body fields
shipping_rate_tokenstringrequired
The unique identifier of the shipping rate to update; must not exceed 5,000 characters.

Optional partial-update fields for the shipping rate and response expansion.

activebooleanoptional
Whether the shipping rate can be used for new purchases. Defaults to `true`.
expandarray<string>optional
Specifies which fields in the response should be expanded.
fixed_amountobjectoptional
Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
metadataobjectoptional
Set of [key-value pairs](https://docs.stripe.com/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`.
tax_behaviorstringoptional
Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
Allowed:exclusiveinclusiveunspecified

2 status codes
200Returns the updated shipping-rate object with its current active state, pricing, tax settings, metadata, and other configured fields.
activebooleanrequired
Whether the shipping rate can be used for new purchases. Defaults to `true`.
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
delivery_estimateobjectoptional
The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
display_namestringoptional
The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
fixed_amountobjectoptional
idstringrequired
Unique identifier for the object.
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectrequired
Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:shipping_rate
tax_behaviorstringoptional
Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
Allowed:exclusiveinclusiveunspecified
tax_codestringoptional
A [tax code](https://docs.stripe.com/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
typestringrequired
The type of calculation to use on the shipping rate.
Allowed:fixed_amount
defaultError response.
errorobjectrequired

Error handling

shipping_rate_token must be a string of no more than 5,000 characters identifying the shipping rate. If supplied, tax_behavior must be inclusive, exclusive, or unspecified, and metadata must be a string map or an empty value.