#cfbo-billing-address-restriction

1 messages · Page 1 of 1 (latest)

jagged raven
cunning fjord
#

Hi thanks for coming back to me.

#

I will attempt to explain my business case better

#

(Sorry I had to answer a call)
I have implemented an initial PoC that integrate our SaaS platform with Stripe.
After that, the business person in our team looked at how Stripe works (from a business / tax perspective) and they think we cannot support users from all over, because they need to manually pay taxes in each single country

#

that's the reason we they think we should limit the creation of subscriptions to customers with a billing address in a limited set of countries

#

I am not sure yet what is the best approach to support this

#

Is there anyone who could provide some guidance around this topic?

#

I bet it's quite a common scenario: as a business who created a SaaS platform and is using Stripe to handle subscriptions, I want to limit the countries that we can support (due to taxes reasons)

#

My current idea is that we need to handle this internally, in our platform, gathering information on the billing adress and the blocking users from non-supported countries

jagged raven
#

I was thinking this billing address could be checked when the customer is created, before the customer proceeds to checkout and any payment handling, you could make sure within your code to ensure this billing address is within the country you would like to support before proceeding further.

#

I believe we have the idea! 😄

cunning fjord
#

Yes I think that's the way forward. Thanks.

#

Can I ask one last question?

#

I know this discord channel is mostly about tech support

#

So I guess you cannot answer that topic about taxes, in other words

#

is there a way to get support about tax management?

#

I am not doubting what our business person has found, but I find it a bit odd that as a business we will have to pay taxes in each single address where our subscribers are based (based on their billing address)

#

that's a lot of work

#

I would have thought stripe could facilitate that part

#

Can you provide any feedback on that based on your experience?
If not, can you direct us to another support channel about that topic?

grand brook
#

AFAIK you don't actually pay tax to the local countries but I could be completely wrong, I'm just an engineer. You can ask our support team but I don't think Stripe can give you the answers you want here, you'd want to work with a tax advisor for your business directly.

cunning fjord
#

What you sent works only within the EU from what I understand

#

Anyway, thanks for your help on that
I have another technical question

#

I am attaching a screenshot with the notes I have taken about the possible solution I see for my problem

#

Before now I was automatically creating the stripe customer in the backend, while I think I will need to add a step to create the customer and collect their address first

#

then I would want to create a checkout session, where I would pass customer and I want to make sure that the billing address cannot be changed at that point

#

the code I have right now is like that

async function createStripeCheckoutSession(req, customer, userInfo, priceId) {
  console.log("createCheckoutSession called");
  const quantity = "1"; // always 1 subscription
  const client_reference_id = userInfo.cognitoUsername;
  const url = buildFrontendProfileUrl(req);
  const session = await stripe.checkout.sessions.create({
    payment_method_types: ["card"],
    customer: customer.id,
    line_items: [
      {
        price: priceId,
        quantity: quantity,
      },
    ],
    mode: "subscription",
    client_reference_id: client_reference_id,
    metadata: {
      userEmail: userInfo.email,
      amplifyEnv: env
    },
    // TODO requires activation in Stripe Dashboard
    // Activate Stripe Tax to monitor your tax obligations, automatically collect tax, 
    // and access the reports you need to file returns.
    // automatic_tax: { enabled: true }, 
    // Stripe redirects to this page after the customer successfully completes the checkout.
    success_url: url,
    // Stripe redirects to this page when the customer clicks the back button in Checkout.
    cancel_url: url,
  });
  return session;
}
grand brook
#

You can pass an existing customer when creating the CheckoutSession and it prefills things(you have the code for that right there yep)

cunning fjord
#

how do I make sure that the billing address cannot be changed in checkout

#

ok

grand brook
#

I don't think you can — I assume you tested it and the customer could change it?

cunning fjord
#

I have done tests yes but wasn't a 100% sure
you know

#

it's not like there is a clear option on the API

grand brook
#

yep. So to be clear there are two addresses at play here

#

there's customer.address on the Customer object and there's also the address on the payment method (payment_method.billing_details ), Checkout only collects the latter one, it doesn't collect or change customer.address

cunning fjord
#

ok...

#

so if I create a customer with an address

#

and pass that customer

grand brook
#

If you’ve already collected your existing customers’ addresses, you can base the tax calculations on those addresses rather than the addresses collected during checkout
as it says there. It seems like what you want.

#

the billing address entered on the checkout page is the address of the card, but that's not the same as what we use for the tax calculation

#

since e.g. you could be living tax-resident in Germany but have a French credit card from back when you lived there

cunning fjord
#

we will be using stripe tax

#

for automatic calculation

#

but still our tax expert is quite sure that's only one side of the story
we will support only customers from eu, uk, us
i will have to run some tests and make sure to find a the technical solution that fulfils the following requirements:

  1. block creation of customers from non allowed countries;
  2. make sure to tax are computed based on country from customer address
  3. make sure the invoice shows the billing address
grand brook
#

as far as I know that's all completely possible. The only tricky thing is 1., you probably want to ask the customer before Checkout what country they're in and then decline to process their order(you mentioned you collect the address yourself so that seems quite possible)