2
0
Files
bot/packages/scripts/createChatsPrices.ts
2023-10-23 09:57:47 +02:00

59 lines
1.3 KiB
TypeScript

import Stripe from 'stripe'
import { promptAndSetEnvironment } from './utils'
import {
proChatTiers,
starterChatTiers,
} from '@typebot.io/lib/billing/constants'
const chatsProductId = 'prod_MVXtq5sATQzIcM'
const createChatsPrices = async () => {
await promptAndSetEnvironment()
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
apiVersion: '2022-11-15',
})
await stripe.prices.create({
currency: 'usd',
billing_scheme: 'tiered',
recurring: {
interval: 'month',
usage_type: 'metered',
aggregate_usage: 'last_during_period',
},
tiers: starterChatTiers,
tiers_mode: 'volume',
tax_behavior: 'exclusive',
product: chatsProductId,
currency_options: {
eur: {
tax_behavior: 'exclusive',
tiers: starterChatTiers,
},
},
})
await stripe.prices.create({
currency: 'usd',
billing_scheme: 'tiered',
recurring: {
interval: 'month',
usage_type: 'metered',
aggregate_usage: 'last_during_period',
},
tiers: proChatTiers,
tiers_mode: 'volume',
tax_behavior: 'exclusive',
product: chatsProductId,
currency_options: {
eur: {
tax_behavior: 'exclusive',
tiers: proChatTiers,
},
},
})
}
createChatsPrices()