51 lines
1.1 KiB
TypeScript
51 lines
1.1 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' },
|
||
|
|
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' },
|
||
|
|
tiers: proChatTiers,
|
||
|
|
tiers_mode: 'volume',
|
||
|
|
tax_behavior: 'exclusive',
|
||
|
|
product: chatsProductId,
|
||
|
|
currency_options: {
|
||
|
|
eur: {
|
||
|
|
tax_behavior: 'exclusive',
|
||
|
|
tiers: proChatTiers,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
createChatsPrices()
|