companies
query
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
Returns elements following the specified cursor. The
first argument must also be specified when using this argument.Returns elements preceding the specified cursor. The
last argument must also be specified when using this argument.Returns the first n elements in the list.
Returns the last n elements in the list.
Whether to reverse the order of the list.
● true: reverse
● false: do not reverse
Default value: false
sort key
Query criteria, JSON string.
Currently, only company name and location name queries are supported, such as
{"queryParam": "Global Ball Company"}Return
edge list
node list
pageInfo
Status and error codes
For detailed information about common codes, see Status and error codes.
Example
Company list query
Code
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?