For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
There are many api of checkout with required checkoutId but no document about how to get checkoutId.
Hi Sodoo,
When you use the API to create a new checkout, the response typically includes a checkout ID. For example, in Shopify, when you create a new checkout using the Storefront API, the returned Checkout
object includes an id
field which is your checkout ID.
Here is a mutation example using GraphQL:
mutation {
checkoutCreate(input: {
lineItems: [{ variantId: "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0VmFyaWFudC8yOTEwNjAyMzY5NTA=", quantity: 1 }]
}) {
checkout {
id
}
}
}
In the response, you'll get something like:
{
"data": {
"checkoutCreate": {
"checkout": {
"id": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC9kMTZmM2EzMDM4YjMzNzFlOWZjMWE3MmNjNGQ5ZDk3Mz9rZXk9YjdlMmZmMjg1YzgwZDdlNmE1ZDc4YWM5ZGY3YmE4MTE="
}
}
}
}
The value of id
is the checkout ID you need.
Hope this helps!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hello Liam is it possible to get numeric checkout id wichh we can see in admin orders at the end of the page #37947591590172 like this