Retrieve the shipping address information of the currently logged-in user, this interface will return the most recently used shipping address.
Points to note
- The interface uses the GET method and does not require the submission of request body data
- Access requires user login
- Return the information of the most recently used shipping address
- Return empty data if the user does not have a shipping address
Request address
{域名地址}/api/order/address
Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/order/address
Request Syntax
GET {域名地址}/api/order/address
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 | Shipping address data |
Data result parameter
| Field name | Type | Description |
|---|---|---|
| id | int | Address ID |
| name | string | Recipient's name |
| last name | string | recipient's surname |
| string | Email address | |
| company | string | company name |
| phone | string | Contact phone number |
| Province | string | Province |
| City | string | City |
| Country | string | district |
| address information | string | detailed address |
| postal code | string | postal code |
| created_time | int | Timestamp of creation |
| updated_time | int | update timestamp |
| user_id | int | User ID |
| status | int | Status (1: enabled, 0: disabled) |
Usage Example
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 | Not authorized |
| 200 | API request OK |