Get user's delivery address interface

Get the shipping address information of the currently logged-in user, this interface will return the most recently used shipping address.

Precautions

  • This interface uses the GET method and does not require the submission of request body data
  • Access requires user login
  • Return the information of the last used delivery address
  • If the user does not have a delivery address, return empty data

Request address

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

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

Request syntax

GET {域名地址}/api/order/address

Request header

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

Request Parameters

None

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 Delivery address data

Data result parameters

Field Name Type Description
id integer Address ID
name string Recipient's Name
last_name string Recipient's Surname
email string Email Address
company string company name
phone string Phone Number
province string province
city string City
Country string District
Address Information string Detailed Address
postcode string Postal Code
created_time integer Creation Timestamp
updated_time integer update timestamp
user_id integer User ID
status integer Status (1: enabled, 0: disabled)

Example Usage

Request Example

GET /api/order/address HTTP/1.1
Host: www.anqicms.com
Content-Type: application/json

Response Example

{
  "code": 0,
  "msg": "",
  "data": {
    "id": 1,
    "created_time": 1669212548,
    "updated_time": 1669212548,
    "user_id": 1000,
    "name": "王先生",
    "last_name": "王",
    "email": "[email protected]",
    "company": "示例公司",
    "phone": "13888888888",
    "province": "河南省",
    "city": "郑州市",
    "country": "中原区",
    "address_info": "中原西路233号",
    "postcode": "450000",
    "status": 1
  }
}

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