#fullbound_api

1 messages ยท Page 1 of 1 (latest)

small muralBOT
#

๐Ÿ‘‹ 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.

heady nymph
low orchid
#

For usage based items, they will be only be charged at the end of the billing period

heady nymph
#

example request id of incrementing a usage event req_8itZPMLAp3FKjM

low orchid
#

Could you share the invoice ID (in_xxx) in this screenshot that you expect to see the usage report?

heady nymph
#

oh wait, this part is working ๐Ÿ˜„

#

so sorry

low orchid
#

No problem! Happy to hear that the usage based billing is working as expected

heady nymph
#

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`,
    })
low orchid
#

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

heady nymph
#

I see, ok I will look into that

heady nymph
#

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)

#

?

low orchid
heady nymph
#

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

low orchid
#

Could you share the Checkout Session ID (cs_xxx)?

hushed sageBOT
heady nymph
#

sorry yes one moment

harsh stump
#

Hi @heady nymph I'm taking over this thread.

heady nymph
#

should be this

#

cs_test_b1hxcyM12Wgxw7Gj82XtlRueXSRSckhS0I2I2lpjPbwwmoXCsNDvhwSVls

#

hi @harsh stump

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.

heady nymph
#

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,
  },
],
harsh stump
#

I don't think you can use float number as quantity.

heady nymph
#

maybe we need to do per 1000 tokens then