App加Web项目 Opencart Api接口文档,简体版

歷史訂單

接口描述

URL/index.php?route=account/order/api
功能描述歷史訂單
返回格式Json,UTF8
HTTP請求方式GET

返回參數

參數名參數全稱必选參數類型參數描述
order_idorder_idtrueInt訂單 ID
namenametrueString客戶
statusstatustrueString訂單狀態
date_addeddate_addedtrueString訂單日期
productsproductstrueInt商品數量
totaltotaltrueString合計

调用示例

/index.php?route=account/order/api

響應示例

{
    "success": true,
    "message": "",
    "orders": [
        {
            "order_id": "1",
            "name": "admin test",
            "status": "Complete",
            "date_added": "2016/11/09",
            "products": 1,
            "total": "HK $0.00"
        }
        ......
    ]
}


商品分類

接口描述

URL/index.php?route=common/home/categorieapi
功能描述獲取商品分類列表
返回格式Json,UTF8
HTTP請求方式GET

返回參數

參數名參數全稱必选參數類型參數描述
namenametrueString分類名稱
category_idcategory_idtrueInt分類 ID
imageimagetrueString圖片
hrefhreftrueString商品列表 API

调用示例

/index.php?route=common/home/categorieapi

響應示例

{
    "success": true,
    "message": "",
    "categories": [
        {
            "name": "女士服裝",
            "category_id": "79",
            "image": "/image/cache/no_image-100x100.png",
            "href": "/index.php?route=product/category/api&path=79"
        },
        ......
    ]
}


獲取商品列表

接口描述

URL/index.php?route=product/category/api
功能描述根據分類 ID 獲取商品列表
返回格式Json,UTF8
HTTP請求方式GET

業務參數

參數名參數全稱必选參數类型參數描述
pathpathtrueInt分類 ID
pagepagefalseInt查詢第幾頁數據
sortsortfalseString排序方式:默認 p.sort_order
pd.name  名稱
p.price     價格
rating        評分
p.model     型號
orderorderfalseString升序排序:ASC  降序排序:DESC
limitlimitfalseInt每頁返回結果數  默認:15

返回參數

參數名參數全稱必选參數類型參數描述
totaltotaltrueInt結果條數
product_idproduct_idtrueInt商品 ID
thumbthumbtrueString圖片地址
namenametrueString名稱
descriptiondescriptiontrueString描述
pricepricetrueString價格
specialspecialtrueString優惠價格
taxtaxtrueString價格含稅
minimumminimumtrueInt最小起訂數量
ratingratingtrueInt評價
hrefhreftrueString商品詳細 API

调用示例

/index.php?route=product/category/api&path=79

響應示例

{
    "success": true,
    "message": "",
    "total": "3",
    "products": [
        {
            "product_id": "76",
            "thumb": "/image/cache/catalog/TB2fhHlb4vzQeBjSZFxXXXLBpXa_!!12883669.jpg_270x270-300x300.jpg",
            "name": "女士服裝",
            "description": "...",
            "price": "HK $300.00",
            "special": "HK $288.00",
            "tax": false,
            "minimum": "1",
            "rating": 0,
            "href": "/index.php?route=product/product/api&path=79&product_id=76"
        },
        ......
    ],
    "sort": "p.sort_order",
    "order": "ASC",
    "limit": "15"
}


獲取商品詳細信息

接口描述

URL/index.php?route=product/product/api
功能描述根據商品 ID 獲取商品詳細信息
返回格式Json,UTF8
HTTP請求方式GET

業務參數

參數名參數全稱必选參數类型參數描述
product_idproduct_idtrueInt商品 ID

返回參數

參數名參數全稱必选參數類型參數描述
stockstocktrueString庫存狀況
thumbthumbtrueString圖片
imagesimagestrueJSONArray其他图片列表
pricepricetrueString價格
specialspecialtrueString優惠價格
taxtaxtrueString價格含稅
discountsdiscountstrueString促銷活動
optionsoptionstrueJSONArray商品選項
minimumminimumtrueInt最小起訂數量
ratingratingtrueInt評價
customer_namecustomer_nametrueString顧客名稱
productsproductstrueString相關商品列表
商品選項详细字段:options
父字段字段字段类型字段描述
optionsproduct_option_idInt商品選項 ID

product_option_valueJSONArray選項值列表

option_idInt選項 ID

nameString選項名稱

typeString選項類型
           checkbox  復選框
           select        選擇
           radio         單選

requiredInt是否必填

sort_orderInt排序
選項值列表详细字段:product_option_value
父字段字段字段类型字段描述
product_option_valueproduct_option_value_idInt商品選項值列表 ID

option_value_idInt選項值列表 ID

nameString名稱

imageString選項縮略圖

option_imageString商品選項圖

priceString價格

quantityInt數量

price_prefixString價格   + 加   - 減

调用示例

/index.php?route=product/product/api&path=79&product_id=76

響應示例

{
    "success": true,
    "message": "",
    "stock": "有現貨",
    "thumb": "/image/cache/catalog/TB2fhHlb4vzQeBjSZFxXXXLBpXa_!!12883669.jpg_270x270-200x200.jpg",
    "images": [
        {
            "popup": null
        }
        ......
    ],
    "price": "HK $300.00",
    "special": "HK $288.00",
    "tax": false,
    "discounts": [],
    "options": [
        {
            "product_option_id": "298",
            "product_option_value": [
                {
                    "product_option_value_id": "116",
                    "option_value_id": "76",
                    "name": "白色",
                    "image": null,
                    "option_image": "/image/cache/catalog/TB2AWIgb8PzQeBjSZFLXXa3cXXa_!!2069568072.jpg_250x250-100x100.jpg",
                    "price": "HK $125,555.00",
                    "quantity": "8888",
                    "price_prefix": "+"
                },
                {
                    "product_option_value_id": "117",
                    "option_value_id": "77",
                    "name": "黑色",
                    "image": null,
                    "option_image": "/image/cache/catalog/TB1gZq2LpXXXXaHXXXXXXXXXXXX_!!0-item_pic.jpg_250x250-100x100.jpg",
                    "price": false,
                    "quantity": "999",
                    "price_prefix": "+"
                },
                {
                    "product_option_value_id": "118",
                    "option_value_id": "78",
                    "name": "粉紅",
                    "image": null,
                    "option_image": "/image/cache/catalog/TB2m4GCaRaM.eBjSZFMXXcypVXa_!!2137685604.jpg_250x250-100x100.jpg",
                    "price": false,
                    "quantity": "9999",
                    "price_prefix": "+"
                }
                ......
            ],
            "option_id": "26",
            "name": "顏色",
            "type": "select",
            "value": "",
            "required": "1",
            "sort_order": "1"
        },
        {
            "product_option_id": "299",
            "product_option_value": [
                {
                    "product_option_value_id": "121",
                    "option_value_id": "79",
                    "name": "Small",
                    "image": null,
                    "option_image": null,
                    "price": false,
                    "quantity": "999",
                    "price_prefix": "+"
                },
                {
                    "product_option_value_id": "120",
                    "option_value_id": "80",
                    "name": "Medium",
                    "image": null,
                    "option_image": null,
                    "price": false,
                    "quantity": "999",
                    "price_prefix": "+"
                },
                {
                    "product_option_value_id": "119",
                    "option_value_id": "81",
                    "name": "Large",
                    "image": null,
                    "option_image": null,
                    "price": false,
                    "quantity": "999",
                    "price_prefix": "+"
                }
                ...
            ],
            "option_id": "27",
            "name": "尺寸",
            "type": "select",
            "value": "",
            "required": "1",
            "sort_order": "2"
        }
        ......
    ],
    "minimum": "1",
    "review_status": "1",
    "review_guest": true,
    "customer_name": "admin test",
    "reviews": "0 評價",
    "rating": 0,
    "captcha": "/index.php?route=extension/captcha/basic_captcha/captcha",
    "attribute_groups": [],
    "products": [],
    "recurrings": []
}


上一篇:App加Web项目 Opencart Api接口文档,简体版

下一篇:PHP实现查询汉字笔画、笔画排序、笔画统计

评论列表
发表评论
称呼
邮箱
网址
验证码(*)
热评文章
相关阅读