获取单个文件
提供获取单个Zonos生成的海关文件所需的信息。
要获取单个customsSpec
,用户可以通过他们想要返回的customsSpec
的ID进行查询。
查询
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
query CustomsSpec($id: ID!) {
customsSpec(id: $id) {
id
deliveryDutyPaid
declarationStatement
amountSubtotals {
duties
fees
insurance
shipping
}
customsItems {
items {
id
}
}
}
}
变量
1
2
3
{
"id": "customs_spec_66b544c9-439f-4a82-b5bb-1a00274e8a61"
}
响应
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"data": {
"customsSpec": {
"id": "customs_spec_66b544c9-439f-4a82-b5bb-1a00274e8a61",
"declarationStatement": "I declare this is a declaration statement",
"amountSubtotals": {
"duties": 10.0,
"fees": 5.0,
"insurance": 10.0,
"shipping": 15.99
},
"customsItems": [
{
"items": [
{
"id": "test_item_123"
}
]
}
]
}
}
}
检索多个文档
提供检索多个Zonos生成的海关文件所需的信息。
在用户希望通过DateTimeRange
和trackingNumber
提取多个customsSpecs
的场景中,可以使用以下查询。
查询
1
2
3
4
5
6
7
8
9
10
11
12
13
14
query CustomsSpecs($first: Int, $filter: CustomsSpecFilter) {
customsSpecs(first: $first, filter: $filter) {
edges {
node {
id
amountSubtotals {
duties
fees
insurance
}
}
}
}
}
变量
1
2
3
4
5
6
7
8
9
10
{
"first": 5,
"filter": {
"between": {
"before": "2022-09-25T12:00:00Z",
"after": null
},
"trackingNumber": null
}
}
响应
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
"data": {
"customsSpecs": {
"edges": [
{
"node": {
"id": "customs_spec_ee8eae49-64cd-440e-ac92-3cd90ce4be5b",
"amountSubtotals": {
"duties": 143.0,
"fees": 2.0,
"insurance": 100.0
}
}
},
{
"node": {
"id": "customs_spec_da0015aa-78cc-46c0-9006-bf25e0d7c57f",
"amountSubtotals": {
"duties": 143.0,
"fees": 2.0,
"insurance": 100.0
}
}
},
{
"node": {
"id": "customs_spec_8e8039f5-2e8c-4958-922f-f4dad0bc190f",
"amountSubtotals": {
"duties": 143.0,
"fees": 2.0,
"insurance": 100.0
}
}
},
{
"node": {
"id": "customs_spec_30e31150-13fe-423f-952a-13582454744a",
"amountSubtotals": {
"duties": 143.0,
"fees": 2.0,
"insurance": 100.0
}
}
}
]
}
}
}
获取海关规格
使用 Zonos 海关 API 的用户还可以根据 accountOrderNumber
、DateTimeRange
、订单 id
和 Zonos storeId
检索 customsSpec
。在这种情况下,用户将查询 orders
DGS 而不是 customsSpec
。
检索订单文件
检索单个订单的文件
检索多个订单的文件
提供检索 Zonos 生成的单个订单海关文件所需的信息。
要检索单个 customsSpec
,用户可以通过与 customsSpec
关联的 order
的 ID 进行查询。
查询
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
query OrderQuery($id: String!) {
order(orderId: $id) {
id
customsSpecs {
id
amountSubtotals {
taxes
shipping
duties
fees
insurance
items
}
clearanceType
currency
}
}
}
变量
1
2
3
{
"id": "order_ad8dfd1f-5776-425f-8e4d-a0bd4e7d86e3"
}
响应
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
"data": {
"order": {
"id": "order_ad8dfd1f-5776-425f-8e4d-a0bd4e7d86e3",
"customsSpecs": [
{
"id": "customs_spec_6a4aed06-5303-4e83-965d-2accdb00b600",
"amountSubtotals": {
"taxes": 10.21,
"shipping": 25.99,
"duties": 143,
"fees": 2,
"insurance": 100,
"items": 30.2
},
"clearanceType": "COMMERCIAL",
"currency": "USD"
},
{
"id": "customs_spec_dcbc618c-7480-4651-b59b-d634b0e68e9c",
"amountSubtotals": {
"taxes": 10.21,
"shipping": 25.99,
"duties": 143,
"fees": 2,
"insurance": 100,
"items": 30.2
},
"clearanceType": "COMMERCIAL",
"currency": "USD"
}
]
}
}
}
获取海关文件
为一个或多个订单获取一个或多个海关文件。
GraphQL
一旦为特定货物生成或创建了
customsSpec
,就可以进行查询。这些查询可以被任何希望根据id
、dateTimeRange
或trackingNumber
提取customsSpec
的人使用。