Skip to content

Stripe: Update a shipping rate

Stripe shippingRates.postShippingRatesShippingRateToken: arguments, response, policy and SDK examples.

← Shipping rates operations · Get started

Operation stripe.postshippingratesshippingratetoken

Provider route: POST /v1/shipping_rates/{shipping_rate_token}. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/stripe with npm, or alter-sdk-stripe with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { StripeIntegration } from "@alter-ai/stripe";
async function execute(input: Parameters<StripeIntegration["shippingRates"]["postShippingRatesShippingRateToken"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new StripeIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.shippingRates.postShippingRatesShippingRateToken(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_stripe import StripeIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = StripeIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.shipping_rates.post_shipping_rates_shipping_rate_token(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.shipping_rate_tokenstringRequired within parentMaximum length: 5000
headersobjectOptionalAdditional keys: not allowed
headers.Idempotency-KeystringOptionalMinimum length: 1
Maximum length: 255
bodyobjectOptionalAdditional keys: not allowed
body.activebooleanOptionalWhether the shipping rate can be used for new purchases. Defaults to `true`.
body.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000
body.fixed_amountobjectOptionalDescribes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
body.fixed_amount.currency_optionsobjectOptionalAdditional keys: see wildcard field
body.fixed_amount.currency_options.*objectAdditional keys
body.fixed_amount.currency_options.*.amountintegerOptional
body.fixed_amount.currency_options.*.tax_behaviorstringOptionalOne of: exclusive, inclusive, unspecified
body.metadataJSONOptionalSet 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`.
body.metadata (anyOf 1)objectAlternativeAdditional keys: see wildcard field
body.metadata (anyOf 1).*stringAdditional keys
body.metadata (anyOf 2)stringAlternativeOne of:
body.tax_behaviorstringOptionalSpecifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
One of: exclusive, inclusive, unspecified

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Create a shipping rate — response body

Referenced models: Create a shipping rate — response body

Create a shipping rate — response body
FieldTypePresenceDescription and constraints
$objectRootShipping rates describe the price of shipping presented to your customers and
applied to a purchase. For more information, see [Charge for shipping](https://docs.stripe.com/payments/during-payment/charge-shipping).
activebooleanRequired within parentWhether the shipping rate can be used for new purchases. Defaults to `true`.
createdJSONRequired within parent
created (anyOf 1)integerAlternativeTime at which the object was created. Measured in seconds since the Unix epoch.
Format: unix-time
created (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
delivery_estimateJSONOptional
delivery_estimate (anyOf 1)JSONAlternativeThe estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
delivery_estimate (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a shipping rate — response body — delivery estimate value maximum, minimum
delivery_estimate (anyOf 2)nullAlternative
display_nameJSONOptional
display_name (anyOf 1)stringAlternativeThe name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
Maximum length: 5000
display_name (anyOf 2)nullAlternative
fixed_amountModelOptionalExpand Create a shipping rate — response body — fixed amount
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
livemodebooleanRequired within parentIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectRequired within parentSet 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.
Additional keys: see wildcard field
metadata.*stringAdditional keysMaximum length: 500
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: shipping_rate
tax_behaviorJSONOptional
tax_behavior (anyOf 1)stringAlternativeSpecifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
Known values: exclusive, inclusive, unspecified
tax_behavior (anyOf 2)nullAlternative
tax_codeJSONOptional
tax_code (anyOf 1)JSONAlternativeA [tax code](https://docs.stripe.com/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
tax_code (anyOf 1) (anyOf 1)stringAlternativeMaximum length: 5000
tax_code (anyOf 1) (anyOf 2)ModelAlternativeExpand Retrieve a tax code — response body
tax_code (anyOf 2)nullAlternative
typestringRequired within parentThe type of calculation to use on the shipping rate.
Known values: fixed_amount

Referenced models: Create a shipping rate — response body — delivery estimate value maximum, minimum, Create a shipping rate — response body — fixed amount, Retrieve a tax code — response body

Create a shipping rate — response body — delivery estimate value maximum, minimum
FieldTypePresenceDescription and constraints
$objectRoot
maximumJSONOptional
maximum (anyOf 1)JSONAlternativeThe upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
maximum (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a shipping rate — response body — delivery_estimate / value / maximum, minimum / maximum / value / unit: business day, day, hour, month, week
maximum (anyOf 2)nullAlternative
minimumJSONOptional
minimum (anyOf 1)JSONAlternativeThe lower bound of the estimated range. If empty, represents no lower bound.
minimum (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a shipping rate — response body — delivery_estimate / value / maximum, minimum / maximum / value / unit: business day, day, hour, month, week
minimum (anyOf 2)nullAlternative

Referenced models: Create a shipping rate — response body — delivery_estimate / value / maximum, minimum / maximum / value / unit: business day, day, hour, month, week

Create a shipping rate — response body — fixed amount
FieldTypePresenceDescription and constraints
$objectRoot
amountJSONRequired within parent
amount (anyOf 1)integerAlternativeA non-negative integer in cents representing how much to charge.
amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
currencystringRequired within parentThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
Format: currency
currency_optionsobjectOptionalShipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
Additional keys: see wildcard field
currency_options.*ModelAdditional keysExpand Create a shipping rate — response body — fixed amount currency options value

Referenced models: Create a shipping rate — response body — fixed amount currency options value

Retrieve a tax code — response body
FieldTypePresenceDescription and constraints
$objectRoot[Tax codes](https://stripe.com/docs/tax/tax-categories) classify goods and services for tax purposes.
descriptionstringRequired within parentA detailed description of which types of products the tax code represents.
Maximum length: 5000
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
namestringRequired within parentA short name for the tax code.
Maximum length: 5000
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: tax_code
requirementsJSONOptional
requirements (anyOf 1)JSONAlternativeAn object that describes more information about the tax location required for this tax code. Some tax codes require a [performance location](/tax/location-sales#required-versus-optional-performance-locations) to calculate tax correctly.
requirements (anyOf 1) (anyOf 1)ModelAlternativeExpand Retrieve a tax code — response body — requirements / value / performance_location: optional, required
requirements (anyOf 2)nullAlternative

Referenced models: Retrieve a tax code — response body — requirements / value / performance_location: optional, required

Create a shipping rate — response body — delivery_estimate / value / maximum, minimum / maximum / value / unit: business day, day, hour, month, week
FieldTypePresenceDescription and constraints
$objectRoot
unitstringRequired within parentA unit of time.
Known values: business_day, day, hour, month, week
valueJSONRequired within parent
value (anyOf 1)integerAlternativeMust be greater than 0.
value (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
Create a shipping rate — response body — fixed amount currency options value
FieldTypePresenceDescription and constraints
$objectRoot
amountJSONRequired within parent
amount (anyOf 1)integerAlternativeA non-negative integer in cents representing how much to charge.
amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
tax_behaviorstringRequired within parentSpecifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
Known values: exclusive, inclusive, unspecified
Retrieve a tax code — response body — requirements / value / performance_location: optional, required
FieldTypePresenceDescription and constraints
$objectRoot
performance_locationstringRequired within parentDescribes whether a performance location is required for a successful tax calculation with a tax code.
Known values: optional, required

SDK function policy ID: stripe.postshippingratesshippingratetoken. Catalog operation: PostShippingRatesShippingRateToken. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"Stripe-Version": "2026-09-30.endive"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.