FROM CACHE - en_header

Checkout URL with store's domain

Solved
kcin1993
Shopify Partner
49 0 1

Hi all, 

Our app use Create Checkout API to generate the checkout page. We get the property "webUrl" and redirect the customer to the checkout page.

We face an issue is that the webUrl return the checkout URL base on ".myshopify.com". Such as 

https://OOOOXXXX.myshopify.com/373731323475/checkouts/4cd3f97a7761cec8e863adsj2cd0e79e

Is there any way to return the store's domain rather than .myshopify.com?

 

Note.1 

I know we can replace the .myshopify.com to the store's domain. But it will cause the checkout token change which will let our app lose track of the checkout and the order. It's a matter because our app needs to record each checkout's token when it was generated.

 

Thanks for help!

Accepted Solution (1)

Accepted Solutions
_JB
Shopify Staff
Shopify Staff
836 99 211

This is an accepted solution.

Hey @kcin1993,

The best place to follow is the changelog, changes will be posted there in advance.

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 6 (6)
_JB
Shopify Staff
Shopify Staff
836 99 211

Hey @kcin1993,

At this time the storefront API doesn't officially support using the store's domain. As you mentioned it's possible to manually change the URL, but this can cause issues with session and cart details being lost. We're looking in to adding support for this on Storefront API, any changes will be announced in the changelog so keep an eye there for updates. 

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

kcin1993
Shopify Partner
49 0 1

@_JB 

Thanks for your reply. 

Is there any way I can follow on this issue when the API is updated?

 

_JB
Shopify Staff
Shopify Staff
836 99 211

This is an accepted solution.

Hey @kcin1993,

The best place to follow is the changelog, changes will be posted there in advance.

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

byron_codes
Tourist
4 0 6

Has there been any updates in this regard? I see that the websites that Shopify advertises as being on Shopify Headless all use a checkout.domain.com style URL and was wondering if this is now officially supported.

floriano76
Tourist
3 1 2

Hey, @_JB 

 

We are in 2022. For sure we have something that allows us to use our custom URL with the headless api, right?

byron_codes
Tourist
4 0 6

Hey @floriano76,

Whichever domain you access the storefront API from is the domain that will appear when you query for the checkout url from the storefront API. If you use the custom domain, the custom domain is what will appear in the checkout url without any changes.