---
title: "查询订单数量"
description: "根据指定的入参条件，查询符合条件的订单数量。"
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/order/order-management/get-an-order-count'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/order/order-management/get-an-order-count.md'
---
# 查询订单数量

根据指定的入参条件，查询符合条件的订单数量。

- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **Required Scopes:** `read_orders`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
GET /orders/count.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。

## Required Permissions

* `read_orders`

## Request

### Query Parameters

* `created_at_min`

  string (optional)

  指定要查询订单的起始日期和时间，在此时间和此时间之后创建的订单会被统计。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。

* `financial_status`

  string (optional)

  指定订单支付状态，有效枚举值包含：
  - `unpaid`：未支付
  - `authorized`：已授权
  - `pending`：支付中
  - `partially_paid`：部分支付
  - `paid`：已支付
  - `partially_refunded`：部分退款
  - `refunded`：已退款
  - `any`：全部支付状态
  
  默认值：`any`

* `location_id`

  string (optional)

  地点 ID。

* `created_at_max`

  string (optional)

  指定要查询订单的截止日期和时间，在此时间和此时间之前创建的订单会被统计。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。

* `fulfillment_status`

  string (optional)

  订单发货状态，有效枚举值包含：
  - `unshipped`：未发货
  - `partial`：部分发货
  - `shipped`：已发货
  - `any`：全部发货状态
  
  默认值：`any`

* `order_source`

  string (optional)

  销售渠道。有效枚举值包含：
  - `oneshop`：一页商店
  - `web`：在线商店
  - `mc`：消息中心
  - `live`：直播
  - `post`：贴文
  - `shopee`：Shopee
  - `lazada`：Lazada
  - `buy_button`：Buy Button 应用
  - `pos`：POS
  - `any`：任意销售渠道
  
  默认值：`any`

* `status`

  string (optional)

  订单状态。有效枚举值包含：
  - `open`：处理中
  - `cancelled`：已取消
  - `hidden`：已归档
  - `any`：包含全部状态
  
  默认值：`any`

* `updated_at_max`

  string (optional)

  指定要查询订单的截止日期和时间，在此时间和此时间之前更新的订单会被统计。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。

* `updated_at_min`

  string (optional)

  指定要查询订单的起始日期和时间，在此时间和此时间之后更新的订单会被统计。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。

### Request Headers

* `Content-Type`

  string (required)

  字段值固定为 `application/json; charset=utf-8`。

* `Authorization`

  string (required)

  资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。

## Response

### Status Codes

* `200`

  更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。

### Response Body

#### 200

* `count`

  long

  符合给定入参条件的订单数量。


#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "tags": [
    "查询订单数量"
  ],
  "description": "根据指定的入参条件，查询符合条件的订单数量。",
  "externalDocs": {
    "description": "接口使用的权限点: `read_orders` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": ""
  },
  "operationId": "MO3GAeBj",
  "parameters": [
    {
      "name": "created_at_min",
      "in": "query",
      "description": "指定要查询订单的起始日期和时间，在此时间和此时间之后创建的订单会被统计。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "created_at_min",
        "description": "指定要查询订单的起始日期和时间，在此时间和此时间之后创建的订单会被统计。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。",
        "type": "string",
        "example": "2024-08-31T02:20:26+08:00"
      },
      "example": "2024-08-31T02:20:26+08:00",
      "examples": {
        "订单数量查询": {
          "value": "2021-08-31T02:20:26+08:00"
        }
      }
    },
    {
      "name": "financial_status",
      "in": "query",
      "description": "指定订单支付状态，有效枚举值包含：\n- `unpaid`：未支付\n- `authorized`：已授权\n- `pending`：支付中\n- `partially_paid`：部分支付\n- `paid`：已支付\n- `partially_refunded`：部分退款\n- `refunded`：已退款\n- `any`：全部支付状态\n\n默认值：`any`",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "financial_status",
        "description": "指定订单支付状态，有效枚举值包含：\n- `unpaid`：未支付\n- `authorized`：已授权\n- `pending`：支付中\n- `partially_paid`：部分支付\n- `paid`：已支付\n- `partially_refunded`：部分退款\n- `refunded`：已退款\n- `any`：全部支付状态\n\n默认值：`any`",
        "type": "string"
      },
      "examples": {
        "订单数量查询": {
          "value": "unpaid"
        }
      }
    },
    {
      "name": "location_id",
      "in": "query",
      "description": "地点 ID。",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "location_id",
        "description": "地点 ID。",
        "type": "string"
      },
      "examples": {
        "订单数量查询": {
          "value": "***************38056"
        }
      }
    },
    {
      "name": "created_at_max",
      "in": "query",
      "description": "指定要查询订单的截止日期和时间，在此时间和此时间之前创建的订单会被统计。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "created_at_max",
        "description": "指定要查询订单的截止日期和时间，在此时间和此时间之前创建的订单会被统计。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。",
        "type": "string",
        "example": "2024-08-31T02:20:26+08:00"
      },
      "example": "2024-08-31T02:20:26+08:00",
      "examples": {
        "订单数量查询": {
          "value": "2023-08-31T02:20:26+08:00"
        }
      }
    },
    {
      "name": "fulfillment_status",
      "in": "query",
      "description": "订单发货状态，有效枚举值包含：\n- `unshipped`：未发货\n- `partial`：部分发货\n- `shipped`：已发货\n- `any`：全部发货状态\n\n默认值：`any`",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "fulfillment_status",
        "description": "订单发货状态，有效枚举值包含：\n- `unshipped`：未发货\n- `partial`：部分发货\n- `shipped`：已发货\n- `any`：全部发货状态\n\n默认值：`any`",
        "type": "string"
      },
      "examples": {
        "订单数量查询": {
          "value": "unshipped"
        }
      }
    },
    {
      "name": "order_source",
      "in": "query",
      "description": "销售渠道。有效枚举值包含：\n- `oneshop`：一页商店\n- `web`：在线商店\n- `mc`：消息中心\n- `live`：直播\n- `post`：贴文\n- `shopee`：Shopee\n- `lazada`：Lazada\n- `buy_button`：Buy Button 应用\n- `pos`：POS\n- `any`：任意销售渠道\n\n默认值：`any`",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "order_source",
        "description": "销售渠道。有效枚举值包含：\n- `oneshop`：一页商店\n- `web`：在线商店\n- `mc`：消息中心\n- `live`：直播\n- `post`：贴文\n- `shopee`：Shopee\n- `lazada`：Lazada\n- `buy_button`：Buy Button 应用\n- `pos`：POS\n- `any`：任意销售渠道\n\n默认值：`any`",
        "type": "string"
      },
      "examples": {
        "订单数量查询": {
          "value": "any"
        }
      }
    },
    {
      "name": "status",
      "in": "query",
      "description": "订单状态。有效枚举值包含：\n- `open`：处理中\n- `cancelled`：已取消\n- `hidden`：已归档\n- `any`：包含全部状态\n\n默认值：`any`",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "status",
        "description": "订单状态。有效枚举值包含：\n- `open`：处理中\n- `cancelled`：已取消\n- `hidden`：已归档\n- `any`：包含全部状态\n\n默认值：`any`",
        "type": "string"
      },
      "examples": {
        "订单数量查询": {
          "value": "open"
        }
      }
    },
    {
      "name": "updated_at_max",
      "in": "query",
      "description": "指定要查询订单的截止日期和时间，在此时间和此时间之前更新的订单会被统计。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "updated_at_max",
        "description": "指定要查询订单的截止日期和时间，在此时间和此时间之前更新的订单会被统计。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。",
        "type": "string",
        "example": "2024-08-31T02:20:26+08:00"
      },
      "example": "2024-08-31T02:20:26+08:00",
      "examples": {
        "订单数量查询": {
          "value": "2023-08-31T02:20:26+08:00"
        }
      }
    },
    {
      "name": "updated_at_min",
      "in": "query",
      "description": "指定要查询订单的起始日期和时间，在此时间和此时间之后更新的订单会被统计。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "updated_at_min",
        "description": "指定要查询订单的起始日期和时间，在此时间和此时间之后更新的订单会被统计。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。",
        "type": "string",
        "example": "2024-08-31T02:20:26+08:00"
      },
      "example": "2024-08-31T02:20:26+08:00",
      "examples": {
        "订单数量查询": {
          "value": "2021-08-31T02:20:26+08:00"
        }
      }
    },
    {
      "name": "Content-Type",
      "in": "header",
      "description": "字段值固定为 `application/json; charset=utf-8`。",
      "required": true,
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": "资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": "资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "responses": {
    "200": {
      "description": "更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。",
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "name": "body",
            "type": "object",
            "properties": {
              "count": {
                "name": "count",
                "description": "符合给定入参条件的订单数量。",
                "type": "long"
              }
            },
            "example": {
              "count": null
            }
          },
          "examples": {
            "订单数量查询": {
              "description": "根据指定的入参，查询符合入参条件的订单数量。",
              "value": {
                "count": 1
              }
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "get",
  "path": "/orders/count.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。"
        }
      }
    }
  ],
  "info": {
    "title": "查询订单数量",
    "version": "v20270301"
  },
  "authIndexes": [
    "read_orders"
  ]
}
```