#hammad-umar_api
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.
âąď¸ 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/1265988623548026962
đ 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.
- hammad-umar_code, 2 hours ago, 19 messages
Sure, you can build a completely custom onboarding UI/flow using the API directly: https://docs.stripe.com/connect/api-onboarding
It's not really recommended in most cases as it's an intensive integration
Build your own onboarding flow using Stripe's APIs.
router.get("/testing-stripe-exp", async (req, res) => {
try {
const account = await stripe.accounts.create({
type: "express",
country: "US",
email: "toseef@gmail.com",
capabilities: {
card_payments: {
requested: true,
},
transfers: {
requested: true,
},
},
});
const accountLink = await stripe.accountLinks.create({
account: account.id,
refresh_url: "http://localhost:5002/redirect",
return_url: "http://localhost:5002/redirect",
type: "account_onboarding",
});
// acct_1PgOn8PoK1icUARN
const transfer = await stripe.transfers.create({
amount: 2000,
currency: "usd",
destination: "acct_1PgOn8PoK1icUARN", // Stripe Account ID.
});
return res.json({
account,
accountLink,
transfer,
});
} catch (error) {
console.error("Error creating bank token:", error);
return res.status(500).json({ message: error.message });
}
});
Here is the code just for the testing, Can I use the correct API's for creating user accounts and generating account links then create payouts for their bank accounts ?
Wait, I thought you didn't want to use Account Links? Your original question:
Can we create a custom onboarding process without redirecting the user to accountLink.url ?
This is my use case:
I want to create an application in which user can create express accounts and admins can release funds to their accounts. Because we have mobile application using flutter we want to create custom onboarding flow for mobile app not using the web. ???
This is my use case:
I want to create an application in which user can create express accounts and admins can release funds to their accounts. Because we have mobile application using flutter we want to create custom onboarding flow for mobile app not using the web. ???
Then sure, using the API as I already described
ok then we don't need accountLink ?
No
And is this the correct api for releasing funds to user bank accounts ?
const transfer = await stripe.transfers.create({
amount: 2000,
currency: "usd",
destination: "acct_1PgOn8PoK1icUARN", // Stripe Account ID.
});
No, that will transfer funds to their Stripe account balance. Moving money to an external (bank) account is done via a payout
can you share the API details ?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Can you guide me further ?
If I am an admin and i want to send money to any user bank account can you share any code snippet for that in node.js ?
I got this error when i want to create a payout to externel account ?
{
"message": "Cannot create payouts: this account has requirements that need to be collected. Please provide those fields to re-enable payouts."
}
router.get("/testing-stripe", async (_, res) => {
try {
// Create a Stripe Custom account
const account = await stripe.accounts.create({
type: "express",
country: "US",
email: "hammadumar8080@gmail.com",
business_type: "individual",
individual: {
first_name: "Hammad",
last_name: "Umar",
},
capabilities: {
card_payments: { requested: true },
transfers: { requested: true },
},
});
// Create a bank account token
const token = await stripe.tokens.create({
bank_account: {
country: "US",
currency: "usd",
account_holder_name: "Hammad Umar",
account_holder_type: "individual",
routing_number: "110000000",
account_number: "000123456789",
},
});
// Attach the bank account token to the Custom account
const bankAccount = await stripe.accounts.createExternalAccount(
account.id,
{
external_account: token.id,
}
);
// Make transfer to the bank account.
// const payout = await stripe.payouts.create(
// {
// amount: 10000, // Amount in cents (e.g., $100)
// currency: "usd",
// destination: bankAccount.id,
// },
// {
// stripeAccount: account.id,
// }
// );
return res.json({
account,
token,
bankAccount,
// payout,
});
} catch (error) {
console.error("Error creating bank token:", error);
return res.status(500).json({ message: error.message });
}
});
Please review that code only problem with payout statement
Yep, sounds like your account has not been onboarded/verified correctly. You'd either do that via the Account Link, or using the API directly with test data to transition account to a verified state: https://docs.stripe.com/connect/testing