#0xTypedef

1 messages · Page 1 of 1 (latest)

jaunty ingotBOT
spring drum
#
const session = await ctx.stripe.checkout.sessions.create(
        {
          mode: "payment",
          payment_method_types: ["card"],
          line_items: [
            {
              price_data: {
                unit_amount: priceAmount * 100,
                currency: "USD",
              },
              quantity: 1,
            },
          ],
          metadata: {
            stripeId: user.stripeId,
          },
          payment_intent_data: { application_fee_amount: 10 },
          success_url: `${input.callbackUrl}?session={CHECKOUT_SESSION_ID}`,
          cancel_url: input.callbackUrl,
        },
        {
          stripeAccount: user.stripeId,
        },
      );
gritty inlet
#

Hi there, as the error message suggest, you need to specify a product or product_data inside the price_data hash

spring drum
#

i cant just set the price amount alone?

#

also can I get an express account's payout value via api?

gritty inlet
spring drum
#

not balance, payout value of an express account

#

via stripe connect

gritty inlet
spring drum
#

my users have this dashboard

#

i wanna retrieve total earnings

#

mb ithought it was called payouts

gritty inlet
#

That's balance

spring drum
#

Can i retrieve my user's balance then?

#

i have their account id

gritty inlet
#

Sure, you can use this API to retrieve balance (https://stripe.com/docs/api/balance/balance_retrieve#retrieve_balance)

Also remember to specify a stripe_account in the request.

By specifying a stripe_account, you are telling Stripe that you want to make an API call on behalf of a connected account. You can refer to this doc to learn more about making API request for connected account (https://stripe.com/docs/connect/authentication)

Learn how to add the right information to your API calls so you can make calls for your connected accounts.

spring drum
#

aigh stripe_account field