Order Statistics Retrieval Interface

Get the order statistics of the current user, including the number of orders in various states.

Points to note

  • This interface uses the GET method
  • User login verification required
  • Return the order statistics of the current user
  • Statistics of the number of various order statuses
  • Statistics of the number of wish lists

Request address

{域名地址}/api/orders/statistics

Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/orders/statistics

Request Syntax

GET {域名地址}/api/orders/statistics

Request Headers

This interface also involves common request headers. For more information, please refer toCommon Request Headers (Common Request Headers).

Request parameters

None

Response header

This interface only involves public response headers. For more information, please refer toCommon Request Headers (Common Request Headers).

Return parameters

Field name Type Description
code int Error code
msg string Error description
data object Statistics object

Data result parameter

Field name Type Description
Total int Total number of orders
pending int orders pending payment amount
processing int orders in processing amount
completed int The number of completed orders
cancelled int The number of cancelled orders
refunding int The number of orders being refunded
refunded int The number of completed refund orders
wishlist int Number of wishlists

Usage Example

Request example

GET /api/orders/statistics HTTP/1.1
Host: www.anqicms.com

Response Example

{
  "code": 0,
  "msg": "获取成功",
  "data": {
    "total": 25,
    "pending": 3,
    "processing": 5,
    "completed": 15,
    "cancelled": 1,
    "refunding": 1,
    "refunded": 0,
    "wishlist": 8
  }
}

error code

Error code Description
0 OK
-1 Error, the reason is indicated in msg
1001 Not logged in
1002 Not authorized
200 API request OK