Create an order interface

API call address

{域名地址}/api/order/create

illustrate:{域名地址}You need to replace it with your domain address, such as/api/order/create

Calling methods

POST

Request parameters

Field name type Required illustrate
goods_id int no Product ID
quantity int no Quantity of products
details object[] no Multiple product information, goods_id and details must be transmitted one
Remark string no Order Notes
type string no Order type, goods, vip
address object no Receive address information

Multiple product information items

Field name type Required illustrate
goods_id int yes Product ID
quantity int yes Quantity of products

Receive address information

Field name type Required illustrate
id int no Address ID
name string yes recipient
Phone string yes Contact number
province string yes province
city string yes City
country string yes District and County
address_info string yes Detailed address
postcode string yes post code

Return parameters

Field name type illustrate
code int Error code
msg string Error Cause Description
data object[] Results content

data results

Field name type illustrate
id int ID
order_id string Order number
payment_id string Payment ID
user_id int User ID
Remark string Order Notes
type string Order Type
origin_amount int Original total price of order
amount int Actual total price of order
paid_time int Payment time
end_time int The order is expected to be completed automatically
deliver_time int Shipping time
finished_time int Order completion time
discount_amount int Discount amount
seller_id int Seller ID
seller_amount int Seller's profits
share_user_id int Promoter ID
share_parent_user_id int Promoter's superior ID
share_amount int Promoters can get benefits
share_parent_amount share_parent_amount int Promoters can get benefits
express_company string Express delivery company
tracking_number string Express waybill number
created_time int Order time stamp
status int Order status: -1 Cancel, 0 To be paid, 1 Payed, 2 Shipped, 3 Completed, 8 Refunds, 9 Refunded
refund_status int Refund status: -1 Refund failed, 0 None or refund is in progress, 1 Refunded

Request data example

parameter value
goods_id 188
quantity 1
type Goods

Return to the data example

{
    "code": 0,
    "data": {
            "id": 46,
            "created_time": 1669212548,
            "updated_time": 1669212548,
            "order_id": "202211232209080046",
            "payment_id": "",
            "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": ""
        },
    "msg": "",
    "total": 2
}

Error code

Error code illustrate
0 OK
-1 Error, the cause of the error is pointed out in msg
1001 Not logged in
1002 Unauthorized
200 API request OK