FROM CACHE - en_header

Request data via graphql from an added script

4 0 0

I added a JS to make a bar on top of the store, using admin app. As a result, I got my bar with text inside of it. However, the goal is not merely have text but to make a free shipping application. Like the attached image.
Screenshot from 2020-04-30 11-37-40.png

To do that, I need to collect information from the checkout, I believe I must have one end point from the frontstore to access the check-out, so I need to make a request to graphql for inserting data in my Script.
The problem I am facing is that I have do an authentication on the server to obtain the data on the checkout, regardless this information is public (I believe so), as far as my understanding the customer can access the information of the total price that is in the cart.

Is there any possibility to explain me how I can do this?

Nothing in these links below are relevant to my question:


PS: I got 403 error in the fetch for the graphql, after it was added it to my store.
code: Url:


fetch(url, {
 method: 'POST',
 headers: { 'Content-Type': 'application/json' },
 body: JSON.stringify( '{ shop { name } }' ),
Reply 1 (1)
14 0 2



If your goal is to check the total amount of the current cart, you can use Shopify's AJAX Cart API here: - it doesn't needs authentication nor GraphQL/REST. 

International team available for Store creation and Theme/App development!