Shopify

libs.shopify.get()

Requires the Shopify integration to be set up
Returns an instance of Shopify-api-node library, with the credentials already set up. You can then call Shopify APIs directly, like the following.
Example: Rest API get product tag
1
const shopify = libs.shopify.get();
2
const { tags } = awai
Copied!
​
Example: GraphQL get product tag from order
1
const shopify = libs.shopify.get();
2
const query = `{
3
order(id: "gid://shopify/Order/${orderID}") {
4
id
5
tags
6
lineItems (first: 100) {
7
edges {
8
node {
9
id
10
product {
11
id
12
tags
13
}
14
}
15
}
16
}
17
}
18
}`;
19
const { order } = await shopify.graphql(query);
Copied!
​
Multiple Shopify integration
1
// if you have added multiple shopify integration to the same app,
2
// you can access them like this:
3
​
4
const shopOne = libs.shopify.get('shopOne.myshopify.com');
5
const shopTwo = libs.shopify.get('shopTwo.myshopify.com');
6
​
7
...
Copied!
Last modified 9mo ago
Copy link