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

历史订单

接口描述

URLindex.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

响应示例

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


商品分类

接口描述

URLindex.php?route=common/home/categorieapi
功能描述获取商品分类列表
返回格式Json,UTF8
HTTP请求方式GET

返回参数

参数名参数全称必选参数类型参数描述
namenametrueString分类名称
category_idcategory_idtrueInt分类 ID
imageimagetrueString图片
hrefhreftrueString商品列表 API

调用示例

index.php?route=common/home/categorieapi

响应示例

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


获取商品列表

接口描述

URLindex.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

响应示例

{
    "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"
}


获取商品详细信息

接口描述

URLindex.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选项值列表

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

响应示例

{
    "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": []
}


上一篇:解决firefox总是提示flash插件被拦截,要手动点击允许的问题,

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

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