#navin_sharma

1 messages · Page 1 of 1 (latest)

rugged sinewBOT
short zealot
#

hi! do you have more context like the request ID req_xxx from the error itself, and what overall you are trying to do in your code?

brave sparrow
#

i've a stackoverflow link can i share here

#

REQ_ID====>
req_xDFLd5e473Pcnm

brave sparrow
brave sparrow
short zealot
#

well the problem is you are passing the ID of this customer cus_NuUILWn7H1b2pB, and that customer does not exist on the connected account(the stripeAccount you pass), it exists on your platform.

#

that's totally expected. One solution would be to create that Customer object on the connected account , by passing stripeAccount on the call to stripe.customers.create() as well.

short zealot
brave sparrow
#

yes im using the same

#

const customer = await stripe.customers.create({
name: name,
email: email,
phone: phone,
});

#

const stripe = Stripe(CLIENT_SECRET);

#

my question is here key should be either payment accounts or connected account ??

short zealot
#

it's always your account

#

you always use the API keys of your own platform account.

#

you can use stripeAccount as an option to run an API call on another account, as was explained in the answer.

brave sparrow
#

GOT IT

#

But my use case bit different, ive inegrated for crowdfunding platform here campaigns admin or owner are connected account and the person who came to donate are customers..

But when we create customer on Payment account . we are getting customer not found error.

short zealot
#

yes

brave sparrow
#

If we create on connected account we can't make connected account keys dynamic

short zealot
#

we can't make connected account keys dynamic
what does that mean?

brave sparrow
#

Can you guys help me with this confusion Pls

rugged sinewBOT
brave sparrow
short zealot
#

you never use the keys of a connected account, never.

#

you always use the keys of your platform account, and you can use stripeAccount as an option to run an API call on another account.

brave sparrow
#

YES as u said when i run create.customers passing connected as stripeAccount from frontend it will not validate it

#

message
:
"Invalid API Key provided: undefined"
type
:
"invalid_request_error"

trail sinew