Order List Retrieval Interface

Get the user's order list, support filtering by order status and pagination query.

Points to note

  • This interface uses the GET method
  • User login verification required
  • Support filtering by order status (pending payment, paid, shipped, completed, etc.)
  • Support pagination query, the default number of items per page is determined by the pageSize parameter
  • Only return the order information of the currently logged-in user

Request address

{域名地址}/api/orders

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

Request Syntax

GET {域名地址}/api/orders

Request Headers

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

Request parameters

Field name Type Required Description
status string No Order status, default is empty, supported values include: empty, waiting (pending payment), paid (paid), delivery (shipped), finished (completed), refunding (refunding)
current int No The current page number, default is 1
pageSize int No Number of items displayed per page, default is 10

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[] Order List Array
Total int Total Orders

data result item parameter

Field name Type Description
id int Order ID
order_id string Order Number
payment_id string Payment流水ID
user_id int User ID
remark string Order remarks
type string Order Type
original amount int Original order total price (unit: fen)
amount int Actual order total price (unit: fen)
Paid Time int Payment timestamp, 0 if not paid
End Time int Estimated automatic completion timestamp of the order
deliver_time int Shipment timestamp, 0 if not shipped
Finished Time int Order completion timestamp, 0 if not completed
Discount amount int Discount amount (in cents)
seller_id int seller ID
seller amount int Seller's profit (unit: points)
share user ID int Promoter ID
share_parent_user_id int Promoter's superior ID
Share amount int Promoter's profit (unit: points)
share_parent_amount int Promoter's superior's profit (unit: points)
express_company string express_company
tracking number string express delivery waybill number
user object Buyer User Information
details object[] Order Details Information List
created_time int order timestamp
status int Order Status: -1 Cancelled, 0 Pending Payment, 1 Paid, 2 Shipped, 3 Completed, 8 Refunding, 9 Refunded
refund_status int Refund status: -1 Refund failed, 0 No or in progress, 1 Refunded

user Buyer user information parameters

Field name Type Description
id int User ID
parent_id int Parent User ID
user_name string Username
real_name string Real Name
avatar_url string User avatar address
email string Email address
phone string Phone number
group_id int user group ID
is_retailer int Is a Distributor
balance int User Balance (Unit: Cents)
Total Reward int Distributor Cumulative Earnings (Unit: Cents)
Invite Code string User Invite Code
last login int timestamp of last login
expire time int expiration timestamp
created_time int registration timestamp
updated_time int update timestamp
status int User Display Status

details Order details information parameters

Field name Type Description
id int order detail ID
order_id string Order Number
user_id int User ID
goods_id int Product ID
goods_item_id int Product SKU ID
price int Product Price (Unit: Cents)
origin_price int Original Product Price (Unit: Cents)
amount int Actual Total Product Price (Unit: Cents)
original amount int Original Total Product Price (Unit: Cents)
quantity int Product Quantity
status int Status
goods object Product Details

goods product detail parameters

Field name Type Description
id int Document ID
Title string Document title
seo title string Document SEO Title
URL Token string Document URL Alias
keywords string Document keyword
description string Document Introduction
module_id int Document Model ID
category_id int Document Category ID
Views int Document Views
Comment Count int Document Comment Volume
Images string array document group chart
Logo string Document Logo
thumbnail string document thumbnail
canonical_url string Canonical URL
fixed link string document fixed link
created_time int document publish timestamp
updated_time int document update timestamp
status int document display status
user_id int User ID
price int price (unit: fen)
stock int inventory quantity

Usage Example

Request example

GET /api/orders?status=paid&current=1&pageSize=10 HTTP/1.1
Host: www.anqicms.com

Response Example

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "id": 46,
      "created_time": 1669212548,
      "updated_time": 1669212548,
      "order_id": "202211232209080046",
      "payment_id": "202211232209080016",
      "user_id": 1000,
      "address_id": 0,
      "remark": "英文外贸响应式通用主题wzl-008等",
      "type": "goods",
      "status": 0,
      "refund_status": 0,
      "origin_amount": 9900,
      "amount": 9900,
      "paid_time": 0,
      "end_time": 0,
      "deliver_time": 0,
      "finished_time": 0,
      "discount_amount": 0,
      "seller_id": 15,
      "seller_amount": 7920,
      "share_user_id": 0,
      "share_parent_user_id": 0,
      "share_amount": 0,
      "share_parent_amount": 0,
      "express_company": "",
      "tracking_number": "",
      "user": {
        "id": 1000,
        "created_time": 1669012062,
        "updated_time": 1679536756,
        "parent_id": 0,
        "user_name": "sinclair",
        "real_name": "",
        "avatar_url": "uploads/202211/21/14f56760596b5328.webp",
        "email": "",
        "phone": "",
        "group_id": 2,
        "status": 1,
        "is_retailer": 0,
        "balance": 0,
        "total_reward": 0,
        "invite_code": "1dzil93",
        "last_login": 1702912236,
        "expire_time": 1997404800,
        "integral": 9968520,
        "ai_remain": 30,
        "extra": null,
        "token": "",
        "group": null,
        "full_avatar_url": "",
        "link": ""
      },
      "is_updated": 0,
      "details": [
        {
          "id": 16,
          "created_time": 1669212548,
          "updated_time": 1669212548,
          "order_id": "202211232209080046",
          "user_id": 1000,
          "goods_id": 188,
          "goods_item_id": 0,
          "price": 9900,
          "origin_price": 9900,
          "amount": 9900,
          "origin_amount": 9900,
          "quantity": 1,
          "status": 1,
          "goods": {
            "id": 188,
            "created_time": 1669122751,
            "updated_time": 1669122751,
            "title": "英文外贸响应式通用主题wzl-008",
            "seo_title": "",
            "url_token": "ywwmxystyztw0-7",
            "keywords": "英文外贸响应式通用主题wzl-008",
            "description": "英文主题,外贸主题,响应式主题,通用英文企业站主题",
            "module_id": 3,
            "category_id": 36,
            "views": 158,
            "comment_count": 0,
            "images": [
              "https://en.anqicms.com/uploads/202211/22/6315f8a943b979a4.webp",
              "https://en.anqicms.com/uploads/202211/22/c705ba844eb51aec.webp"
            ],
            "template": "",
            "status": 1,
            "canonical_url": "",
            "fixed_link": "",
            "flag": "",
            "user_id": 15,
            "price": 9900,
            "stock": 9999999,
            "read_level": 0,
            "password": "",
            "sort": 0,
            "has_pseudo": 0,
            "keyword_id": 0,
            "origin_url": "",
            "origin_title": "",
            "origin_id": 0,
            "category": null,
            "module_name": "",
            "data": null,
            "logo": "https://en.anqicms.com/uploads/202211/22/6315f8a943b979a4.webp",
            "thumb": "https://en.anqicms.com/uploads/202211/22/thumb_6315f8a943b979a4.webp",
            "extra": null,
            "link": "https://en.anqicms.com/endesign/188.html",
            "has_ordered": false,
            "favorable_price": 0,
            "has_password": false,
            "category_titles": null,
            "category_ids": null
          },
          "group": null
        }
      ]
    }
  ],
  "total": 1
}

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