An access token is required to call this API. Refer to Authorization for more information about how to obtain the token.
Company List Query
Arguments
after ● String
Returns elements following the specified cursor. The first argument must also be specified when using this argument.
before ● String
Returns elements preceding the specified cursor. The last argument must also be specified when using this argument.
first ● Int
Returns the first n elements in the list.
last ● Int
Returns the last n elements in the list.
reverse ● Boolean
Whether to reverse the order of the list.
● true: reverse
● false: do not reverse
Default value: false
sortKey ● CompanySortKeys
sort key
More
rawQuery ● String
Query criteria, JSON string. Currently, only company name and location name queries are supported, such as {"queryParam": "Global Ball Company"}
Return
edges ● [CompanyEdge!]non-null
edge list
More
nodes ● [Company]
node list
More
pageInfo ● PageInfo!non-null
pageInfo
More
Status and error codes
For detailed information about common codes, see Status and error codes.
Example
Company list query
query {
companies(first: 2, rawQuery: "{\"queryParam\": \"Big bom\"}",after:null,before:null,reverse:true,sortKey: CREATED_AT) {
edges {
cursor
node {
id
name
orderCount
contactCount
locationCount
totalSpent {
amount
currencyCode
}
mainContact{
id
}
}
}
nodes {
id
name
orderCount
contactCount
locationCount
totalSpent {
amount
currencyCode
}
mainContact{
id
}
}
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
}
}
Response
{
"data": {
"companies": {
"edges": [
{
"cursor": "-",
"node": {
"id": "gid://shopline/Company/6261711218190850599",
"locationCount": 9,
"mainContact": {
"id": "gid://shopline/CompanyContact/4600512895"
},
"name": "Big bom",
"orderCount": 0,
"totalSpent": {
"currencyCode": "USD",
"amount": "0"
},
"contactCount": 5
}
}
],
"nodes": [
{
"totalSpent": {
"amount": "0",
"currencyCode": "USD"
},
"contactCount": 5,
"id": "gid://shopline/Company/6261711218190850599",
"locationCount": 9,
"mainContact": {
"id": "gid://shopline/CompanyContact/4600512895"
},
"name": "Big bom",
"orderCount": 0
}
],
"pageInfo": {
"endCursor": "E002CE0E792FBA4E98672D39851FDFD6",
"hasNextPage": false,
"hasPreviousPage": false,
"startCursor": "AF52536A1951B28A30AAE8825A2B69B9"
}
}
}
}
Was this article helpful to you?