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 configurationAPI secret key
if you going to use webhooksScreenshot instructions
Component credentials configuration fields:
2023-01
, but should work with any availableWebhook
to sign the request with an HMAC header.
Admin API access token
shows only onceObjects 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
Example of input metadata to delete a customer
{
"input": {
"id": "gid://shopify/Customer/6657016299696"
}
}
Example of input metadata to delete multiple companies
{
"companyIds": ["gid://shopify/Company/68616368"]
}
Example of input metadata to bulk delete draft orders using search
{
"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
Example of input metadata to create a customer
{
"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
Example of input metadata to update a customer
{
"input": {
"firstName": "NewUser2",
"id": "gid://shopify/Customer/6664472461488"
}
}
Updates (of record found) or creates a new object.
Customers
.You can provide additional fields here - (string, optional): Resulting object can be expanded using GraphQL request, it may affect on query cost Example for customer
customer {
addresses {
city
}
}
❗Note: You need to select basic fields or provide additional fields for resulting object to execute mutation
Dynamically generated fields according to chosen Object type
.
Result object from upsert.
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
.You can provide additional fields here - (string, optional): Resulting object can be expanded using GraphQL request, it may affect on query cost Example for customer
customer {
metafields(first: 2) {
edges {
node {
namespace
key
value
}
}
}
addresses {
address1
country
}
}
❗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
.You can provide additional fields here - (string, optional): Resulting object can be expanded using GraphQL request, it may affect on query cost Example for customer
addresses {
address1
country
}
Emit page
or Emit individually
.Return Full Response - (checkbox): Defines the format of emitted result: with service information or without.
Examples for Object type customers
are given below:
Response with enabled Return Full Response
checkbox and Emit Behavior
= Emit page
{
"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
}
}
}
}
Response with disabled Return Full Response
checkbox and Emit Behavior
= Emit page
{
"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:-
sign, which means NOT
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
}
}
}
}
}
Select in Object type
option Customers
From dropdown Select basic fields for resulting object
select basic fields: id
, state
and firstName
.
Note: Basic fields are fields that can be requested without specifying arguments or adding additional levels: id
, email
, etc.
You can provide additional fields here
:
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}
.
Select 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’
Specify 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
To map condition country:Canada
:
select in 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
.You can provide additional fields here - (string, optional): Resulting object can be expanded using GraphQL request, it may affect on query cost Example for customer
addresses {
address1
country
}
Dynamically generated fields according to chosen Object type
and selected fields.
Executes custom request.
none
https://{store_name}.myshopify.com/admin/api/{api_version}/
) or full urlGET
, POST
, PUT
, PATCH
, DELETE
.Note: GraphQL and REST API endpoints are supported. E.g.
GraphQL
/graphql.json
POST
{"query": "query { products(first: 10) { edges { node { id title } } } }"}
Equivalent to this:
REST
/products.json?fields=id,title
POST
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)
You can provide additional fields here - (string, optional): Resulting object can be expanded using GraphQL request, this field represent content from each edges.node
, it may affect on query cost
Example for Customers
metafields(first: 2) {
edges {
node {
namespace
key
value
}
}
}
addresses {
address1
country
}
Emit individually
(by default) or Emit page
customers
are given below:
Response with enabled Return Full Response
checkbox and Emit Behavior
= Emit page
{
"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
}
}
}
}
Response with disabled Return Full Response
checkbox and Emit Behavior
= Emit page
{
"results": [
{
"id": "gid://shopify/Customer/2444144115794",
"firstName": "Willy"
},
{
"id": "gid://shopify/Customer/2444144148562",
"firstName": "Tobi"
},
{
"id": "gid://shopify/Customer/2444144181330",
"firstName": "Mathilde"
}
]
}
None.
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.
Creates webhook subscription for selected topics on the Shopify side to receive events
None.
Event from the subscription on the selected topic
Retrieve sample
functionalityreal-time
not enabled) after flow starts you will need to run it once - just follow the webhook URL (to make the first execution) this action will create a subscription, error on this execution may be ignoredIf the component reaches API rate limit it will retry the request after waiting until the queue is restored up to 10 times: for example - a query costs 500
points, currently available only 100
points, the restore rate 50
points/second, the component will wait 8
seconds until available points will be restored and try again to get data
Be careful with several flows running at the same time, each of them can affect on total available points, if the component won’t be able to get data after 10 retries, then the error "Throttled"
will be thrown
Click here to learn more about the elastic.io iPaaS