#uh oh - attach PM to Connect customer
1 messages · Page 1 of 1 (latest)
Yeah you'll just have to pass the stripe-account header of the connect account: https://stripe.com/docs/connect/authentication
<paymentMethodId>,
{
customer: <customer ID>,
},
{
stripeAccount: <connected account stripe id>,
},
);```
Like so?
Yeah that looks right to me
thank you so much!
No problem!
No such PaymentMethod:: OAuth key or Stripe-Account header was used but API request was provided with a platform-owned payment method ID. Please ensure that the provided payment method matches the specified account.
I'm getting this error when trying to attach to a customer under a connect account
Hello! I'm taking over and catching up...
That error is thrown when you're trying to use a PaymentMethod that exists on your platform in an API request made on a connected account. Can you tell me more about what you're trying to do at a high level?
I want to attach a card to a customer that is under a connected account
You would need to create that PaymentMethod on the connected account in that case.
Based on the error it would appear you created it on your platform instead.
Isn't this the api call?
<paymentMethodId>,
{
customer: <customer ID>,
},
{
stripeAccount: <connected account stripe id>,
},
);```
Basically, on Stripe Dashboard
That's something you do after the PaymentMethod is created. How are you creating the PaymentMethod in the first place?
I go under:
- Connect Tab
- Choose a Connect account
- Go under the Customers of that Connect account
- Click on a customer
- I have the ID of the Customer
- I have the ID of the Connect account
- I plug those values in the api call
I am creating it in the frontend and sending the payment ID to the backend
Can you provide more details about what "creating it in the frontend" means? Are you using Stripe.js?
and I use that to replace in this code
It sounds like you're initializing Stripe.js with only your platform's publishable key, so everything Stripe.js does will only happen on your platform account. You need to add in the connected account ID so the PaymentMethod is created on that connected account instead of your platform: https://stripe.com/docs/connect/authentication#adding-the-connected-account-id-to-a-client-side-application