Skip to content

ShippingRate

Source: src/Stripe/ShippingRate.ts

A Stripe Shipping Rate — the price of shipping presented to customers and applied to a purchase. Amount, currency, display name, delivery estimate, and tax code are immutable (changing them replaces the rate). active, metadata, taxBehavior, and per-currency currencyOptions update in place. Shipping rates cannot be deleted; destroy deactivates them (active=false).

Fixed-amount USD rate

const ground = yield* Stripe.ShippingRate("ground", {
displayName: "Ground",
amount: 500,
currency: "usd",
});

Rate with a delivery estimate

const express = yield* Stripe.ShippingRate("express", {
displayName: "Express",
amount: 1500,
currency: "usd",
deliveryEstimate: {
minimum: { unit: "business_day", value: 1 },
maximum: { unit: "business_day", value: 3 },
},
});
const ground = yield* Stripe.ShippingRate("ground", {
displayName: "Ground",
amount: 500,
currency: "usd",
active: false,
metadata: { region: "us" },
});
// stack.destroy() / resource removal sets active: false
const ground = yield* Stripe.ShippingRate("ground", {
displayName: "Ground",
amount: 500,
currency: "usd",
});