Zack Saadioui
1/27/2025
1
products1
orders1
customers1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
javascript
 const query = `
   { 
     products(first: 10) { 
       edges { 
         node { 
           id 
           title 
         } 
       } 
     } 
   }
 `;
 const response = await fetch('https://your-store.myshopify.com/admin/api/2022-07/graphql.json', {
   method: 'POST',
   headers: {
     'X-Shopify-Access-Token': 'your-access-token',
     'Content-Type': 'application/json',
   },
   body: JSON.stringify({ query }),
 });
 const data = await response.json();
 console.log(data);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
javascript
 const checkoutMutation = `
   mutation checkoutCreate($input: CheckoutInput!) {
     checkoutCreate(input: $input) {
       checkout {
         id
         webUrl
       }
     }
   }
 `;
 const response = await fetch('https://your-store.myshopify.com/api/graphql', {
   method: 'POST',
   headers: {
     'X-Shopify-Storefront-Access-Token': 'your-storefront-access-token',
     'Content-Type': 'application/json',
   },
   body: JSON.stringify({ query: checkoutMutation, variables: { input: {/* checkout input here */} } }),
 });
 const result = await response.json();
 console.log(result);1
2
3
4
5
6
7
javascript
webhook = new shopify.rest.Webhook({
  session: session,
  topic: 'orders/create',
  address: 'https://your-app-url.com/webhook',
});
await webhook.save();Copyright © Arsturn 2025