App加Web项目 Opencart Api接口文档,简体版
歷史訂單
接口描述
| URL | /index.php?route=account/order/api |
| 功能描述 | 歷史訂單 |
| 返回格式 | Json,UTF8 |
| HTTP請求方式 | GET |
返回參數
| 參數名 | 參數全稱 | 必选 | 參數類型 | 參數描述 |
|---|---|---|---|---|
| order_id | order_id | true | Int | 訂單 ID |
| name | name | true | String | 客戶 |
| status | status | true | String | 訂單狀態 |
| date_added | date_added | true | String | 訂單日期 |
| products | products | true | Int | 商品數量 |
| total | total | true | String | 合計 |
调用示例
/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 |
返回參數
| 參數名 | 參數全稱 | 必选 | 參數類型 | 參數描述 |
|---|---|---|---|---|
| name | name | true | String | 分類名稱 |
| category_id | category_id | true | Int | 分類 ID |
| image | image | true | String | 圖片 |
| href | href | true | String | 商品列表 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 |
業務參數
| 參數名 | 參數全稱 | 必选 | 參數类型 | 參數描述 |
|---|---|---|---|---|
| path | path | true | Int | 分類 ID |
| page | page | false | Int | 查詢第幾頁數據 |
| sort | sort | false | String | 排序方式:默認 p.sort_order pd.name 名稱 p.price 價格 rating 評分 p.model 型號 |
| order | order | false | String | 升序排序:ASC 降序排序:DESC |
| limit | limit | false | Int | 每頁返回結果數 默認:15 |
返回參數
| 參數名 | 參數全稱 | 必选 | 參數類型 | 參數描述 |
|---|---|---|---|---|
| total | total | true | Int | 結果條數 |
| product_id | product_id | true | Int | 商品 ID |
| thumb | thumb | true | String | 圖片地址 |
| name | name | true | String | 名稱 |
| description | description | true | String | 描述 |
| price | price | true | String | 價格 |
| special | special | true | String | 優惠價格 |
| tax | tax | true | String | 價格含稅 |
| minimum | minimum | true | Int | 最小起訂數量 |
| rating | rating | true | Int | 評價 |
| href | href | true | String | 商品詳細 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_id | product_id | true | Int | 商品 ID |
返回參數
| 參數名 | 參數全稱 | 必选 | 參數類型 | 參數描述 |
|---|---|---|---|---|
| stock | stock | true | String | 庫存狀況 |
| thumb | thumb | true | String | 圖片 |
| images | images | true | JSONArray | 其他图片列表 |
| price | price | true | String | 價格 |
| special | special | true | String | 優惠價格 |
| tax | tax | true | String | 價格含稅 |
| discounts | discounts | true | String | 促銷活動 |
| options | options | true | JSONArray | 商品選項 |
| minimum | minimum | true | Int | 最小起訂數量 |
| rating | rating | true | Int | 評價 |
| customer_name | customer_name | true | String | 顧客名稱 |
| products | products | true | String | 相關商品列表 |
商品選項详细字段:options
| 父字段 | 字段 | 字段类型 | 字段描述 |
|---|---|---|---|
| options | product_option_id | Int | 商品選項 ID |
| product_option_value | JSONArray | 選項值列表 | |
| option_id | Int | 選項 ID | |
| name | String | 選項名稱 | |
| type | String | 選項類型 checkbox 復選框 select 選擇 radio 單選 | |
| required | Int | 是否必填 | |
| sort_order | Int | 排序 |
選項值列表详细字段:product_option_value
| 父字段 | 字段 | 字段类型 | 字段描述 |
|---|---|---|---|
| product_option_value | product_option_value_id | Int | 商品選項值列表 ID |
| option_value_id | Int | 選項值列表 ID | |
| name | String | 名稱 | |
| image | String | 選項縮略圖 | |
| option_image | String | 商品選項圖 | |
| price | String | 價格 | |
| quantity | Int | 數量 | |
| price_prefix | String | 價格 + 加 - 減 |
调用示例
/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": []
}
评论列表
发表评论
热评文章
相关阅读