App Bridge Cart Update event no permission

Solved
Highlighted
New Member
5 0 0

Am trying to create a private app for a client, but can not add items to the cart. Am able to create the cart, but it throws a permission error when I try to add items. uncaught exception: AppBridgeError: APP::ERROR::PERMISSION

 

0 Likes
Highlighted

Success.

Shopify Staff
Shopify Staff
48 21 5

Hi @kmsoni 

 

Your app may miss read_orders or write_orders permission. You can rebuild auth url and add one of them in scope. https://help.shopify.com/en/api/getting-started/authentication/oauth#step-2-ask-for-permission

 

Also, cart action can only be accessed via cart pos link. You will see permission error when request cart from apps list.

 

I hope it helps. 

 

0 Likes
Highlighted
New Member
5 0 0

I am confident the permissions are okay, I was simply using the cart from Apps list. How do I use Cart via POS link? Does it mean I only have to access the App from the POS app? If yes, how do you advise I handle testing?

0 Likes
Highlighted
Shopify Staff
Shopify Staff
48 21 5

Hi @kmsoni ,

 

In order to create POS link, you access to Manage embedded POS app https://help.shopify.com/en/api/embedded-apps/app-extensions/shopify-pos/embed-in-shopify-pos. You will find POS link there. When creating new link, you need to select "Edit cart" in "Page to show link" dropdown menu. 

 

Does it mean I only have to access the App from the POS app?

 

I am not quite sure what you mean for this question. However, you can only have access to Cart in Point of Sale app. If you build app that work for Shopify Mobile and Point of Sale, you can use feature detection to detect if cart feature is available https://help.shopify.com/en/api/embedded-apps/app-bridge/actions/cart#requirements

 

Thanks, 

Henry

0 Likes
Highlighted
New Member
5 0 0

Thanks for the help so far, with your pointers I was able to do much of the work. Now am stuck at the point of adding inventory items to the cart as line items. I am able to add hard-coded items, however I need to add items from the inventory on being selected from a resource picker. Two questions;

  1. What option do I have to add when initializing a resource picker to as to be able to select the number of items I need for a particular item? Note that am able to select multiple items, but not able to select for example 2 or 4 of a particular item.
  2. I can't seem to find the variantid from the selected items (which I suppose should be able to make the inventory items reduce in number on checkout).
0 Likes
Highlighted
Shopify Staff
Shopify Staff
48 21 5

Hi @kmsoni ,

 

App Bridge Resource Picker support filtering with `initialQuery` https://help.shopify.com/en/api/embedded-apps/app-bridge/actions/resourcepicker#options. You can use search syntax to limit the number of items https://help.shopify.com/en/api/getting-started/search-syntax

 

Both product and productVariant pickers can return variants, unless you specify `showVariants` false. You can also set it to true and see. 

 

Thanks, 

Henry

0 Likes