DBShop的API接口

来自DBShop帮助中心
跳转至: 导航搜索

目录

API接口更新记录

DBShop的API接口版本更新历史

启用API接口

手机API接口需要运行环境的PHP版本高于5.4版本(5.4或者低版本可能无法正常运行),可以使用PHP5.5、PHP5.6、PHP7等版本。

20170101181246.png
20170101181306.png
20170101181323.png
20170101181357.png
20170101181439.png
20170101181502.png

使用API接口前必看

Url请求地址(必填):http(s)://站点地址/Jsonapi
API密钥(必填):apikey
数据输出类型:JSON

apiKey 必须在调用的url中存在,否则接口无法正常使用。使用方式举例:http(s)://站点地址/Jsonapi?apikey=apikey值

注意:
1、下面的接口说明中,Url地址中并没有包含 apikey ,请开发人员在实际开发中自行添加。
2、下面的接口说明内的Url地址中已经包含了对应的请求方法。
举例说明下面的接口如何使用

Url地址 http://demo.dbshop.net/Jsonapi/goodsClass
请求方法 goodsClass
请求类型 post

之所以把请求方法写出来,是为了方便开发者复制方法名称
正确的Url调用地址:http://demo.dbshop.net/Jsonapi/goodsClass?apikey=apikey值
至于请求类似 post 或者 get 对应的是接口内的参数请求,与Url调用不冲突。

 目前提供DBShop可用的大部分API接口,还有一些接口,我们将在后面的日子里添加,如:第三方登录、用户确认订单后评价商品、文章列表、文章内容、API特殊信息调用。

数据字典

对于API抛出的信息,如果不了解具体是什么内容,可以查看DBShop系统的数据字典,DBShop数据字典地址 http://help.dbshop.net/DBShop/dbshopDatabase/

公共接口

接口连接测试

Url地址 http://demo.dbshop.net/Jsonapi
{
    "status": "success",
    "msg": "接口连接成功!"
}

{
    "status": "error",
    "msg": "Api Key Error"
}

商城(系统)基本信息

Url地址 http://demo.dbshop.net/Jsonapi/shopinfo
请求方法 shopinfo
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": {
        "shop_name": "DBShop网店系统演示程序",
        "shop_extend_name": "|测试店铺|电子商务网店|dbshop单店系统|dbshop|zf2单店系统|电商平台演示",
        "shop_keywords": "测试店铺,电子商务网店,dbshop单店系统,dbshop,zf2单店系统,网店系统,电商平台演示",
        "shop_hot_keywords": "手机|平板|iphone|眼镜",
        "shop_description": "测试店铺,电子商务网店,dbshop单店系统,dbshop,zf2单店系统,网店系统,电商平台演示",
        "shop_close": "",
        "shop_close_info": "系统升级中……",
        "shop_logo": "http://demoimg.dbshop.net/public/upload/common/shop_logo_1403715951.png"
    }
}

商品接口

商品分类

Url地址 http://demo.dbshop.net/Jsonapi/goodsClass
请求方法 goodsClass
请求类型 post
参数 是否必填 说明
class_id 必填 当class_id为0时,输出所有分类,非0时,输出对应分类的下级所有分类信息
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": {
        "19": {
            "class_id": "19",
            "class_top_id": "7",
            "class_name": "洗护用品",
            "class_path": "7,19",
            "class_state": "1",
            "class_info": "",
            "class_sort": "255",
            "class_title_extend": "",
            "class_keywords": "",
            "class_description": "",
            "class_icon": null,
            "class_image": null,
            "navigation_show": null,
            "has_children": "0",
            "goods_num": "0",
            "class_level": 1
        }
    }
}

单个商品分类信息

Url地址 http://demo.dbshop.net/Jsonapi/oneGoodsClass
请求方法 oneGoodsClass
请求类型 post
参数 是否必填 说明
class_id 必填 不能为0
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": {
        "class_id": "1",
        "class_top_id": "0",
        "class_name": "服装鞋帽",
        "class_path": "1",
        "class_state": "0",
        "class_info": "",
        "class_sort": "255",
        "class_title_extend": "",
        "class_keywords": "",
        "class_description": "",
        "class_icon": null,
        "class_image": null,
        "navigation_show": null
    }
}

商品列表

Url地址 http://demo.dbshop.net/Jsonapi/goodsList
请求方法 goodsList
请求类型 get
参数 是否必填 说明
class_id 必填 商品分类id不能为0
page 必填 调取页数,如果不填写默认是 1
qty 必填 每页显示的商品数量,如果不填写默认是 10
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": [
        {
            "goods_id": "12",
            "goods_item": "DB0980",
            "brand_id": "0",
            "attribute_group_id": "0",
            "goods_state": "1",
            "goods_weight": "0",
            "goods_type": "1",
            "virtual_goods_add_state": "0",
            "goods_start_time": "",
            "goods_end_time": "",
            "goods_price": "2000",
            "goods_shop_price": "1799",
            "goods_preferential_price": "0",
            "goods_preferential_start_time": "",
            "goods_preferential_end_time": "",
            "goods_integral_num": "0",
            "goods_stock": "1073",
            "goods_out_of_stock_set": "0",
            "goods_cart_buy_max_num": "0",
            "goods_cart_buy_min_num": "0",
            "goods_stock_state": "1",
            "goods_stock_state_open": "1",
            "goods_out_stock_state": "2",
            "goods_add_time": "1390707769",
            "goods_sort": "255",
            "goods_tag_str": ",17,16,15,",
            "goods_click": "3403",
            "goods_class_have_true": "1",
            "virtual_sales": "0",
            "goods_thumbnail_image": "http://demoimg.dbshop.net/public/upload/goods/20131212/thumb_71f675f2f88f42fa50741bb71bb054b6.jpg",
            "one_class_id": "4",
            "buy_num": "335",
            "favorites_num": "6",
            "goods_name": "HP 惠普 LaserJet Pro 400 M401D 黑白激光自动双面打印机( P2055d 升级版 )",
            "goods_info": "",
            "goods_extend_name": "特价抢起来!心动不如行动!自动双面打印!",
            "goods_keywords": "",
            "goods_description": "",
            "goods_image_id": "145",
            "class_id": "4",
            "class_goods_sort": "255",
            "class_state": "1",
            "class_recommend": "0"
        }
    ]
}

商品信息

Url地址 http://demo.dbshop.net/Jsonapi/goodsInfo
请求方法 goodsInfo
请求类型 post
参数 是否必填 说明
class_id 必填 商品分类id,不能为0
goods_id 必填 商品id
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": {
        "goods_id": "16",
        "goods_item": "DBS000016",
        "brand_id": "0",
        "attribute_group_id": "2",
        "goods_state": "1",
        "goods_weight": "0",
        "goods_type": "1",
        "virtual_goods_add_state": "0",
        "goods_start_time": "",
        "goods_end_time": "",
        "goods_price": 0,
        "goods_shop_price": "0.02",
        "goods_preferential_price": 0,
        "goods_preferential_start_time": "",
        "goods_preferential_end_time": "",
        "goods_integral_num": "0",
        "goods_stock": "有货",
        "goods_out_of_stock_set": "0",
        "goods_cart_buy_max_num": "0",
        "goods_cart_buy_min_num": "0",
        "goods_stock_state": "1",
        "goods_stock_state_open": "1",
        "goods_out_stock_state": "2",
        "goods_add_time": "1483195919",
        "goods_sort": "255",
        "goods_tag_str": ",",
        "goods_click": "405",
        "goods_class_have_true": "1",
        "virtual_sales": "0",
        "goods_thumbnail_image": "http://7xifww.com1.z0.glb.clouddn.com/Fl-bLE75B9OgKxFK91x1WCD174gT",
        "goods_title_image": "http://7xifww.com1.z0.glb.clouddn.com/FrKCxh4QksRvDtPYRCze2oyLmG2N",
        "goods_name": "这是第二个测试商品(test)",
        "goods_info": "",
        "goods_body": "",
        "goods_image_id": "185",
        "goods_extend_name": "",
        "goods_keywords": "",
        "goods_description": "",
        "language": "zh_CN",
        "color": {
            "name": "颜色",
            "list": [
                {
                    "value": "ffffb1",
                    "info": "浅黄色"
                },
                {
                    "value": "008000",
                    "info": "绿色"
                }
            ]
        },
        "size": {
            "name": "尺寸",
            "list": [
                {
                    "value": "XS",
                    "info": "XS"
                }
            ]
        },
        "images": [
            {
                "goods_image": "http://7xifww.com1.z0.glb.clouddn.com/FrKCxh4QksRvDtPYRCze2oyLmG2N",
                "goods_tmb_image": "http://7xifww.com1.z0.glb.clouddn.com/Fl-bLE75B9OgKxFK91x1WCD174gT"
            }
        ],
        "custom": [
            {
                "custom_title": "自定义标题",
                "custom_content": "自定义内容",
                "custom_key": "1",
                "goods_id": "16"
            }
        ],
        "attribute": [
            {
                "name": "颜色",
                "value": "请问请问"
            }
        ],
        "brand_info": []
    }
}

商品规格信息

Url地址 http://demo.dbshop.net/Jsonapi/goodsSpecInfo
请求方法 goodsSpecInfo
请求类型 post
参数 是否必填 说明
goods_id 必填 商品id
color_value 必填 规格颜色的value值
size_value 必填 规格尺寸的value值
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": {
        "goods_item": "DBS000016-1",
        "goods_shop_price": "0.02",
        "goods_stock": "有货"
    }
}

商品咨询(分页列表)

Url地址 http://demo.dbshop.net/Jsonapi/goodsAsk
请求方法 goodsAsk
请求类型 get
参数 是否必填 说明
goods_id 必填 商品id
page 必填 调取页数,如果不填写默认是 1
qty 必填 每页显示的商品数量,如果不填写默认是 10
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": [
        {
            "ask_id": "11",
            "ask_writer": "111111",
            "ask_content": "这个相机可以便宜吗?",
            "ask_time": "1428050679",
            "ask_show_state": "1",
            "reply_ask_content": "不好意思不能便宜",
            "reply_ask_time": "1428050943",
            "reply_ask_writer": "admin",
            "goods_id": "3",
            "goods_name": "Nikon 尼康 D90 单反相机 (AF-S DX 18-105 f/3.5-5.6G ED VR 防抖镜头)",
            "user_avatar": null
        }
    ]
}

添加商品咨询

Url地址 http://demo.dbshop.net/Jsonapi/addGoodsAsk
请求方法 addGoodsAsk
请求类型 post
参数 是否必填 说明
goods_id 必填 商品id
goods_ask_content 必填 商品咨询内容
user_token 非必填 当用户登录状态时,传递此值
{
    "status": "success",
    "msg": "添加商品咨询成功!"
}

{
    "status": "error",
    "msg": "添加商品咨询失败!"
}

商品评价(列表)

Url地址 http://demo.dbshop.net/Jsonapi/goodsComment
请求方法 goodsComment
请求类型 get
参数 是否必填 说明
goods_id 必填 商品id
page 必填 调取页数,如果不填写默认是 1
qty 必填 每页显示的商品数量,如果不填写默认是 10
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": [
        {
            "comment_id": "2",
            "comment_writer": "111111",
            "comment_body": "请问请问我",
            "goods_evaluation": "5",
            "comment_time": "1482427211",
            "comment_show_state": "1",
            "reply_body": "还不错",
            "reply_time": "1482428283",
            "reply_writer": "admin",
            "goods_id": "2",
            "order_goods_id": "1",
            "user_avatar": null
        }
    ]
}

收藏商品

Url地址 http://demo.dbshop.net/Jsonapi/addGoodsFavorites
请求方法 addGoodsFavorites
请求类型 post
参数 是否必填 说明
class_id 必填 商品分类id
goods_id 必填 商品id
user_token 必填 用户登录状态时传此值,无此值时,会提示需要登录
{
    "status": "success",
    "msg": "该商品成功加入收藏!"
}

商品搜索

Url地址 http://demo.dbshop.net/Jsonapi/searchGoods
请求方法 searchGoods
请求类型 get
参数 是否必填 说明
keywords 非必填 可以是商品中的任何文字检索,用空格分开可精确检索
page 必填 调取页数,如果不填写默认是 1
qty 必填 每页显示的商品数量,如果不填写默认是 10
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": [
        {
            "goods_id": "10",
            "goods_item": "DBP32233",
            "brand_id": "0",
            "attribute_group_id": "0",
            "goods_state": "1",
            "goods_weight": "0",
            "goods_type": "1",
            "virtual_goods_add_state": "0",
            "goods_start_time": "",
            "goods_end_time": "",
            "goods_price": "0",
            "goods_shop_price": "120",
            "goods_preferential_price": "0",
            "goods_preferential_start_time": "",
            "goods_preferential_end_time": "",
            "goods_integral_num": "0",
            "goods_stock": "10",
            "goods_out_of_stock_set": "0",
            "goods_cart_buy_max_num": "0",
            "goods_cart_buy_min_num": "0",
            "goods_stock_state": "1",
            "goods_stock_state_open": "1",
            "goods_out_stock_state": "2",
            "goods_add_time": "1416049562",
            "goods_sort": "255",
            "goods_tag_str": ",13,16,",
            "goods_click": "2073",
            "goods_class_have_true": "1",
            "virtual_sales": "0",
            "goods_thumbnail_image": "http://demoimg.dbshop.net/public/upload/goods/20131212/thumb_095d7bb190ca161c2fb2dece67c271ac.jpg",
            "one_class_id": "2",
            "buy_num": "10",
            "favorites_num": "1",
            "goods_name": "Galanz 格兰仕 G80F23CN2P-BM1(S0) 微波炉",
            "goods_info": "",
            "goods_extend_name": "产业,北美,配套,冰箱,中山,顺德,广东,拥有国,国际,研究,领先,世界级,百年企业,简介,一家,定位,百年,位于,制造,制造中,销售,多家,公司和,香港,营销,设",
            "goods_description": "世界级,百年企业,简介,一家,定位,百年,位于,制造,制造中,销售,多家,公司和,香港,营销,设",
            "goods_image_id": "136"
        }
    ]
}

商品品牌

Url地址 http://demo.dbshop.net/Jsonapi/goodsBrand
请求方法 goodsBrand
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": [
        {
            "brand_id": "5",
            "brand_sort": "255",
            "goods_num": "2",
            "brand_name": "联想",
            "brand_logo": "http://demoimg.dbshop.net/public/upload/brand/2.jpg",
            "brand_info": "联想是一家极富创新的个人科技产品公司。作为全球第二大PC厂商,联想为全球用户提供Think品牌商用PC、Idea品牌消费PC、服务器、工作站以及包括平板电脑、智能手机和智能电视在内的家庭移动互联网终端。",
            "brand_title_extend": "",
            "brand_keywords": "",
            "brand_description": "",
            "language": "zh_CN"
        },
        {
            "brand_id": "2",
            "brand_sort": "255",
            "goods_num": "0",
            "brand_name": "dell",
            "brand_logo": "http://demoimg.dbshop.net/public/upload/brand/23.jpg",
            "brand_info": "<p>DELL</p>",
            "brand_title_extend": "",
            "brand_keywords": "",
            "brand_description": "",
            "language": "zh_CN"
        }
    ]
}

品牌商品列表

Url地址 http://demo.dbshop.net/Jsonapi/brandGoodsList
请求方法 brandGoodsList
请求类型 get
参数 是否必填 说明
brand_id 必填 品牌id
page 必填 调取页数,如果不填写默认是 1
qty 必填 每页显示的商品数量,如果不填写默认是 10
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": [
        {
            "goods_id": "9",
            "goods_item": "DBT98734",
            "brand_id": "5",
            "attribute_group_id": "0",
            "goods_state": "1",
            "goods_weight": "0",
            "goods_type": "1",
            "virtual_goods_add_state": "0",
            "goods_start_time": "",
            "goods_end_time": "",
            "goods_price": "0",
            "goods_shop_price": "7000",
            "goods_preferential_price": "0",
            "goods_preferential_start_time": "",
            "goods_preferential_end_time": "",
            "goods_integral_num": "0",
            "goods_stock": "10",
            "goods_out_of_stock_set": "0",
            "goods_cart_buy_max_num": "0",
            "goods_cart_buy_min_num": "0",
            "goods_stock_state": "1",
            "goods_stock_state_open": "1",
            "goods_out_stock_state": "2",
            "goods_add_time": "1416049503",
            "goods_sort": "255",
            "goods_tag_str": ",13,15,16,",
            "goods_click": "1470",
            "goods_class_have_true": "1",
            "virtual_sales": "0",
            "goods_thumbnail_image": "http://demoimg.dbshop.net/public/upload/goods/20131212/thumb_0c4bbc095f841429ee0be516545ab540.jpg",
            "one_class_id": "4",
            "buy_num": "68",
            "favorites_num": "2",
            "goods_name": "ThinkPad 联想 E431(62771A5) 14英寸笔记本电脑 (i5-3230M/2GB/500GB/2GB独立显卡/摄像头/蓝牙/WIN8)",
            "goods_info": "",
            "goods_extend_name": "三代酷睿 主频2.6可睿频至3.2G 强悍2G独显 !",
            "goods_keywords": "商品,配置,顶级,才有,系列,请注意,E431,指纹识别,及高,机型,本机,分屏,为准,不带,官网,仅供参考,特性,图片,具体,参数,规格,介绍",
            "goods_description": "商品,配置,顶级,才有,系列,请注意,E431,指纹识别,及高,机型,本机,分屏,为准,不带,官网,仅供参考,特性,图片,具体,参数,规格,介绍",
            "goods_image_id": "131"
        },
        {
            "goods_id": "2",
            "goods_item": "L343434",
            "brand_id": "5",
            "attribute_group_id": "1",
            "goods_state": "1",
            "goods_weight": "0",
            "goods_type": "1",
            "virtual_goods_add_state": "0",
            "goods_start_time": "",
            "goods_end_time": "",
            "goods_price": "2000",
            "goods_shop_price": "1500",
            "goods_preferential_price": "0",
            "goods_preferential_start_time": "",
            "goods_preferential_end_time": "",
            "goods_integral_num": "0",
            "goods_stock": "89",
            "goods_out_of_stock_set": "0",
            "goods_cart_buy_max_num": "0",
            "goods_cart_buy_min_num": "0",
            "goods_stock_state": "1",
            "goods_stock_state_open": "1",
            "goods_out_stock_state": "2",
            "goods_add_time": "1390707795",
            "goods_sort": "255",
            "goods_tag_str": ",17,16,15,",
            "goods_click": "3169",
            "goods_class_have_true": "1",
            "virtual_sales": "0",
            "goods_thumbnail_image": "http://demoimg.dbshop.net/public/upload/goods/thumb_116ea4f52990c76593aae0bcc5984852.jpg",
            "one_class_id": "3",
            "buy_num": "40",
            "favorites_num": "2",
            "goods_name": "Lenovo 联想 四核 P780 (GSM/WCDMA)双卡双待 手机 黑色",
            "goods_info": "",
            "goods_extend_name": "测试商品",
            "goods_keywords": "",
            "goods_description": "",
            "goods_image_id": "8"
        }
    ]
}

购物车接口

获取购物车信息

Url地址 http://demo.dbshop.net/Jsonapi/cartData
请求方法 cartData
请求类型 post
参数 是否必填 说明
user_unionid 必填 用户唯一性标识,由用户端自行生成(开发者开发)
{
    "status":"success",
    "msg":"信息调用成功!",
    "result":{
        "cart_price":0.04,
        "cart_weight":0,
        "cart_integral_num":0,
        "cart_goods":[
            {
                "goods_id":"16",
                "goods_name":"这是第二个测试商品(test)",
                "class_id":"2",
                "goods_image":"http://7xifww.com1.z0.glb.clouddn.com/Fl-bLE75B9OgKxFK91x1WCD174gT",
                "goods_stock_state":"1",
                "goods_stock":"43",
                "buy_num":"2",
                "goods_type":"1",
                "goods_shop_price":"0.02",
                "goods_color":"ffffb1",
                "goods_size":"XS",
                "goods_color_name":"颜色 : 浅黄色",
                "goods_size_name":"尺寸 : XS",
                "goods_item":"DBS000016-1",
                "goods_weight":"0",
                "buy_min_num":"0",
                "buy_max_num":"0",
                "integral_num":"0",
                "brand_id":"0",
                "class_id_array":"a:3:{i:0;s:1:"2";i:1;s:1:"5";i:2;s:2:"31";}",
                "user_unionid":"88888888",
                "goods_key":"16ffffb1XS"
            }
        ],
        "discount":{
            "discount_name":null,
            "discount_cost":null
        },
        "integral":{
            "integral_info":null,
            "integral_num":null
        },
        "integral_1":{
            "integral_info":null,
            "integral_num":null
        }
    }
}

添加商品到购物车

Url地址 http://demo.dbshop.net/Jsonapi/addCart
请求方法 addCart
请求类型 post
参数 是否必填 说明
class_id 必填 商品分类id
goods_id 必填 商品id
buy_goods_num 必填 购买数量
user_unionid 必填 由用户端自行生成(开发者开发)
color_value 非必填 颜色标记,只有在购买的商品有此值时,才需要传递
size_value 非必填 尺寸标记,只有在购买的商品有此值时,才需要传递
{
    "status": "success",
    "msg": "购物车添加成功!"
}

更新购物车商品(修改购物商品数量)

Url地址 http://demo.dbshop.net/Jsonapi/updateCart
请求方法 updateCart
请求类型 post
参数 是否必填 说明
goods_key 必填 商品标识唯一性(相对于用户而言,可以在获取购物车信息时得到)
buy_goods_num 必填 变更后的商品数量
user_unionid 必填 用户唯一标识,由客户端生成
{
    "status": "success",
    "msg": "购物车更新成功!",
    "result": {
        "cart_price": 0.06,
        "cart_weight": 0,
        "cart_integral_num": 0,
        "update_goods": {
            "goods_key": "16ffffb1XS",
            "buy_goods_num": 3,
            "goods_count_price": 0.06
        },
        "discount": {
            "discount_name": null,
            "discount_cost": null
        },
        "integral": {
            "integral_info": null,
            "integral_num": null
        },
        "integral_1": {
            "integral_info": null,
            "integral_num": null
        }
    }
}

获取购物车商品种类总数

Url地址 http://demo.dbshop.net/Jsonapi/cartGoodsCount
请求方法 cartGoodsCount
请求类型 post
参数 是否必填 说明
user_unionid 必填 用户唯一性标识,由用户端自行生成(开发者开发)
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": {
        "goods_count": 1
    }
}

删除购物车商品

Url地址 http://demo.dbshop.net/Jsonapi/delCartGoods
请求方法 delCartGoods
请求类型 post
参数 是否必填 说明
goods_key 必填 商品标识唯一性(相对于用户而言,可以在获取购物车信息时得到)
user_unionid 必填 用户唯一标识,由客户端生成
当购物车能有多种商品时,删除其中的一种,result 将返回删除后的购物车信息。
{
    "status": "success",
    "msg": "商品删除成功!",
    "result": null
}

清空购物车

Url地址 http://demo.dbshop.net/Jsonapi/clearCart
请求方法 clearCart
请求类型 post
参数 是否必填 说明
user_unionid 必填 用户唯一性标识,由用户端自行生成(开发者开发)
{
    "status": "success",
    "msg": "清空购物车成功!"
}

注册登录接口

获取用户注册项

Url地址 http://demo.dbshop.net/Jsonapi/registerItem
请求方法 registerItem
请求类型 get
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": {
        "register_state": "true",
        "item": {
            "user_name": "true",
            "user_password": "true",
            "user_com_passwd": "true",
            "user_email": "true",
            "user_phone": "false",
            "phone_captcha": "false"
        }
    }
}

用户注册

Url地址 http://demo.dbshop.net/Jsonapi/register
请求方法 register
请求类型 post
参数 是否必填 说明
user_name 必填 注册用户名称
user_password 必填 密码
user_com_passwd 必填 确认密码
user_email 非必填 电子邮箱,是否需要填写,要看上面获取的注册用户项,该参数是否返回 true
user_phone 非必填 手机号码,是否需要填写,要看上面获取的注册用户项,该参数是否返回 true
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": {
        "user_token": "276474d7ea727abb4888255b1fcdffea"
    }
}

注册协议

Url地址 http://demo.dbshop.net/Jsonapi/agreement
请求方法 agreement
请求类型 get
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": {
        "body": "客户注册协议内容:此内容可在后台 系统管理->客户设置 中设置"
    }
}

发送手机验证码

Url地址 http://demo.dbshop.net/Jsonapi/phoneCaptcha
请求方法 phoneCaptcha
请求类型 post
参数 是否必填 说明
user_phone 必填 手机号码
phone_captcha 必填 手机验证码,由外部设备自行生成,api不做生成处理
{
    "status": "error",
    "msg": "不是正确的手机号码!"
}

获取用户登录项

Url地址 http://demo.dbshop.net/Jsonapi/loginItem
请求方法 loginItem
请求类型 get
当 user_email 或 user_phone 为 true 时,说明当前除了可以通过用户名登录,也可以用 邮箱 或者 手机号码登录。 
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": {
        "user_name": {
            "user_name": "true",
            "user_email": "false",
            "user_phone": "false"
        },
        "user_password": "true"
    }
}

用户登录

Url地址 http://demo.dbshop.net/Jsonapi/login
请求方法 login
请求类型 post
参数 是否必填 说明
user_name 必填 用户名称同时也可以是手机号码或者邮箱,根据上面的登陆项接口获取状态是否为true,只是它们统一通过user_name进行登录处理
user_password 必填 用户密码
登录成功,将获取 user_token 值
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": {
        "user_token": "380edce66c162b76a5c37ba5d2b392ce"
    }
}

用户退出

Url地址 http://demo.dbshop.net/Jsonapi/loginOut
请求方法 loginOut
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录状态值
{
    "status": "success",
    "msg": "退出成功!"
}

找回密码

Url地址 http://demo.dbshop.net/Jsonapi/forgotpasswd
请求方法 forgotpasswd
请求类型 post
参数 是否必填 说明
user_name 必填 用户名
user_email 必填 用户邮箱
{
    "status": "success",
    "msg": "已经向您的邮箱 2770379118@qq.com 发送了一封邮件,请根据邮件内容完成新密码设定"
}

订单接口

获取配送地址

Url地址 http://demo.dbshop.net/Jsonapi/addressList
请求方法 addressList
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录状态值
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": [
        {
            "address_id": "107",
            "true_name": "111111",
            "region_id": "6",
            "region_value": "北京朝阳区",
            "address": "11111",
            "zip_code": "111111",
            "mod_phone": "111111",
            "tel_area_code": "",
            "tel_phone": "",
            "tel_ext": "",
            "addr_default": "0",
            "user_id": "133"
        }
    ]
}

添加或更新配送地址

Url地址 http://demo.dbshop.net/Jsonapi/saveAddress
请求方法 saveAddress
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录唯一标识
address_id 非必填 为空时添加配送地址,不为空时更新配送地址
true_name 必填 收货人姓名
region_id 必填 最后选中的地区id,比如 设置的 北京市 朝阳区 那么region_id就是 朝阳区 的id
region_value 必填 选中的所有地区的名称,比如 设置的 北京市 朝阳区 那么region_value就是 北京市 朝阳区
address 必填 详细地址
zip_code 必填 邮政编码
mod_phone 必填 手机号码
tel_area_code 非必填 座机号码的区号
tel_phone 非必填 座机号码
tel_ext 非必填 座机分机号
addr_default 非必填 是否为默认配送地址,1为默认配送地址
{
    "status": "success",
    "msg": "配送地址添加成功!"
}

删除配送地址

Url地址 http://demo.dbshop.net/Jsonapi/delAddress
请求方法 delAddress
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录状态值
address_id 必填 配送地址id
{
    "status": "success",
    "msg": "配送地址删除成功!"
}

获取地区列表

Url地址 http://demo.dbshop.net/Jsonapi/region
请求方法 region
请求类型 post
参数 是否必填 说明
region_top_id 必填 上一级的地区id,0是获取顶级地区信息
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": [
        {
            "region_id": "2",
            "region_top_id": "0",
            "region_sort": "1",
            "region_path": "2",
            "region_name": "天津",
            "language": "zh_CN"
        },
        {
            "region_id": "1",
            "region_top_id": "0",
            "region_sort": "255",
            "region_path": "1",
            "region_name": "北京",
            "language": "zh_CN"
        },
        {
            "region_id": "3",
            "region_top_id": "0",
            "region_sort": "255",
            "region_path": "3",
            "region_name": "河北省",
            "language": "zh_CN"
        },
        {
            "region_id": "4",
            "region_top_id": "0",
            "region_sort": "255",
            "region_path": "4",
            "region_name": "山东省",
            "language": "zh_CN"
        },
        {
            "region_id": "5",
            "region_top_id": "0",
            "region_sort": "255",
            "region_path": "5",
            "region_name": "河南省",
            "language": "zh_CN"
        }
    ]
}

购物车信息确认(提交订单前的确认)

Url地址 http://demo.dbshop.net/Jsonapi/step
请求方法 step
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录状态值
address_id 非必填 配送地址id
user_unionid 必填 用户唯一标识,由客户端生成
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": {
        "addressList": {
            "6": {
                "address_id": "6",
                "true_name": "666",
                "region_id": "1",
                "region_value": "北京市",
                "address": "多发发",
                "zip_code": "1222",
                "mod_phone": "1245",
                "tel_area_code": "",
                "tel_phone": "",
                "tel_ext": "",
                "addr_default": "0",
                "user_id": "1"
            },
            "7": {
                "address_id": "7",
                "true_name": "99999",
                "region_id": "18",
                "region_value": "天津市",
                "address": "6666",
                "zip_code": "666666",
                "mod_phone": "13654",
                "tel_area_code": "",
                "tel_phone": "",
                "tel_ext": "",
                "addr_default": "1",
                "user_id": "1"
            }
        },
        "default_address": {
            "address_id": "7",
            "true_name": "99999",
            "region_id": "18",
            "region_value": "天津市",
            "address": "6666",
            "zip_code": "666666",
            "mod_phone": "13654",
            "tel_area_code": "",
            "tel_phone": "",
            "tel_ext": "",
            "addr_default": "1",
            "user_id": "1"
        },
        "cart": {
            "cart_price": 20,
            "cart_weight": 0,
            "cart_integral_num": 2000,
            "cart_goods": [
                {
                    "goods_id": "2",
                    "goods_name": "商品测试12121",
                    "class_id": "1",
                    "goods_image": "http://192.168.0.7/zf2/GitOschina/DBShop/public/upload/goods/20170114/thumb_ee6f7bce12f1b0fdc79cca1e22823688.jpg",
                    "goods_stock_state": "1",
                    "goods_stock": "10",
                    "buy_num": "2",
                    "goods_type": "1",
                    "goods_shop_price": "10",
                    "goods_color": "",
                    "goods_size": "",
                    "goods_color_name": "",
                    "goods_size_name": "",
                    "goods_item": "DBS000002",
                    "goods_weight": "0",
                    "buy_min_num": "0",
                    "buy_max_num": "0",
                    "integral_num": "1000",
                    "brand_id": null,
                    "class_id_array": "a:1:{i:0;s:1:\"1\";}",
                    "user_unionid": "222222",
                    "goods_key": "2"
                }
            ],
            "discount": {
                "discount_name": "满10块减100",
                "discount_cost": 1
            },
            "integral": {
                "integral_info": null,
                "integral_num": null
            },
            "integral_1": {
                "integral_info": "购物10元送5等级积分",
                "integral_num": 10
            }
        },
        "total_weight": 0,
        "shippingList": [
            {
                "express_id": "7",
                "express_name": "顺丰速运",
                "express_name_code": "",
                "express_info": "国内服务质量最好,速度最快的速运公司。",
                "express_url": "",
                "express_sort": "255",
                "express_set": "T",
                "express_price": 0,
                "express_state": "1",
                "cash_on_delivery": "1",
                "selected": 1
            },
            {
                "express_id": "8",
                "express_name": "自有配送",
                "express_name_code": "",
                "express_info": "",
                "express_url": "",
                "express_sort": "255",
                "express_set": "T",
                "express_price": 6,
                "express_state": "1",
                "cash_on_delivery": "2"
            }
        ],
        "cash_on_delivery_str": "'7'",
        "payment": [
            {
                "payment_name": {
                    "title": "支付方式名称",
                    "content": "线下支付",
                    "name_id": "payment_name",
                    "input_type": "text",
                    "class": "span6"
                },
                "payment_logo": {
                    "title": "支付方式LOGO",
                    "content": "http://192.168.0.7/zf2/GitOschina/DBShop/public/img/payment/xxzf.gif",
                    "name_id": "payment_logo",
                    "input_type": "image"
                },
                "payment_info": {
                    "title": "支付方式简介",
                    "content": "线下支付",
                    "name_id": "payment_info",
                    "input_type": "textarea",
                    "class": "span8"
                },
                "payment_show": {
                    "title": "显示设置",
                    "content": {
                        "content1": {
                            "name": "全平台显示",
                            "value": "all"
                        }
                    },
                    "name_id": "payment_show",
                    "input_type": "checkbox",
                    "checked": "all"
                },
                "payment_fee": {
                    "title": "支付手续费",
                    "content": 0,
                    "name_id": "payment_fee",
                    "input_type": "text",
                    "class": "span2"
                },
                "payment_state": {
                    "title": "支付状态",
                    "content": {
                        "radio_1": {
                            "name": "开启",
                            "value": "1"
                        },
                        "radio_2": {
                            "name": "关闭",
                            "value": "0"
                        }
                    },
                    "name_id": "payment_state",
                    "input_type": "radio",
                    "checked": "1"
                },
                "payment_sort": {
                    "title": "支付排序",
                    "content": "255",
                    "name_id": "payment_sort",
                    "input_type": "text",
                    "class": "span1"
                },
                "editaction": "xxzf",
                "orders_state": "10",
                "selected": 1
            }
        ],
        "order_total": 19,
        "userIntegralNum": "6020",
        "integralCurrencyCon": 0.01
    }
}

订单提交

Url地址 http://demo.dbshop.net/Jsonapi/cartSubmit
请求方法 cartSubmit
请求类型 post
参数 是否必填 说明
user_unionid 必填 用户唯一标识,由客户端生成
address_id 必填 已经选择的配送地址id
user_token 必填 用户登录唯一标识
payment_code 必填 支付方式标识码(支付方式里的 editaction 值)
express_id 必填 配送方式id
integral_buy_num 非必填 用户使用的消费积分(只有购物车商品可以使用积分时,才会需要)
order_message 非必填 订单留言信息
invoice_title 非必填 发票抬头(文字形式)
invoice_content 非必填 发票内容(文字形式)
shipping_time 非必填 送货时间(文字形式)
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": {
        "order_sn": "20170101612437",
        "order_id": "468",
        "order_state": "10",
        "order_total": "¥0.04元"
    }
}

用户中心接口

获取用户信息

Url地址 http://demo.dbshop.net/Jsonapi/userInfo
请求方法 userInfo
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录状态值
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": {
        "user_name": "111111",
        "user_id": "133",
        "user_email": "2770379118@qq.com",
        "user_phone": "",
        "group_id": "1",
        "user_group_name": "普通会员",
        "user_avatar": "http://demo.dbshop.net/public/upload/common/default_avatar.png",
        "user_sex": "3",
        "user_birthday": "",
        "user_integral_num": "0",
        "integral_type_2_num": "0",
        "user_money": "4817.00"
    }
}

更新用户信息

Url地址 http://demo.dbshop.net/Jsonapi/saveUser
请求方法 saveUser
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录状态值
user_email 非必填 用户电子邮箱,是否必填,取决于 会员注册项 内 user_email 是否为true,当为 true时,user_email必填
user_sex 必填 用户性别,1 男、2 女、3 保密
user_phone 非必填 用户手机号码,是否必填,取决于 会员注册项 内 user_phone 是否为true,当为 true时,user_phone 必填
user_birthday 非必填 用户生日,格式类似于这样 1986-06-06
user_avatar 非必填 用户上传头像
{
	"status":"success",
	"msg":"信息更新成功!"
}

用户密码修改

Url地址 http://demo.dbshop.net/Jsonapi/saveUserPasswd
请求方法 saveUserPasswd
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录状态值
old_user_password 必填 原密码
user_password 必填 新密码
user_com_passwd 必填 确认密码(新密码)
{
    "status": "success",
    "msg": "密码修改成功!"
}

我的收藏(商品收藏列表)

Url地址 http://demo.dbshop.net/Jsonapi/favoritesGoods
请求方法 favoritesGoods
请求类型 get
参数 是否必填 说明
user_token 必填 用户登录唯一标识
page 必填 调取页数,如果不填写默认是 1
qty 必填 每页显示的商品数量,如果不填写默认是 10
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": [
        {
            "favorites_id": "52",
            "goods_id": "16",
            "class_id": "2",
            "user_id": "133",
            "time": "1483200736",
            "goods_thumbnail_image": "http://7xifww.com1.z0.glb.clouddn.com/Fl-bLE75B9OgKxFK91x1WCD174gT",
            "goods_title_image": "http://7xifww.com1.z0.glb.clouddn.com/FrKCxh4QksRvDtPYRCze2oyLmG2N",
            "goods_name": "这是第二个测试商品(test)"
        },
        {
            "favorites_id": "13",
            "goods_id": "1",
            "class_id": "1",
            "user_id": "133",
            "time": "1397928195",
            "goods_thumbnail_image": "http://demoimg.dbshop.net/public/upload/goods/thumb_0dce3d0a5adb7fa966b8319e89289165.jpg",
            "goods_title_image": "http://demoimg.dbshop.net/public/upload/goods/0dce3d0a5adb7fa966b8319e89289165.jpg",
            "goods_name": "2013新版韩款宽松格子领针织假两件毛衣 送毛衣链(数量有限,送完即止)3022 黄色(针织款) 均码"
        }
    ]
}

删除收藏商品

Url地址 http://demo.dbshop.net/Jsonapi/delFavoritesGoods
请求方法 delFavoritesGoods
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录状态值
favorites_id 必填 商品收藏id
{
    "status": "success",
    "msg": "收藏商品删除成功!"
}

我的咨询(会员中心)

Url地址 http://demo.dbshop.net/Jsonapi/homeGoodsAsk
请求方法 homeGoodsAsk
请求类型 get
参数 是否必填 说明
user_token 必填 用户登录状态值
page 必填 调取页数,如果不填写默认是 1
qty 必填 每页显示的商品数量,如果不填写默认是 10
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": [
        {
            "ask_id": "11",
            "ask_writer": "111111",
            "ask_content": "这个相机可以便宜吗?",
            "ask_time": "1428050679",
            "ask_show_state": "1",
            "reply_ask_content": "不好意思不能便宜",
            "reply_ask_time": "1428050943",
            "reply_ask_writer": "admin",
            "goods_id": "3",
            "goods_name": "Nikon 尼康 D90 单反相机 (AF-S DX 18-105 f/3.5-5.6G ED VR 防抖镜头)",
            "user_avatar": null
        }
    ]
}

删除我的咨询

Url地址 http://demo.dbshop.net/Jsonapi/homeGoodsAskDel
请求方法 homeGoodsAskDel
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录状态值
ask_id 必填 商品咨询id
{
    "status": "success",
    "msg": "商品咨询删除成功!"
}

获取最新订单

这里获取的订单不包括 被取消的订单 和 已经完成的订单
Url地址 http://demo.dbshop.net/Jsonapi/newOrder
请求方法 newOrder
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录状态值
order_num 非必填 获取订单数量,如果不填写,默认是5
{
    "status":"success",
    "msg":"信息调用成功!",
    "result":[
        {
            "order_id":"468",
            "order_sn":"20170101612437",
            "order_out_sn":null,
            "goods_serialize":"a:1:{i:549;a:9:{s:8:\"goods_id\";s:2:\"16\";s:8:\"class_id\";s:1:\"2\";s:10:\"goods_name\";s:33:\"这是第二个测试商品(test)\";s:17:\"goods_extend_info\";s:29:\"颜色 : 浅黄色尺寸 :
                               XS\";s:11:\"goods_image\";s:66:\"http://7xifww.com1.z0.glb.clouddn.com/Fl-bLE75B9OgKxFK91x1WCD174gT\";
                               s:16:\"goods_shop_price\";s:4:\"0.02\";s:7:\"buy_num\";s:1:\"2\";s:11:\"goods_color\";s:6:\"ffffb1\";s:10:\"goods_size\";s:2:\"XS\";}}",
            "goods_amount":"0.04",
            "order_amount":"0.04",
            "pay_fee":"0",
            "express_fee":"1.00",
            "user_pre_fee":"0",
            "user_pre_info":null,
            "buy_pre_fee":"0.00",
            "integral_buy_num":"0",
            "integral_buy_price":"0",
            "goods_weight_amount":"0",
            "order_state":"10",
            "ot_order_state":null,
            "pay_code":"xxzf",
            "pay_name":"线下支付",
            "pay_time":null,
            "pay_certification":null,
            "express_id":"1",
            "express_name":"顺丰配送",
            "express_time":null,
            "buyer_id":"133",
            "buyer_name":"111111",
            "buyer_email":"9xxxx@qq.com",
            "currency":"CNY",
            "currency_symbol":"¥",
            "currency_unit":"元",
            "order_time":"1483243413",
            "finish_time":null,
            "order_message":null,
            "integral_num":"0",
            "integral_rule_info":null,
            "integral_type_2_num":"0",
            "integral_type_2_num_rule_info":null,
            "invoice_content":null,
            "refund_state":"0",
            "delivery_name":""
        }
    ]
}

订单列表

Url地址 http://demo.dbshop.net/Jsonapi/orderList
请求方法 orderList
请求类型 get
参数 是否必填 说明
user_token 必填 用户登录状态值
page 必填 调取页数,如果不填写默认是 1
qty 必填 每页显示的商品数量,如果不填写默认是 10
order_state 非必填 默认是全部订单(0 已取消,10 待付款[有效订单],15 付款中,20 已付款, 30 待发货,40 已发货,60 已完成)
order_sn 非必填 订单编号,用于订单检索
{
    "status":"success",
    "msg":"信息调用成功!",
    "result":[
        {
            "order_id":"468",
            "order_sn":"20170101612437",
            "order_out_sn":null,
            "goods_serialize":"a:1:{i:549;a:9:{s:8:\"goods_id\";s:2:\"16\";s:8:\"class_id\";s:1:\"2\";s:10:\"goods_name\";s:33:\"这是第二个测试商品(test)\";s:17:\"goods_extend_info\";s:29:\"颜色 : 浅黄色尺寸 :
                               XS\";s:11:\"goods_image\";s:66:\"http://7xifww.com1.z0.glb.clouddn.com/Fl-bLE75B9OgKxFK91x1WCD174gT\";
                               s:16:\"goods_shop_price\";s:4:\"0.02\";s:7:\"buy_num\";s:1:\"2\";s:11:\"goods_color\";s:6:\"ffffb1\";s:10:\"goods_size\";s:2:\"XS\";}}",
            "goods_amount":"0.04",
            "order_amount":"0.04",
            "pay_fee":"0",
            "express_fee":"1.00",
            "user_pre_fee":"0",
            "user_pre_info":null,
            "buy_pre_fee":"0.00",
            "integral_buy_num":"0",
            "integral_buy_price":"0",
            "goods_weight_amount":"0",
            "order_state":"10",
            "ot_order_state":null,
            "pay_code":"xxzf",
            "pay_name":"线下支付",
            "pay_time":null,
            "pay_certification":null,
            "express_id":"1",
            "express_name":"顺丰配送",
            "express_time":null,
            "buyer_id":"133",
            "buyer_name":"111111",
            "buyer_email":"9xxxx@qq.com",
            "currency":"CNY",
            "currency_symbol":"¥",
            "currency_unit":"元",
            "order_time":"1483243413",
            "finish_time":null,
            "order_message":null,
            "integral_num":"0",
            "integral_rule_info":null,
            "integral_type_2_num":"0",
            "integral_type_2_num_rule_info":null,
            "invoice_content":null,
            "refund_state":"0",
            "delivery_name":""
        }
    ]
}

订单详情

Url地址 http://demo.dbshop.net/Jsonapi/showOrder
请求方法 showOrder
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录状态值
order_id 必填 订单id
{
    "status":"success",
    "msg":"信息调用成功!",
    "result":{
        "order_info":{
            "order_id":"468",
            "order_sn":"20170101612437",
            "order_out_sn":null,
            "goods_serialize":"a:1:{i:549;a:9:{s:8:\"goods_id\";s:2:\"16\";s:8:\"class_id\";s:1:\"2\";s:10:\"goods_name\";s:33:\"这是第二个测试商品(test)\";s:17:\"goods_extend_info\";s:29:\"颜色 : 浅黄色尺寸 : 
                               XS\";s:11:\"goods_image\";s:66:\"http:\/\/7xifww.com1.z0.glb.clouddn.com\/Fl-bLE75B9OgKxFK91x1WCD174gT\";s:16:\"goods_shop_price\";
                               s:4:\"0.02\";s:7:\"buy_num\";s:1:\"2\";s:11:\"goods_color\";s:6:\"ffffb1\";s:10:\"goods_size\";s:2:\"XS\";}}",
            "goods_amount":"0.04",
            "order_amount":"0.04",
            "pay_fee":"0",
            "express_fee":"1.00",
            "user_pre_fee":"0",
            "user_pre_info":null,
            "buy_pre_fee":"0.00",
            "integral_buy_num":"0",
            "integral_buy_price":"0",
            "goods_weight_amount":"0",
            "order_state":"10",
            "ot_order_state":null,
            "pay_code":"xxzf",
            "pay_name":"线下支付",
            "pay_time":null,
            "pay_certification":null,
            "express_id":"1",
            "express_name":"顺丰配送",
            "express_time":null,
            "buyer_id":"133",
            "buyer_name":"111111",
            "buyer_email":"9xxxxx@qq.com",
            "currency":"CNY",
            "currency_symbol":"¥",
            "currency_unit":"元",
            "order_time":"1483243413",
            "finish_time":null,
            "order_message":null,
            "integral_num":"0",
            "integral_rule_info":null,
            "integral_type_2_num":"0",
            "integral_type_2_num_rule_info":null,
            "invoice_content":null,
            "refund_state":"0"
        },
        "delivery_address":{
            "order_id":"468",
            "delivery_name":"",
            "region_id":"0",
            "region_info":"",
            "region_address":"",
            "zip_code":null,
            "tel_phone":null,
            "mod_phone":null,
            "express_name":"顺丰配送",
            "express_fee":"1.00",
            "express_time_info":null,
            "express_number":null,
            "express_id":"1"
        },
        "order_goods":[
            {
                "order_goods_id":"549",
                "order_id":"468",
                "goods_id":"16",
                "class_id":"2",
                "goods_item":"DBS000016-1",
                "goods_name":"这是第二个测试商品(test)",
                "goods_extend_info":"<p>颜色 : 浅黄色<\/p><p>尺寸 : XS<\/p>",
                "goods_color":"ffffb1",
                "goods_size":"XS",
                "goods_type":"1",
                "goods_shop_price":"0.02",
                "buy_num":"2",
                "goods_image":"http:\/\/7xifww.com1.z0.glb.clouddn.com\/Fl-bLE75B9OgKxFK91x1WCD174gT",
                "goods_amount":"0.04",
                "goods_count_weight":"0",
                "buyer_id":"0",
                "comment_state":"0"
            }
        ],
        "order_amount_log":[
            
        ]
    }
}

取消订单

Url地址 http://demo.dbshop.net/Jsonapi/cancelOrder
请求方法 cancelOrder
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录状态值
order_id 必填 订单id
{
    "status": "success",
    "msg": "该订单取消成功!"
}

删除订单

Url地址 http://demo.dbshop.net/Jsonapi/delOrder
请求方法 delOrder
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录状态值
order_id 必填 订单id
{
    "status": "success",
    "msg": "该订单删除成功!"
}

订单完成付款

付款操作在第三方(手机)进行处理,这里只接收付款成的信息。
Url地址 http://demo.dbshop.net/Jsonapi/orderPayFinish
请求方法 orderPayFinish
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录状态值
order_id 必填 订单id
trade_no 非必填 只有外面支付有trade_no(外部订单号)时,并且传递过来,才会使用
state_info 非必填 支付凭证,只有在支付方式是 线下支付 的时候,才会有此内容的提交
{
    "status": "success",
    "msg": "该订单付款完成!"
}

订单确认收货

Url地址 http://demo.dbshop.net/Jsonapi/orderReceipt
请求方法 orderReceipt
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录状态值
order_id 必填 订单id
{
    "status": "success",
    "msg": "该订单确认收货成功!"
}

支付接口

获取支付方式信息

Url地址 http://demo.dbshop.net/Jsonapi/paymentInfo
请求方法 paymentInfo
请求类型 post
参数 是否必填 说明
user_token 必填 用户登录状态值
payment_code 必填 支付方式的标识字符串(支付方式里的 editaction 值)
{
    "status": "success",
    "msg": "信息调用成功!",
    "result": {
        "payment_name": {
            "title": "支付方式名称",
            "content": "货到付款",
            "name_id": "payment_name",
            "input_type": "text",
            "class": "span6"
        },
        "payment_logo": {
            "title": "支付方式LOGO",
            "content": "http://demod.dbshop.net/public/img/payment/hdfk.gif",
            "name_id": "payment_logo",
            "input_type": "image"
        },
        "payment_info": {
            "title": "支付方式简介",
            "content": "货到付款",
            "name_id": "payment_info",
            "input_type": "textarea",
            "class": "span8"
        },
        "payment_show": {
            "title": "显示设置",
            "content": {
                "content1": {
                    "name": "全平台显示",
                    "value": "all"
                }
            },
            "name_id": "payment_show",
            "input_type": "checkbox",
            "checked": "all"
        },
        "payment_fee": {
            "title": "支付手续费",
            "content": "",
            "name_id": "payment_fee",
            "input_type": "text",
            "class": "span2"
        },
        "payment_state": {
            "title": "支付状态",
            "content": {
                "radio_1": {
                    "name": "开启",
                    "value": "1"
                },
                "radio_2": {
                    "name": "关闭",
                    "value": "0"
                }
            },
            "name_id": "payment_state",
            "input_type": "radio",
            "checked": "1"
        },
        "payment_sort": {
            "title": "支付排序",
            "content": "255",
            "name_id": "payment_sort",
            "input_type": "text",
            "class": "span1"
        },
        "editaction": "hdfk",
        "orders_state": "30"
    }
}