Get order custom form interface

Get the custom form field information of the product in the specified order, which is used to display the form content that needs to be filled in by the buyer after the order is paid.After the user makes the payment, an order confirmation email will be received, which will contain a link to fill in the custom form of the order.At the same time, when the user is viewing the order detail page and needs to fill out a form, there will also be corresponding links, which include the order ID and code.

Points to note

  • The interface uses the GET method and does not require the submission of request body data
  • No user login is required, but a secure verification code (code) must be provided
  • Can only retrieve custom forms for paid (status=1) orders
  • Return all order details containing custom fields in the order
  • If the order does not have a custom form field, an error message will be returned

Request address

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

Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/order/custom_form

Request Syntax

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

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

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 Custom form data

Data result parameter

Field name Type Description
order_id string Order ID
user object User Information
reset_password bool Do you need to reset the user's password
details object[] List of products with custom forms in the order details

user parameter

Field name Type Description
id int User ID
user_name string Username
email string Email
phone string Phone
status int User status
group_id int user group ID
created_time int registration timestamp
updated_time int update timestamp

Details item parameters

Field name Type Description
id int order detail ID
Title string product title
order_fields object[] List of custom form fields for the product

order_fields item parameter

Field name Type Description
name string field name
field_name string field identifier name
type string field type (such as text, textarea, select, etc.)
value any Field default value/filled value
default any Default field value

Usage Example

Request example

GET /api/order/custom_form?order_id=202211232209080046&code=e10adc3949ba59abbe56e057f20f883e HTTP/1.1
Host: www.anqicms.com
Content-Type: application/json

Response Example

{
  "code": 0,
  "msg": "",
  "data": {
    "order_id": "202211232209080046",
    "user": {
      "id": 1,
      "user_name": "testuser",
      "email": "[email protected]",
      "phone": "13888888888",
      "status": 1,
      "group_id": 0,
      "created_time": 1669000000,
      "updated_time": 1669000000
    },
    "reset_password": false,
    "details": [
      {
        "id": 16,
        "title": "定制T恤",
        "order_fields": [
          {
            "name": "颜色",
            "field_name": "color",
            "type": "select",
            "value": "红色",
            "default": ""
          },
          {
            "name": "尺寸",
            "field_name": "size",
            "type": "select",
            "value": "L",
            "default": ""
          },
          {
            "name": "备注文字",
            "field_name": "note",
            "type": "textarea",
            "value": "",
            "default": ""
          }
        ]
      }
    ]
  }
}

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