#kamil1999_api

1 messages · Page 1 of 1 (latest)

wary ironBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1316529035878076507

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

lapis jewel
#

is there any option to add customers to seller account through api?

#

the best would be that customers appears in "customers" section on connected account after they pay

versed plume
#

Hello, it is possible to create customers on your connected accounts, though depending on your connect payment flow that may or may not be helpful.

#

Do your connect user's have full dashboard access? Or just express access or no access at all?

lapis jewel
#

They do not have access for dashboard

#

you mean to use something like this?

  const customer = await stripe.customers.create(
    {
      email: session.customer_email,
      name: session.customer_name,
    },
    {
      stripeAccount: sellerAccountId,  // This associates the customer with the seller’s account
    }
  );
versed plume
#

Exactly

#

Gotcha, typically for those accounts we recommend doing charges where the payment intent and customer exist on your platform account. Is that what you are doing as well or are you creating charges on your connected accounts?

lapis jewel
#

You mean if i take fee for every customer payment?

versed plume
#

Basically, you want the Customer objects to exist on the same account(s) as the payment intents.

lapis jewel
#

Gotcha, i use stripe checkout session and destination account param

versed plume
#

Gotcha, then you will want to have the customers on your platform account.

#

One thing that will be helpful here is that you can pass customer_creation='always' when creating your checkout sessions for first time customers, that will tell Stripe to automatically create a new Customer object when the payment succeeds.

lapis jewel
#

Im not sure this one
For returning customers, you can pass customer='cus_1234' which will assosciate the session and resulting payment with that existing customer

When i send customer param for stripe checkout -> it will be connected with customer, not accunt, also customer is created after stripe checkout link for payment form

#

The case is that we have one customer that is owner of stripe account and owner will list his customers for which he generated stripe checkout url

versed plume
#

When i send customer param for stripe checkout -> it will be connected with customer, not accunt, also customer is created after stripe checkout link for payment form
It will be connected to both. The customer and intent are on your account, but the resulting payment intent will have the destination config that you set.
That said, unfortunately it doesn't look like there is a good way to list customers by the connected accounts that they have made payments to like this. You would need to either store that association on your side or create metadata on the customer object that stores the ID(s) of accounts it has made payments to

lapis jewel
#

i see, and then update account on webhook

#

i thnik now I understand

#

thank you for help

versed plume
#

Exactly. And the last piece is that the Customer search API can list customers by their metadata. So that would be a good way to list customers that have paid a specific account https://docs.stripe.com/api/customers/search