Comments (20)
it works! thanks!
I found that if I used atob(CheckoutID)
directly in the first time, I would know this immediately !!
from storefront-api-examples.
thanks ~
from storefront-api-examples.
You need to get the customerAccessToken using customerAccessTokenCreate API.
https://shopify.dev/docs/storefront-api/reference/customers/customeraccesstokencreate
However, this library does not yet support customerAccessTokenCreate API.
from storefront-api-examples.
I've got the token. My problem is how to get checkoutID
from storefront-api-examples.
Is this?
const client = Client.buildClient({
domain,
storefrontAccessToken: token
})
const checkout = await client.checkout.create()
const checkoutID = checkout.id;
from storefront-api-examples.
I think the checkout id is the same as before logging in on the web.
from storefront-api-examples.
I think the checkout id is the same as before logging in on the web.
yse!
but here i click the log in button to open a new page , i can not know the checkout id before unless I use localstorage(or something) to save it
i thinks there is some way i can get the checkout id from the redirect url(xx.com/account/login?checkout_url=https://xxx.com/861536322/checkouts/46e3d1ec037401fad36db2fe880f7be8?key=b6b5dc0043e84a20b846a3ab1b3ffdc7&step=contact_information))
from storefront-api-examples.
The format of web url and checkoutId are different, so I don't think there is a way to convert it.
I think the only way to do this is to save the chekcoutId in your browser when you first create the checkout.
from storefront-api-examples.
There may be some way to convert to checkoutid from web url, like this #31 (comment) (get the customer id from reset url)
i have no idea~ i feel the document is not complete
from storefront-api-examples.
You try to Base64 decode your chekcoutId.
You will get gid://shopify/Checkout/xxxx?key=yyyy from your chekcoutId.
Then your redirect Url is
https://aaaa.myshopify.com/11111/checkouts/xxxx?key=yyyy
You can get the checkoutId by doing the reverse order.
from storefront-api-examples.
but here is a another problem , when i get checkoutID and use checkoutCustomerAssociateV2 to associate customer and checkout and get success
then i redirect the checkout page
it still show Already have account? Login in
looks like checkoutCustomerAssociateV2
not work ?
from storefront-api-examples.
I've seen before that for security reasons, Storefront login information can't be passed on to Shopify web site.
That means: even if you link with customer and checkout using the Storefront API, customer still need to log in on Shopify website.
from storefront-api-examples.
but i build my shopify website by storefront api
looks like MULTIPASS can do this
On web, the only way to accomplish this right now would be to use Multipass and its API to associate the customer accounts instead of using the mutation “customerCheckoutAssociatev2”. This will allow customers to be logged in and be directed to checkouts while remaining logged in. However this functionality is only available for Shopify Plus merchants right now.
But I can't find any documentation or examples to show me how to do this
from storefront-api-examples.
from storefront-api-examples.
thanks but
how to passing the customer access token using the X-Shopify-Customer-Access-Token
custom header in web broswer
from storefront-api-examples.
In that issue, "web browsers cannot send custom headers on a page fetch unfortunately. Key is just part of the identifier for the checkout."
from storefront-api-examples.
so the only way is MULTIPASS ? ...
from storefront-api-examples.
Yes, I think so.
from storefront-api-examples.
My pleasure.
from storefront-api-examples.
From the webhook you can get abandoned_checkout_url
abandoned_checkout_url=https://????.com/11111/checkouts/xxxx/recover?key=yyyy
xxxx is the token of checkout
The checkout ID using Storefront API is
base64_encode("gid://shopify/Checkout/xxxx?key=yyyy");
from storefront-api-examples.
Related Issues (20)
- How can we modify checkout weburl
- Query Products within collectionByHandle HOT 1
- React-graphql-client HOT 1
- Modifying Shipping Options (Rates, Description, etc)?
- react-js-buy example: checkout.totalTax and checkout.totalPrice do not exist on type 'Cart' HOT 1
- Unable to query checkout after it's created HOT 1
- Angular 9
- Customer Mutate storefront API limitations
- variantBySelectedOptions field doesn't exist on Product HOT 2
- Shopify Storefront API returning an empty products array HOT 2
- Is it secure to store API keys on the customer with unauthenticated_read_customers?
- Unable to Generate Storefront Token HOT 1
- How to get CustomerRecover to work? Getting undefined
- CustomerRecover not returning token it returns only userErrors HOT 1
- how to check valid or expired generated token by customerRecover before customerReset HOT 1
- Payment status callback
- How to clear localstorage/cookies (cart/checkout) on custom front-end?
- shopify returning an error indicated that the cart does not exist however fetching the same cart is successful
- Wrong response body when adding cart item to cart
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storefront-api-examples.