How Shopify Scripts work in Storefront API?

matt_mortek
New Member
2 0 2

Hello, I've a simple question - how Shopify Scripts affects Storefront API? In which API queries does it update prices? 

I've published a new Shopify Script in Script Editor but I don't see it updates anything in API response. Neither in product queries nor in new cart API queries...

Replies 5 (5)
Jason
Shopify Expert
10873 190 2178

Was the Shopify Script published for the Storefront API? You need to specifically set it to work there and will be online storefront only by default.

★ I jump on these forums in my free time to help and share some insights. Not looking to be hired, and not looking for work. http://freakdesign.com.au ★
abeaclark
Shopify Partner
5 0 2

@matt_mortek Were you able to solve this?

 

I have several clients where scripts are not working out our storefront app even after being enabled.

 

We are using the storefront graphql API to create / update carts and checkouts, but never see the scripts run

 

abeaclark
Shopify Partner
5 0 2

We're having the same issue. Unable to get the scripts to run on the storefront graphql. Any ideas?

Yamashou
Shopify Partner
1 0 0

I have the same issue. My apps cart not assign scripts. but web store has correct doing on a cart with scripts. The setting has Online Store and Storefront API. 

スクリーンショット 2022-06-17 17.58.27.png

abeaclark
Shopify Partner
5 0 2

I reached out to support on this. They pretty much said that scripts don't run on the storefront API outside of the online storefront.

 

Seems to contradict their documentation (but admittedly the docs aren't super clear).

 

It's sad b/c it leaves our clients in a hard position.