Interface to get distributor earnings list

Get the distributor earnings list, supports pagination query.

Precautions

  • This interface uses the GET method
  • User login verification is required
  • Only returns the earnings records of the currently logged-in user's distributor
  • Supports pagination queries, can specify the current page number and number of items per page
  • Contains information such as order amount, commission amount, withdrawal status, etc.

Request address

{域名地址}/api/retailer/commissions

Description:{域名地址}Need to replace it with your domain address, such ashttps://en.anqicms.com/api/retailer/commissions

Request syntax

GET {域名地址}/api/retailer/commissions

Request header

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

Request Parameters

Field Name Type Required Description
Current integer No Current page number, default is 1
pageSize integer No Number of items per page, default is 10

Response Headers

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

Return parameters

Field Name Type Description
code integer Error code
message string Error Description
data object Distributor earnings list array
total integer Total number of records

data result item parameter

Field Name Type Description
id integer Earnings record ID
user_id integer User ID
order_id string Order Number
order_amount integer Order amount (unit: cents)
amount integer Amount earned from commission (unit: cents)
status integer Status (0 Pending settlement, 1 Settled, 2 Withdrawn, etc.)
withdraw_id integer Withdrawal ID, 0 indicates not withdrawn
remark string Remark information
user_name string Username
can_withdraw boolean whether_withdrawable
created_time integer Creation Timestamp
updated_time integer update timestamp

Example Usage

Request Example

GET /api/retailer/commissions?current=1&pageSize=10 HTTP/1.1
Host: www.anqicms.com

Response Example

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "id": 6,
      "created_time": 1671504424,
      "updated_time": 1671504424,
      "user_id": 1000,
      "order_id": "202212201046420050",
      "order_amount": 19900,
      "amount": 15920,
      "status": 0,
      "withdraw_id": 0,
      "remark": "销售收入",
      "user_name": "testuser",
      "can_withdraw": false
    },
    {
      "id": 5,
      "created_time": 1669618222,
      "updated_time": 1669618222,
      "user_id": 1000,
      "order_id": "202211281446070047",
      "order_amount": 19900,
      "amount": 15920,
      "status": 0,
      "withdraw_id": 0,
      "remark": "销售收入",
      "user_name": "testuser",
      "can_withdraw": false
    }
  ],
  "total": 2
}

Error Code

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