#devparry_api

1 messages ¡ Page 1 of 1 (latest)

pale groveBOT
#

👋 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.

lavish plaza
#

You need to create the Checkout Session using the Stripe Account Header like you did when you created the Tax Rate

empty ruin
#

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,
    );

Create charges on your platform account, collect fees, and immediately transfer the remaining funds to your connected accounts.

lavish plaza
#

You can't mix these up

empty ruin
#

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);
    }
};
lavish plaza
#

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

empty ruin
#

so for destination charges we have to create VAT under Platform Account only not under connect account.

lavish plaza
#

If you intend to use Destination Charges, yes that tax rate needs to be created on the Platform Account

empty ruin
#

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 ?

lavish plaza
#

No, the tax rates will be on different accounts

empty ruin
#

and what if we can register 1000 + connect account under Platform Account ? will system allow to create that much or more then that VAT ?

lavish plaza
#

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%

empty ruin
# lavish plaza No, the tax rates will be on different accounts

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...

lavish plaza
empty ruin
#

so that means stripe system can allow us to create VAT 1000+ ( kind of unlimited ) as well ?

lavish plaza
pale groveBOT
empty ruin
#

this will be only create when any new business register on our platform and setup his account.

lavish plaza
#

Sounds good!

empty ruin
#

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.

lavish plaza
#

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

empty ruin
#

no issue right now i am just confirmring

lavish plaza
#

Yes, there is not a limit

empty ruin
#

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

lavish plaza
empty ruin
#

Thanks for help

lavish plaza
#

Sure