Price
Source:
src/Stripe/Price.ts
A Stripe Price — the unit cost attached to a Product. Currency, amount,
product, and recurring interval are immutable (changing them replaces
the price). Nickname, metadata, lookup key, and active update in
place. Prices cannot be deleted; destroy deactivates them
(active=false).
Creating a Price
Section titled “Creating a Price”One-time price
const product = yield* Stripe.Product("pro-plan", { name: "Pro Plan" });const price = yield* Stripe.Price("pro-once", { product, currency: "usd", unitAmount: 2000,});Recurring monthly price
const price = yield* Stripe.Price("pro-monthly", { product, currency: "usd", unitAmount: 1500, recurring: { interval: "month" }, nickname: "Pro monthly",});Updating a Price
Section titled “Updating a Price”const price = yield* Stripe.Price("pro-monthly", { product, currency: "usd", unitAmount: 1500, recurring: { interval: "month" }, nickname: "Pro monthly (paused)", active: false, metadata: { tier: "pro" },});Destroying a Price
Section titled “Destroying a Price”// Stripe cannot delete a used price. `alchemy destroy` sets// `active: false`.