Accessing Completed Order Details in Shopify POS UI Extensions

Accessing Completed Order Details in Shopify POS UI Extensions

Scrogy
Shopify Partner
3 0 1

Dear Shopify Community,

I am currently developing a custom UI extension for Shopify POS and am seeking guidance on how to access the details of a completed order within the extension. Specifically, I aim to retrieve and display information such as the list of purchased items, total amount, customer details, and other relevant data pertaining to the finalized transaction. In other words, I want to access to the purchase receipt.

The goal of the extension is to send the purchase receipt to our server.

Is there any way to do this? I've been reading all the docs and searching in forums, but I didn't found any way.

Thanks

Replies 3 (3)

rajweb
Shopify Partner
571 48 110

Hey @Scrogy ,

To access completed order details in a Shopify POS custom UI extension, use the Shopify Admin API to fetch the order details after the transaction. You'll need to make a request like this to get the order data:

fetch('https://your-shop.myshopify.com/admin/api/2024-01/orders/{order-id}.json', {
  method: 'GET',
  headers: { 'X-Shopify-Access-Token': 'your-access-token' }
})
  .then(response => response.json())
  .then(data => console.log(data.order));

You can then send the receipt to your server using a POST request. Consider using webhooks (e.g., orders/create) to automate this process when an order is completed.

If I was able to help you, please don't forget to Like and mark it as the Solution!
If you’re looking for expert help with customization or coding, I’d be delighted to support you. Please don’t hesitate to reach out via the email in my signature below—I’m here to help bring your vision to life!

Best Regard,
Rajat

 

-Need a Shopify developer?
https://rajatweb.dev/
Email: rajat.shopify@gmail.com
Scrogy
Shopify Partner
3 0 1

Hi @rajweb ,

Thanks for your answer! I will try this tomorrow and update this post with the results 🙂 

Scrogy
Shopify Partner
3 0 1

Hi again @rajweb 
Sorry for not updating fast.

I've been trying a lot of ways to get this working with your solution and others too. But I am not being able to fetch the order from the API.
I think the main problem is that I am building an extension only, and in this way I can not have a valid access token, but I am not sure