#d3levv_code
1 messages ยท Page 1 of 1 (latest)
๐ 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. Thank you for your patience!
โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.
๐ 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/1214896229885153312
๐ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
import { stripeInstance } from "@/stripe";
import { NextApiHandler } from "next";
const handler: NextApiHandler = async (req, res) => {
const { method } = req;
const stripeId = req.query["stripe-connect"];
if (method === "GET") {
try {
const account = await stripeInstance.accounts.create({
type: "custom",
country: "NL",
business_type: "company",
capabilities: {
card_payments: {
requested: true,
},
transfers: {
requested: true,
},
},
});
const stripeLink = await stripeInstance.accountLinks.create({
account: account.id,
refresh_url: "https://example.com/reauth",
return_url: "https://example.com/return",
type: "account_onboarding",
});
res.redirect(stripeLink.url);
} catch (e: any) {
console.error(e);
res.status(400).json({ error: e.message });
}
} else if (method === "POST") {
res.status(200).json({ success: "true" });
} else {
res.status(200).json({ success: "true" });
}
};
export default handler;
This is my nextjs api route
๐ happy to help
when you create an Account Link, you are asking your merchant to use the Stripe Hosted Onboarding flow, meaning you can decide which requirements (https://docs.stripe.com/api/account_links/create#create_account_link-collection_options) you want to collect (currently_due default, eventually_due, or both) but you can't decide what to show. The flow will try to collect all of the missing information from the KYC process
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
what you can do is pass in information when creating the account https://docs.stripe.com/api/accounts/create to reduce the number of requirements by manually submitting details to the API
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
but that's the extent of the "customization" you can do
So how does the current platform achieves this? Hm
I'm not sure I understand the question
do you mean how can you update the info of a custom account using the API?
this is how it currently operates, when you fill the KVK number you have these options
So my question is is this done using accounts.create + accountLinks and if so, what settings should i add to them ?
So some user details are collected then accounts.create is triggered with type custom exc.. then account link is created. When redirected the only information that should be collected is the KVK number witch prefills the data like shown in the pictures above
I am having hard time trying to get the accountLinks to not include any other fields other thant the kvk field
this is because you haven't passed the KYC information to the Stripe API
you need to look at the doc I linked above
ah i see so when accounts.create i need to provide the required information, then the only field that will show is the kvk. But how to verify that kvk number is correct ?
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
I don't know how KVK numbers work so I can't say much, unfortunately.