接口访问需要令牌,具体如何获取令牌参考:身份认证
公司列表查询
Arguments
after ● String
返回指定游标之后的元素。如果指定了该参数,也必须要指定 first 参数。
before ● String
返回指定游标之前的元素。如果指定了该参数,也必须要指定 last 参数。
first ● Int
返回列表中的前 n 个元素。
last ● Int
返回列表中的最后 n 个元素。
reverse ● Boolean
是否反转列表的顺序。
● true:反转
● false:不反转
默认值:false
sortKey ● CompanySortKeys
排序规则
More
rawQuery ● String
查询条件,json字符串。 当前仅支持公司名称和地点名称查询,例如{"queryParam": "Globale Ball Company"}
Return
edges ● [CompanyEdge!]non-null
edges列表
More
nodes ● [Company]
节点列表
More
pageInfo ● PageInfo!non-null
分页信息
More
错误码
关于更多通用错误码说明,参考:状态码和错误码
Example
公司列表查询
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": {
"contactCount": 5,
"id": "gid://shopline/Company/6261711218190850599",
"locationCount": 9,
"mainContact": {
"id": "gid://shopline/CompanyContact/4600512895"
},
"name": "Big bom",
"orderCount": 0,
"totalSpent": {
"amount": "0",
"currencyCode": "USD"
}
}
}
],
"nodes": [
{
"orderCount": 0,
"totalSpent": {
"amount": "0",
"currencyCode": "USD"
},
"contactCount": 5,
"id": "gid://shopline/Company/6261711218190850599",
"locationCount": 9,
"mainContact": {
"id": "gid://shopline/CompanyContact/4600512895"
},
"name": "Big bom"
}
],
"pageInfo": {
"endCursor": "E002CE0E792FBA4E98672D39851FDFD6",
"hasNextPage": false,
"hasPreviousPage": false,
"startCursor": "AF52536A1951B28A30AAE8825A2B69B9"
}
}
}
}
这篇文章对你有帮助吗?