Storefront API update address request issue

Solved
Highlighted
Tourist
5 1 0
Yo!
 
I'm working on implementing an external app at the moment and am currently making requests via the storefront API; I'm trying to figure out how to update the client's physical address to the cart via id
 
I am making the requests raw by sending the X-Shopify-Storefront-Access-Token header, as such I don't have the graphql variable capabilities as documented in the API docs. Would you be able to provide the raw post content or example curl request of a "Populating Shipping Address" call?
for an example on the format i'm working for here is a simple get x products request.
 
Any help would be super appreciated- Cheers, Henry
 
{
  shop {
products(first: 10) {
  pageInfo {
hasNextPage
hasPreviousPage
  }
  edges {
cursor
node {
  id
  handle
  variants(first: 30) {
edges {
  node {
id
  }
}
  }
} 
  }
  
   }
  }
}
0 Likes
Highlighted

Success.

Shopify Staff
Shopify Staff
1555 80 262

Am I understanding your question correctly in that you want to know what a graphql request looks like using curl? If so, here's what your exaple query would look like:

 

curl -X POST 'https://anprichter-test.myshopify.com/api/graphql.json' \
-d '{"query":"{shop{products(first: 10){pageInfo{hasNextPage\nhasPreviousPage}edges{cursor\nnode{id\nhandle\nvariants(first: 30){edges{node{id}}}}}}}}"}' \
-H 'X-Shopify-Storefront-Access-Token: 2c36d7ecefcd0333dbad32e28f8db86b' \
-H 'Content-Type: application/json'

You're really just posting JSON at the end of the day, so if you want to include variables, the shape of your POST would be like so:

 

{"query": "{shop{id}}", "variables": {"key1": "value": "key2": "value"}}

Hope that helps.

 

Cheers.

0 Likes