#Gordiee-Checkout

1 messages · Page 1 of 1 (latest)

upbeat fable
#

Hi @haughty salmon , the current design of Checkout API requires you to provide shipping_address_collection param during creation, and there's no API to update the checkout session once it's created.
So I'd suggest you to collect the customer country in your own webpage first, and then use the country to create the checkout session.

haughty salmon
#

Hey @upbeat fable thanks for the reply! Its a bit of an awkward design paradigm to ask for country prior to checkout (and then ask the user to provide their address on the next page -- i.e. in the checkout itself), but I can give it a try. One of my main motivations for moving off the orders API to this new checkout API was to actually eliminate address capture in our application completely as it's such a complex / nuanced thing when dealing with addresses from all around the world. I was delighted to see stripe added this functionality, but this not being able to set the shipping options based on provided address is definitely s bit of a hurtle. I hope Stripe will add this in the future. For now, I've give your idea a try though.

upbeat fable
#

Thanks a lot for the feedback! I'll make sure to deliver it to the relevant teams.

Am I correct to say that you want to dynamically display the shipping_address field based on the billing address of your customer? i.e., if your customer choose Canada when inputing the credit card details, you want the checkout page to display the shipping_address.

haughty salmon
#

No, that's not what I'm saying. If you pass the shipping_address_collection option when creating a checkout session, then Stipe will add a field to the hosted checkout to collect the shipping address of the user.

I would like the shipping options shown in the hosted checkout page to be dynamically updated based on the shipping address country.

upbeat fable
#

Can you walk me through with an example?

haughty salmon
#

So here's an example ^^

#

I have created this checkout session above and passed the shipping_address_collection option to the checkout session which populates the above shipping address field.

#

The shipping methods (i.e. shipping_options) shown here were provided when I created the checkout session and are thus static.

#

It doesn't matter if my shipping address is in canada or australia or somewhere else. The shipping options will always be the same.

#

This isn't really feasible in real life as my cost to ship to canada is much lower than my cost to ship to australia (because were based in canada). So I'd like the shipping methods to update based on the provided shipping address. For example, I can offer free shipping in canada but I could never afford to offer that to someone living overseas as it would cost the business too much.

#

As a counter example, stripe's Automatic tax collection on the other hand does update the tax when the user changes their address in the shipping address field.

upbeat fable
haughty salmon
#

Sorry, I dont think you're following what I am asking. Maybe I'm just not asking it correctly.

#

Yes, I could set the delivery estimates. But that has nothing to do with dynamically showing shipping options for the customer based on their shipping address.

#

Moreover... that's actually a good thing to bring up. If you're collecting the user's address in the checkout, then how would you be able to set delivery estimates when you're creating the checkout session if you don't know where you're shipping to yet?

upbeat fable
#

Let me rephrase my asking

#

https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-shipping_options-shipping_rate_data-type currently Stripe only accept fixed_amount for the shipping rate, so basically your requirement to allow a "dynamic" type so calcualte the shipping fee based on the shipping address.

haughty salmon
#

Or just show a different list of shipping options based on the user's shipping address.

#

If you use any other ecommerce store you'd see that they first ask the user for their shipping address and then they calculate the shipping fee based on that address.

#

With stripe checkout, this isn't an option because the shipping options have to be provided when the checkout is created.

#

Anyways, it sounds like what I am asking for isn't yet possible. So I will have to find another way to support this.

upbeat fable
#

I'm afraid this feature is not avaialble yet, I'll relay you feedback to the Checkout team!

#

Thanks for your input to make our proudct better!

haughty salmon
#

Thanks jack