Product SKU Retrieval Interface

Get detailed information about the SKU (stock keeping unit) of a specified product, including specifications, price, inventory, wholesale rules, and more.This interface is suitable for scenarios that require displaying product specifications and purchase options.

Points to note

  • The interface supports retrieving product SKU information through product ID or URL alias (filename) in two ways
  • This interface is a product interface, suitable for product type documents
  • The returned data includes the complete specifications and SKU list of the product
  • If the product does not exist, the interface will return an error code

Request address

{域名地址}/api/archive/sku

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

Request Syntax

GET {域名地址}/api/archive/sku?{参数}

Request Headers

This interface involves only public request headers. For more information, please refer toCommon Request Headers (Common Request Headers).

Request parameters

Field name Type Required Description
id int Is Document ID, if filename is provided, ID is not required
filename string No Document URL alias, either Document ID or filename is optional

Response header

This interface only involves common 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 result content

data parameter

Field name Type Description
id int Product ID
Title string Product Title
currency string Currency Name
currency symbol string Currency Symbol
price Float Product Price
minimum price Float Product Lowest Price
maximum price Float Product Highest Price
user limit int Quantity Limit for Users
quota used int PurchasedQuantity
order count int Sales
stock int Inventory Quantity
options object[] Product Specification Attribute Name
Skus object[] Product SKU Information
Wholesale rules object[] Product Wholesale Rules
Option Product Specification Attribute Name
Field name Type Description
id int Attribute ID
Title string Property Name
values object[] Property value list
Property value
Field name Type Description
id int Category ID
option id int Property ID
option title string Property Name
Images string array Image List
Title string Property Value Name
color string Color value
price Float Price
SKU product information
Field name Type Description
id int Category ID
Title string SKU name
symbol string Specification attribute value ID link symbol
values object[] Property value list
sku string Sku link symbol
barcode string Barcode
hs_code string Customs Code
Images string array Image List
Logo string Logo
thumbnail string Thumbnail
stock int Inventory Quantity
price int Price
origin_price int Price
weight int weight
weight unit string Weight unit
sold_count int Sales
wholesale_rules product wholesale rules
Field name Type Description
id int Rule ID
archive_id int Document ID
min_quantity int Minimum Quantity
max_quantity int Maximum Quantity
sku_id int SKU ID
discount_rate int Discount rate, 0-100
created_time int Creation time
updated_time int Update time

Usage Example

Request example

GET /api/archive/sku?id=1 HTTP/1.1
Host: your-domain.com
Content-Type: application/json

or

GET /api/archive/sku?filename=product-slug HTTP/1.1
Host: your-domain.com
Content-Type: application/json

Response Example

{
  "code": 0,
  "data": {
    "id": 1,
    "title": "示例产品",
    "currency": "人民币",
    "currency_symbol": "¥",
    "price": 100.00,
    "min_price": 80.00,
    "max_price": 120.00,
    "user_limit": 10,
    "quota_used": 2,
    "order_count": 100,
    "stock": 998,
    "options": [
      {
        "id": 1,
        "title": "颜色",
        "values": [
          {
            "id": 1,
            "option_id": 1,
            "option_title": "颜色",
            "title": "红色",
            "color": "#FF0000",
            "price": 100.00
          },
          {
            "id": 2,
            "option_id": 1,
            "option_title": "颜色",
            "title": "蓝色",
            "color": "#0000FF",
            "price": 100.00
          }
        ]
      },
      {
        "id": 2,
        "title": "尺寸",
        "values": [
          {
            "id": 3,
            "option_id": 2,
            "option_title": "尺寸",
            "title": "大号",
            "color": "",
            "price": 100.00
          },
          {
            "id": 4,
            "option_id": 2,
            "option_title": "尺寸",
            "title": "小号",
            "color": "",
            "price": 100.00
          }
        ]
      }
    ],
    "skus": [
      {
        "id": 1,
        "title": "红色-大号",
        "symbol": "1-3",
        "values": [
          {
            "id": 1,
            "option_id": 1,
            "option_title": "颜色",
            "title": "红色",
            "color": "#FF0000",
            "price": 100.00
          },
          {
            "id": 3,
            "option_id": 2,
            "option_title": "尺寸",
            "title": "大号",
            "color": "",
            "price": 100.00
          }
        ],
        "sku": "SKU001",
        "barcode": "123456789",
        "hs_code": "",
        "logo": "",
        "thumb": "",
        "stock": 100,
        "price": 10000,
        "origin_price": 12000,
        "weight": 100,
        "weight_unit": "g",
        "sold_count": 50
      }
    ],
    "wholesale_rules": [
      {
        "id": 1,
        "archive_id": 1,
        "min_quantity": 1,
        "max_quantity": 10,
        "sku_id": 1,
        "discount_rate": 90,
        "created_time": 1630000000,
        "updated_time": 1630000000
      }
    ]
  },
  "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