Shopify admin Component is designed to connect to Shopify GraphQL Admin API
Tested with API version: 2023-01
To use this component you need to create a custom App:
App and sales channel settings
Develop apps for your store
Create an app
buttonCreate app
Configure Admin API scopes
Save
Install app
button in API credentials
section or in right upper cornerAdmin API access token
by selecting Reveal token once
. It will be needed in component credentials configuration
Component credentials configuration fields:
2023-01
, but should work with any availableNotes:
Admin API access token
shows only once- To rotate the API credentials for a custom app that was created in the Shopify admin, you need to uninstall and reinstall the app
Retrieve all the updated or created objects within a given time range.
Object Type - (dropdown, required): Object-type to lookup on. E.g Customers
.
Timestamp field to poll on - (dropdown, required): Can be either Last Modified or Created dates (updated or new objects, respectively)
edges.node
, it may affect on query cost metafields(first: 2) {
edges {
node {
namespace
key
value
}
}
}
addresses {
address1
country
}
Emit individually
(by default) or Emit page
customers
are given below:{
"data": {
"customers": [
{
"id": "gid://shopify/Customer/2444144115794",
"firstName": "Willy"
},
{
"id": "gid://shopify/Customer/2444144148562",
"firstName": "Tobi"
},
{
"id": "gid://shopify/Customer/2444144181330",
"firstName": "Mathilde"
}
]
},
"extensions": {
"cost": {
"requestedQueryCost": 5,
"actualQueryCost": 5,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 40,
"restoreRate": 50
}
}
}
}
{
"results": [
{
"id": "gid://shopify/Customer/2444144115794",
"firstName": "Willy"
},
{
"id": "gid://shopify/Customer/2444144148562",
"firstName": "Tobi"
},
{
"id": "gid://shopify/Customer/2444144181330",
"firstName": "Mathilde"
}
]
}
There is no input metadata
Resulting object will represent content from path “data\{Object Type}\edges\node”
Depends on selected Object Type
, selected or provided fields and Emit behavior
:
For Emit Page
mode: An object with key results
that has an array as its value (if Page Size
> 0)
For Emit Individually
mode: Each object which fill the entire message.
Objects in Shopify can be deleted with Execute mutation action
To do that, filter the list of available mutation types in the Mutation type
configuration field by Delete
or Remove
keyword
In most cases you will get one input metadata field with object identifier
{
"input": {
"id": "gid://shopify/Customer/6657016299696"
}
}
{
"companyIds": ["gid://shopify/Company/68616368"]
}
{
"search": "query=name:\"#D12\""
}
Objects in Shopify can be created with Execute mutation action
To do that, filter the list of available mutation types in the Mutation type
configuration field by Create
keyword
Input metadata will represent all needed fields to create an object
{
"input": {
"firstName": "NewUser"
}
}
Objects in Shopify can be updated with Execute mutation action
To do that, filter the list of available mutation types in the Mutation type
configuration field by Update
keyword
Input metadata will represent all needed fields to update an object
{
"input": {
"firstName": "NewUser2",
"id": "gid://shopify/Customer/6664472461488"
}
}
Execute any mutation available on selected API version. This action can be used to Create
, Update
or Delete
Objects and any other operations that affect on Shopify data
Customer Create
. customer {
metafields(first: 2) {
edges {
node {
namespace
key
value
}
}
}
addresses {
address1
country
}
}
Please Note: You need to select basic fields or provide additional fields for resulting object to execute mutation
Dynamically generated fields according to chosen Mutation type
.
Result object from executed mutation.
Lookup a set of objects by defined criteria list. Can be emitted in different way.
Customers
. addresses {
address1
country
}
Emit page
or Emit individually
.customers
are given below:{
"data": {
"customers": [
{
"id": "gid://shopify/Customer/2444144115794",
"firstName": "Willy"
},
{
"id": "gid://shopify/Customer/2444144148562",
"firstName": "Tobi"
},
{
"id": "gid://shopify/Customer/2444144181330",
"firstName": "Mathilde"
}
]
},
"extensions": {
"cost": {
"requestedQueryCost": 5,
"actualQueryCost": 5,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 40,
"restoreRate": 50
}
}
}
}
{
"results": [
{
"id": "gid://shopify/Customer/2444144115794",
"firstName": "Willy"
},
{
"id": "gid://shopify/Customer/2444144148562",
"firstName": "Tobi"
},
{
"id": "gid://shopify/Customer/2444144181330",
"firstName": "Mathilde"
}
]
}
Number of search terms
.
If Number of search terms
is empty or equal 0
, additional fields will not be generated.
If Number of search terms
= 1, one search term will be added to metadata.
If Number of search terms
> 1, a number of search term equal Number of search terms
and a number of criteria link equal ‘Number of search terms - 1’ will de created in metadata.
Each search term has 3 fields:*Please Note:* Allowed Values section contains fields that are allowed to use in query and fields with
-
sign, which meansNOT
modifier (see here)
Dynamically generated fields according to chosen Object type
and selected fields.
For Emit Page
mode: An object, with key results
that has an array as its value.
For Emit Individually
mode: Each object which fill the entire message.
For instance, it is needed to execute following Shopify query:
query{
customers(first:10 query:"country:Canada AND -state:DISABLED"){
edges{
node{
id
state
firstName
addresses{
country
}
}
}
}
}
Object type
option Customers
Select basic fields for resulting object
select basic fields: id
, state
and firstName
.Please Note: Basic fields are fields that can be requested without specifying arguments or adding additional levels:
id
,
You can provide additional fields here
:Please Note: Additional fields are fields that can’t be selected in
Basic fields
section. As rule, they are fields with specifying arguments or adding additional levels such as:addresses{country}
.
Emit Behavior
. If it is needed to receive each object individually, use Emit individually
, in other case, Emit page
option - all objects will be returned in one array result
. For example, lets use ‘Emit individually’Number of search terms
: in example query we see 2 conditions, so set it to 2
Push the button Continue
and move to fill metadata
Set 10
to field First
country:Canada
:Field name
from Allowed Values dropdown option country
:Condition
from Allowed Values dropdown option :
Field value
value Canada
Logical operator
from Allowed Values dropdown option AND
-state:DISABLED
: set Field name
to -state
, Condition
to :
and Field value
to DISABLED
Continue
and move to Sample
sectionRetrieve new sample from Shopify admin component v2
Lookup a single object by its ID - only query with one argument id
can be used in this action.
Customer
. addresses {
address1
country
}
Dynamically generated fields according to chosen Object type
and selected fields.
Executes custom request.
There is no configuration fields in this action.
https://{store_name}.myshopify.com/admin/api/{api_version}/
) or full urlGET
, POST
, PUT
, PATCH
, DELETE
.If the component reaches API rate limit it will retry request after waiting until queue will be restored up to 10 times: for example - query cost 500
points, currently available only 100
points, restore rate 50
points/second, component will wait 8
seconds until available points will be restored and try again to get data
Be carefully with several flows running at the same time, each of then can affect on total available points, if component won’t be able to get data after 10 retries, then error "Throttled"
will be thrown
Click here to learn more about the elastic.io iPaaS