#fullbound_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1257167188113096745
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
For usage based items, they will be only be charged at the end of the billing period
example request id of incrementing a usage event req_8itZPMLAp3FKjM
Could you share the invoice ID (in_xxx) in this screenshot that you expect to see the usage report?
No problem! Happy to hear that the usage based billing is working as expected
I see the upcoming invoice with correct billing
I guess the only question
is the checkout page, I wonder if way to clean it up
so it doesn't say "Blastoff" 3 times
(Blastoff name of the product)
it should say
LLM usage - amount
Match usage - amount
not sure how to create a label for these
const session = await stripe.checkout.sessions.create({
customer: customerId,
payment_method_types: ['card'],
line_items: [
{
price: priceId,
quantity: 1,
},
{
price: priceMap['llm_usage'].id,
},
{
price: priceMap['match_requests'].id,
},
],
subscription_data: {
trial_period_days: 7,
},
mode: 'subscription',
success_url: `${process.env.FB_CANONICAL_URL}/checkout/success?sessionId={CHECKOUT_SESSION_ID}`,
cancel_url: `${process.env.FB_CANONICAL_URL}/checkout/cancel`,
})
The display name on Checkout Session will use the name on the product. I'd recommend creating different product with its name on the prices, so that they will show the names accordingly
Currently, the usage based prices were created on the same product, so the names are the same
I see, ok I will look into that
just one more question, while we're here @low orchid
line_items: [
{
price: priceId,
quantity: 1,
},
{
price: priceMap['llm_usage'].id,
quantity: 1,
},
{
price: priceMap['matches_usage'].id,
quantity: 1,
},
],
I need to add quantity for the new products (didn't need this before it seems)
?
Can you share the request ID (req_xxx) of the error if the quantity isn't added? Hereโs how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_yNNdnxh8ajbwJ9
this appears to be working now I think...
sorry just one more question ๐
our charge-per-usage for LLM is $0.0004 but it shows $0.00
because its per token
Could you share the Checkout Session ID (cs_xxx)?
sorry yes one moment
Hi @heady nymph I'm taking over this thread.
should be this
cs_test_b1hxcyM12Wgxw7Gj82XtlRueXSRSckhS0I2I2lpjPbwwmoXCsNDvhwSVls
hi @harsh stump
The unit_amount_decimal for the LLM usage is 0.004 and the line item quantity is 1, that's why it gets rounded to 0.00 because USD is a two-decimal currency.
so these should always match @harsh stump ?
line_items: [
{
price: priceId,
quantity: 1,
},
{
price: priceMap['llm_usage'].id,
quantity: 0.0004,
},
{
price: priceMap['matches_usage'].id,
quantity: 0.01,
},
],
I don't think you can use float number as quantity.
maybe we need to do per 1000 tokens then