2023-10-17 08:03:30 +02:00
|
|
|
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',
|
2023-10-20 18:26:42 +02:00
|
|
|
recurring: {
|
|
|
|
interval: 'month',
|
|
|
|
usage_type: 'metered',
|
|
|
|
aggregate_usage: 'last_during_period',
|
|
|
|
},
|
2023-10-17 08:03:30 +02:00
|
|
|
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',
|
2023-10-20 18:26:42 +02:00
|
|
|
recurring: {
|
|
|
|
interval: 'month',
|
|
|
|
usage_type: 'metered',
|
|
|
|
aggregate_usage: 'last_during_period',
|
|
|
|
},
|
2023-10-17 08:03:30 +02:00
|
|
|
tiers: proChatTiers,
|
|
|
|
tiers_mode: 'volume',
|
|
|
|
tax_behavior: 'exclusive',
|
|
|
|
product: chatsProductId,
|
|
|
|
currency_options: {
|
|
|
|
eur: {
|
|
|
|
tax_behavior: 'exclusive',
|
|
|
|
tiers: proChatTiers,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
createChatsPrices()
|