How if at all can I open the native POS draft order screen from my embedded POS app?
This is possible in the embedded app on Admin, but not POS from what I am finding.
On Admin we can simply:
open(`shopify://admin/draft_orders/<id>`)
The above technically works in POS, but it opens the Admin UI which is not ideal as this doesn’t give access to load to cart, also conflicts with the native embedded POS navigation getting users into a stuck state.
Admin/POS also has intents to open the native editors for Customers and what not, but Draft Orders or Orders not supported.
These intents work on POS for customers and what not too, but again no Draft Order support.
POS UI extensions can navigate, but not embedded?:
https://shopify.dev/docs/api/pos-ui-extensions/latest/target-apis/platform-apis/navigation-api
I’m at my wits end. Have not found if shopify POS registers any URI like ‘shopify:’. Really need a solution to handle this.
Any way to even open a UI Extension from it’s companion embedded page as a work around?
Things that don’t work.
navigation.navigate(
`shopify:point-of-sale/draft_orders/<id>`
)
open('shopify://point-of-sale/draft_orders/<id>');
open('shopify:point-of-sale/draft_orders/<id>');
open('shopify-pos:point-of-sale/draft_orders/<id>');
open('shopify.pos:point-of-sale/draft_orders/<id>');
open('pos:point-of-sale/draft_orders/<id>');
shopify.intents
.invoke('edit:shopify/DraftOrder', {
value: <id>
})
Also web component <s-app-window> seemed promising maybe where I could at least open up the admin editor within the app but doesn’t seem to support non-internal urls.
Hi @Wesley_Darnell — there’s no public way to deep link into POS’s native draft order screen. POS isn’t Admin, so the `shopify://` URIs that work in your embedded admin app just resolve to Admin routes, which is exactly what’s loading and fighting the native POS navigation. The POS UI extensions Navigation API only moves between targets declared in your own extension TOML, not native surfaces, and there’s no API for an embedded POS app to launch a POS extension either. Worth asking Shopify directly whether draft order support is planned. Realistically you’d build the draft order inside a POS UI extension using the Cart API plus Admin GraphQL `draftOrderCreate` and `draftOrderComplete`.
@Sophia_24
I’m essentially hoping the right eyes see this and can get an internal feature request in. Definitely one of many drawbacks of integrating with POS right now.
Adding a draft order to cart manually with the cart api is very less than ideal as it breaks the entire flow of using draft orders. They won’t be completed on sale, sales rep attribution, audit history showing it started as a draft order is lost, timeline comments. ETC. Wild the cart API can’t take a draft order ID and load to cart like the UI.
My use case is the draft orders are already created and prepared via API.
The embedded app has records linked to the draft orders which knows their id’s.
Now I could pull the full draft order info, and display it in my own UI and implement buttons to at least complete or sell it, but even just typing this sounds like chaos as that’s not at the POS. This is checking out in-front of a human. That would have to be an invoice link, or marked unpaid, and still manually navigated too in the POS. Awfully messy.
I think I will have to forgo the idea of trying to help users get to the existing known draft order from inside the embedded app.
Hey @Wesley_Darnell — the real fix for the “load to cart” part is the POS UI extension Cart API, not a deep link. From a tile or modal target you can call shopify.cart.addLineItem, addCartCustomSale and addCartDiscount, so items land in the associate’s live POS cart and they finish the sale natively. A companion embedded page can’t open a modal, and POS doesn’t register a draft_orders URI. If you genuinely need the DraftOrder object, create it server-side with the Admin GraphQL draftOrderCreate, though the native editor still won’t open. Which POS target are you building?