Skip to content

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).

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",
});
const price = yield* Stripe.Price("pro-monthly", {
product,
currency: "usd",
unitAmount: 1500,
recurring: { interval: "month" },
nickname: "Pro monthly (paused)",
active: false,
metadata: { tier: "pro" },
});
// Stripe cannot delete a used price. `alchemy destroy` sets
// `active: false`.