Shopify POS Cart Extension

conrad-decker
Shopify Expert
59 0 13

I originally posted this in the Shopify POS board but figure this is actually probably a better location for it...

 

I'm in the process of moving an older custom built loyalty program to utilize the newer "POS Cart Extension" functionality. It seems like a great opportunity to enable more custom loyalty workflows which I was excited about. Unfortunately, it's proving to be more limiting than what I had built previously which just used the POS Embedded App SDK. Previously, our staff could add a customer to a cart, choose an option from the cart options to view the customers rewards balance and then apply rewards directly from there. If they had more rewards available than the cart value, it would only apply the rewards that matched the cart value. 

With this new functionality, it streamlines most of the heavy lifting that I was having to do on my own which is great but there's no way to know how what the actual value of items in the cart are which makes it mostly unusable. I realize I may be alone here but figured I'd surface it regardless.

Please feel free to let me know if I'm mistaken but from what I can tell...if a customer has $100 in rewards but the cart value is only $50. I really only have the option to apply the full $100 discount to the cart which would technically remove it from the customers reward balance. What'd I'd like to see is the opportunity to offer them to pay $50 using their rewards instead of the entire $100. The customer will certainly be disappointed when they realized we applied their entire $100 rewards to a $50 purchase. Alternatively, I'm guessing the thought is that I could offer incremental awards ($10, $25, $50, $100) and rely on the cashier to choose which is most appropriate but that leaves a lot of room for human error - nothing is keeping the cashier from hitting that $100 promotion and then the customer is in the same situation. It just feels like a lot is missing from this implementation - or, I just expected too much? Am I missing something? 

I guess I could apply the entire $100 and store some sort of information on the order to look it up at a later time and reconcile it behind the scenes - but that just feels gross. 

Is this the long term plan for the functionality? Or are there more updates coming that are worth knowing about? 

I'm surprised I haven't seen more people running into the same issue, this is the only other post that seems to be relevant: https://community.shopify.com/c/Shopify-Reunite/New-POS-integration-actions-required-cart-data/m-p/7...

0 Likes
conrad-decker
Shopify Expert
59 0 13

Anyone at Shopify have any insight here?

0 Likes
conrad-decker
Shopify Expert
59 0 13

Hellllloooooo? Anyone from Shopify? Anyone at all? Every time I speak to someone on the "support" team, they point me to these forums and tell me that I'll get a response "quickly" by someone on the Shopify technical team. That seems to be very far from the truth - as evidenced here 🤦🏻‍ 

0 Likes
Greg_Kujawa
Shopify Partner
1016 83 227

While I don't work for Shopify, I would ask a couple of questions about your original post.

  • Your custom app was previously deployed utilizing the Embedded POS SDK, correct? Does it currently not work or something? I have read that Shopify urges customers to use the App Bridge SDK as opposed to the Embedded POS SDK moving forward, although I didn't think the Embedded POS SDK was rendered useless.
  • I'm not sure where you track customer rewards, since your original post didn't specify. If it's a third-party system then your middleware app would be able to make an API call out to obtain a customer's rewards balance, right? And the POS "Edit Cart" functionality should allow you to apply any rewards credits in the form of a discount on a particular line item, right?

In my own situation, I have some experience with the Embedded POS SDK. And my middleware can all any third-party API's, call the Shopify API, etc. in order to interact with Shopify POS. How I choose to build out that functionality is up to me as the API consumer I suppose... 

 

0 Likes
conrad-decker
Shopify Expert
59 0 13

Sure, thanks for the response Greg. I know it sounds like I'm being difficult here but I'm really just trying to get some insight into how native Shopify functionality works and it seems more and more difficult to get an answer these days. Let me provide some more insight on our use case and hopefully Shopify will respond as well...when they get some time. Would certainly appreciate any insight you might have, of course.

Background: We've got a loyalty program that we've built that tracks purchases and provides cash back incentives to customers. At the moment, if there is a customer added to a cart in the POS, staff can choose an option to "Pay With Cash Back Rewards" - that currently opens a modal using the App Bridge SDK(not the Embedded POS SDK), it shows how much cash back a customer has and allows the staff to use some, or all, of that cash back to pay for the customers order. Unfortunately, the way we've had to handle that for years is by adding a cart discount in the amount of the cash back that is being used. It's not a huge deal but not ideal as we can't apply any other cart discounts. The major thing to note here is that, during that process, we have access to information about the cart and a subtotal. That allows us to determine how much cash back should be applied. For example, if the cart subtotal is $100 but the customer only has $10 in cash back, we apply the full $10. On the flip side, if the cart subtotal is $5 but the customer has $10 in cash back, we only apply $5. This is what presents the challenge when using the POS Cart Extension functionality that Shopify released early last year.

Current State: Specifically, I'm referencing this functionality: https://shopify.dev/docs/pos/pos-cart-app-extension and the reference can be found here: https://shopify.dev/docs/pos/reference. The "discount" functionality that Shopify is providing here makes a lot of sense for our use case. Give Shopify the endpoints that we want them to hit, offer the discounts specific to a customer based on their cash back rewards, and immediately deduct those rewards from their account using the "perform_action". If a customer decides not to use their rewards, use the "revert_action" functionality. This provides a lot of improvements over our current implementation as it doesn't require us to utilize a cart discount and it all happens in the cart, instead of us having to look through orders after they've been placed to extract how cash back has been used. The one flaw, pretty major from what I can tell, is that when using this functionality...there's no way to get information about the cart which means we have no idea what the subtotal of the cart is. From what I can tell (and I may be missing something completely obvious here), here's how this flows...

  1. In Shopify POS a customer is added to a cart. Shopify hits our "promotions endpoint" with information about the shop (shop_id) and customer (customer_id) and we send back a JSON response that includes information about promotions - or, in our case, discounts we would like to provide to that customer. Let's say this specific customer has $10 in cash back rewards...then we send a payload back to Shopify with information on the discount we would like to offer the customer. It would look like this on the new pos system (this screenshot was provided by Shopify, we would customize it to our needs to read something like $10 Cash Back): https://shopify.dev/assets/api/pos/loyalty-next.jpg

  2. If they customer would like to use that discount, the staff member hits that button, Shopify fires another request to our "perform_action" endpoint, and we update information on our side accordingly. In the POS, this cart has now applied the discount that we offered. 

This is great! It does everything we had done previously but better and removes a lot of the heavy lifting that we've had to do on our own.

Unfortunately, from what I can tell, where all of this falls apart is the fact that the initial request that is sent to our promotions endpoint doesn't include any context on the actual cart. That means that we don't know if the subtotal on the cart is $10 or $100 or $1000 which makes providing a discount a little bit more complicated. Best case scenario, the amount of cash back a customer has is always more than the subtotal of the cart - but that rarely happens. So, hypothetically, if the cart subtotal is $5 and the customer has $10 in cash back, the best I can do is offer a $10 discount. A customer will likely be disappointed in the fact that we've used all of their $10 cash back on a $5 order.

What I would have expected to see is the opportunity to offer them to pay $5 using their rewards instead of the entire $10. Alternatively, I'm guessing the thought is that we could offer incremental discounts ($1, $5, $10) and rely on the cashier to choose which is most appropriate but that leaves a lot of room for human error - and nothing is keeping the cashier from hitting that $10 promotion and then the customer is in the same situation. It just feels like a lot is missing from this implementation - or, perhaps, I expected too much. Am I missing something obvious?  

So, my question remains, is this really the long term plan for this functionality? Or are there more updates coming that are worth knowing about? 

Greg_Kujawa
Shopify Partner
1016 83 227

Thanks for the very comprehensive explanation! While I haven't heard of this package, looking at the docs it indeed lacks any visibility into the user's cart. I checked my own Embedded POS SDK pages, and think you might have a workaround there. Assuming you control the embedded code that is giving you trouble.

Try including this script at the top of your page --> https://cdn.shopify.com/s/assets/external/pos_app.js. This is the deprecated SDK that I am using, so I can't guarantee that it will be available long-term. Although similar functionality could be achieved via also including the Shopify App Bridge which is current.

Anyhoo, once you have access to those script functions and elements, you can fetch the user's cart. Described here --> 
https://shopify.dev/tools/pos-app-sdk/methods#cart-fetch. The cart subtotal is listed there.

Is this a start? While not an answer it's worth a try!

0 Likes
Greg_Kujawa
Shopify Partner
1016 83 227

If the Embedded POS SDK doesn't suit you due to it being deprecated (although still available), then you can include the Shopify App Bridge SDK as a script file, by adding https://unpkg.com/@shopify/app-bridge to the top of your page. Then you can fetch the user's cart through its inherent methods. Described here --> https://shopify.dev/tools/app-bridge/actions/cart

0 Likes
conrad-decker
Shopify Expert
59 0 13

Hey Greg, yeah man, thanks a bunch for the responses. I certainly appreciate you taking the time!

At the moment, that is exactly what we're currently doing. We originally built this functionality out using the Embedded POS SDK several years ago, and migrated to the App Bridge SDK last year. That doesn't pose any problems, it works just fine that way. There are some downsides...like I said, having to use a "Cart Discount" isn't ideal but it works. I guess the bigger question is...what is this the new cart extension functionality actually supposed to do? I thought it was perfect for something like this - a loyalty program - but perhaps that isn't the intended approach. In it's current state, it doesn't really seem like it's overly beneficial for too many use cases? 

¯\_()_/¯

And really, this is why I'm just trying to get eyes on it from someone on the technical team at Shopify. I'm genuinely curious if I'm missing something obvious. Unfortunately, it seems near impossible at the moment   

policenauts
Trailblazer
170 8 29

You might have better luck creating this as an issue on the app bridge github page: https://github.com/Shopify/shopify-app-bridge/issues

Or the https://shopifypartners.slack.com/ App Bridge channel

0 Likes
conrad-decker
Shopify Expert
59 0 13

Hey, thanks for the response! Unfortunately, the issue I’ve described isn’t related to the App Bridge SDK at all. I’ve mentioned that multiple times in the thread above. The functionality I’m referencing is described here: https://shopify.dev/docs/pos/pos-cart-app-extension.

This is completely different, native functionality, that should work without the need for any SDK. 

0 Likes