Save order custom form interface
Save the custom form content filled in for the products in the paid order, supporting batch update of the custom field values of the products.
Points to note
- The API uses the POST method and requires data to be submitted in application/ format
- No user login is required, but a secure verification code (code) must be provided
- Custom forms for orders that have been paid (status=1) can only be saved
- Supports resetting the user's password when submitting a form (when reset_password is true)
- Only update the order details explicitly passed in order_extra in the details
Request address
{域名地址}/api/order/custom_form
Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/order/custom_form
Request Syntax
POST {域名地址}/api/order/custom_form
Content-Type: application/json
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 |
|---|---|---|---|
| order_id | string | Is | Order ID |
| code | string | Is | Captcha used to verify identity |
| password | string | No | New password, to be entered when the user needs to reset the password |
| details | object[] | No | To update the order details list of the custom form |
Details item parameters
| Field name | Type | Required | Description |
|---|---|---|---|
| id | int | Is | order detail ID |
| order_extra | object | Is | Custom form field key-value pair, key is the field identifier, value is the entered value |
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 reason description or success prompt |
Usage Example
Request example
POST /api/order/custom_form HTTP/1.1
Host: www.anqicms.com
Content-Type: application/json
{
"order_id": "202211232209080046",
"code": "e10adc3949ba59abbe56e057f20f883e",
"password": "newpassword123",
"details": [
{
"id": 16,
"order_extra": {
"color": "红色",
"size": "L",
"note": "请加急处理"
}
},
{
"id": 17,
"order_extra": {
"color": "蓝色",
"size": "M",
"note": ""
}
}
]
}
Response Example
{
"code": 0,
"msg": "更新成功"
}
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 |