#john_api

1 messages ¡ Page 1 of 1 (latest)

atomic shoalBOT
#

👋 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/1338947353159139379

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

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

dense condor
#

hi! things are a little busy atm but i will take a look at this asap

#

ok looking at this now. in the example line of code the connectedAccountId is literally just the ID of the connected account

#

they look like this acct_1Nv0FGQ9RKHgCVdK and they're the identifier you use to make other requests to change an account or to make requests on behalf of the account

mint wren
#

I am not sure where does the accountId come from? Is it the id of the user's account on our platform?

#

@dense condor
Seems like this accountId is required for creating the account link.
so, is it specific to each user?

#

like - we first create the Account for the user and then create the account link?

dense condor
#

yes, if you look at the example frontend code you can see that the account ID is being passed into the request to create the account link

#
    if (connectedAccountId) {
      setAccountLinkCreatePending(true);
        fetch("/account_link", {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          account: connectedAccountId,
        }),
      })
        .then((response) => response.json())
        .then((json) => {
          setAccountLinkCreatePending(false);

          const { url, error } = json;

          if (url) {
            window.location.href = url;
          }

          if (error) {
            setError(true);
          }
        });
    }
  }, [connectedAccountId])```
#

(that's the example react code)

mint wren
#

thanks @dense condor
please let me know if I am missing anything in the steps below to onboard a user to Connect account:

  1. create Stripe Account for the user
  2. use the accountId to create an onboarding link
  3. redirect user to the link (hosted solution)
  4. process webhook event from Stripe to check the status of the Connect account
dense condor
#

yep that sounds about right!

mint wren
#

besides the accountId - is there any other id specific to the Connect account?

dense condor
#

there aren't any other identifiers, no

mint wren
#

both, Stripe Customer account & Connect account have accountId.
is there a way to know the difference between a Customer account and Connect account?

dense condor
#

they have IDs that look like this cus_NffrFeUfNV2Hib