#devparry_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/1416067989807169718
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, that tax_rate was created, https://dashboard.stripe.com/test/logs/req_XqOz3JR1giyoCE using the Stipe Account header meaning that it belongs to the Connected Account. However, The request you shared, https://dashboard.stripe.com/test/logs/req_JgFCc8QHZ9RihO is making a destination request which means that the request id being made on the Platform Account
transfer_data: { destination: "acct_1..*****10mJ", },
You need to create the Checkout Session using the Stripe Account Header like you did when you created the Tax Rate
Here is my code for direct charges :
let checkoutSessionObj: Stripe.Checkout.SessionCreateParams = {
line_items,
mode: "payment",
customer_creation:"always", //// ( "always", "if_required" ),
billing_address_collection: "required",
phone_number_collection: {
enabled: true,
},
success_url: `${returnUrl}/status?success=1&o=${order.id}`,
cancel_url: `${returnUrl}?canceled=1&o=${order.id}`,
metadata: {
orderId: order.id,
storeId: storeId,
userId: userId,
},
shipping_options: deliveriesArray,
};
//// code for direct payment to connected account
const session = await stripe.checkout.sessions.create(
checkoutSessionObj,
{
stripeAccount: currentStore.connectedAccountId, //? Direct payment to connected account
}
);
And after that i follow destination-charges doc : https://docs.stripe.com/connect/destination-charges
and after i convert it :
checkoutSessionObj.payment_intent_data = {
application_fee_amount: platformFeeAmount, // 1.4% + currency-specific fixed fee
transfer_data: {
destination: currentStore.connectedAccountId,
},
};
console.log(":moneybag: Checkout Session Object || Message: ", checkoutSessionObj);
const session = await stripe.checkout.sessions.create(
checkoutSessionObj,
);
You can't mix these up
I am using function to create VAT for connect account :
const createTaxRateForConnectedAccount = async (
accountId: string,
vatValue: number,
status: boolean
) => {
try {
const taxRate = await stripe.taxRates.create(
{
display_name: "VAT",
inclusive: false, //? Set to true if VAT is included in the price
percentage: vatValue, //? Replace with your VAT percentage
country: "GB", //? Replace with your country code
description: "Value Added Tax",
active: status, //? Set to false if you want to deactivate the tax rate
},
{
stripeAccount: accountId, //? Specify the connected account
}
);
return taxRate;
} catch (error: any) {
console.log(":red_circle: Account Details || Error: ", error);
throw new Error(":red_circle: Account Details || Error: ", error);
}
};
Once the object is created on one account using Stripe Account Header that object belonfs to that account
You need to decide if you want to use teh Destination flow or the Direct flow and stay consistent there
so for destination charges we have to create VAT under Platform Account only not under connect account.
If you intend to use Destination Charges, yes that tax rate needs to be created on the Platform Account
okay, let me know your one suggestions:
As right now each connect user can create there own VAT Number, as we are now going to using destination charges and we follow the same process e.g allow connect users to create there own VAT and in backend it will be create under Platform Account so is there any duplicate VAT issue ?
Example :
Connect User 1 create VAT 20%
Connect User 2 create VAT 18%
Connect User 3 Create VAT 20%
Connect user 4 Create VAT 15%
and soo on ?
No, the tax rates will be on different accounts
and what if we can register 1000 + connect account under Platform Account ? will system allow to create that much or more then that VAT ?
You should be able to, why can't you reuse the the same tax rate for these for instance:
Connect User 1 create VAT 20%
Connect User 3 Create VAT 20%
If you can see the screen-shot right now we only deal in GB, but in next month we launch our system on other locations as well. where connect account can setup there business based on location as well so thats why we provide option to user to setup VAT rate as per their counrty location..
i hope you better understand my point now why i am asking this...
I see, that it should work: https://docs.stripe.com/api/tax_rates/create?api-version=2024-11-20.acacia
so that means stripe system can allow us to create VAT 1000+ ( kind of unlimited ) as well ?
As long as you make the calls sporadically and do not try to create the 1000 objects per second, sure: https://docs.stripe.com/rate-limits
this will be only create when any new business register on our platform and setup his account.
Sounds good!
as we going to increase in more country, new business users register with us, so VAT count also increase
my main concern about will stripe allow us to create VAT as many as users register, e.g 1k + or 5k 10k and soo on etc.
We don't have any limits today no
Are you running into an issue?
You can write to us if you run into an issue
no issue right now i am just confirmring
Yes, there is not a limit
cool
so now i have to just register VAT under the main account ( Platform Account ) and pass that VAT id into current code as it and it will be working fine with destination chargers
You can test this quickly, but yes you should no longer see the erro you saw on https://dashboard.stripe.com/test/logs/req_JgFCc8QHZ9RihO as the tax rate you pass will belong to the Platform Account
Thanks for help
Sure