# 公共接口

DBShop商城后台安装 API插件后,启用 才可以正常使用。

重要说明

如果您勾选了 启用秘钥 那么在所有的接口调用中,都需要加入 apiKey 秘钥值,该值的传递不区分 GET POST。

举例说明,启用了秘钥,进行接口测试的调用地址为 https://demo.dbshop.net/shop-api/shop?apiKey=秘钥值

# 接口测试

调用地址 https://demo.dbshop.net/shop-api/shop (opens new window)
请求方法 index 或者空
请求类型 get|post
{
    "status": "success",
    "code": 200,
    "result": {
        "message": "接口连接成功"
    }
}

# 商城基本信息

调用地址 https://demo.dbshop.net/shop-api/shop/shopInfo (opens new window)
请求方法 shopInfo
请求类型 get|post
{
    "status": "success",
    "code": 200,
    "result": {
        "shop_name": "DBShop商城系统",
        "shop_extend_name": "很好的商城系统|zendframework3商城系统|Laminas商城系统|PHP商城系统|DBShop商城",
        "shop_keywords": "很好的商城系统,zendframework3商城系统,Laminas商城系统,PHP商城系统,DBShop商城",
        "shop_description": "很好的商城系统,zendframework3商城系统,Laminas商城系统,PHP商城系统,DBShop商城",
        "shop_hot_keywords": "手机",
        "website_icp": "京ICP备15047709号-3",
        "website_close": "0",
        "website_close_info": "",
        "website_timezone": "Asia/Shanghai",
        "shop_logo": "https://demo.dbshop.net/upload/common/logo.png",
        "shop_favicon": "https://demo.dbshop.net/favicon.ico",
        "shop_place_keywords": "简简单单搜索",
        "a_language": "zh_CN",
        "f_language": "zh_CN"
    }
}

# 广告调用

调用地址 https://demo.dbshop.net/shop-api/shop/shopAd (opens new window)
请求方法 shopAd
请求类型 get
参数 必填 参数说明
adCode 广告标记代码
{
    "status": "success",
    "code": 200,
    "result": {
        "appAdId": 4,
        "appAdCode": "indexBanner1",
        "appAdType": "image",
        "appAdUrl": "/pages/goods/goods?goodsId=8",
        "appAdBody": "https://demo.dbshop.net/upload/adImage/5f98e4253192a7_59374697_60d5a1ceed7488_28829333_617d8cacb452e6_19870420.png"
    }
}

# 商品调用

调用地址 https://demo.dbshop.net/shop-api/shop/shopGoods (opens new window)
请求方法 shopGoods
请求类型 get
参数 必填 参数说明
goodsCode 商品调用标记代码
userToken 登录状态标记,如果会员已经登录,则需要填写
{
    "status": "success",
    "code": 200,
    "result": {
        "goodsList": [
            {
                "goodsId": 8,
                "classId": 8,
                "goodsThumbnailImage": "https://demo.dbshop.net/upload/goods/image/2094d0cd98ddee55b1a5696434f43483_thumb.jpg",
                "goodsItem": "DBS000008",
                "brandId": 0,
                "goodsName": "小米(MI)电视4A标准版 L55M5-AZ/L55M5-AD 55英寸",
                "goodsExtendName": "K超高清 HDR 人工智能液晶网络平板电视",
                "goodsMarketPrice": 0,
                "goodsPrice": "¥2,200.00",
                "virtualSales": 0,
                "goodsSalesNum": 3,
                "goodsType": 1,
                "goodsClick": 0
            },
            {
                "goodsId": 7,
                "classId": 8,
                "goodsThumbnailImage": "https://demo.dbshop.net/upload/goods/image/c534950c4a79ea20293e483fd4ed4aff_thumb.jpg",
                "goodsItem": "DBS000007",
                "brandId": 0,
                "goodsName": "索尼(SONY)KD-55X8000E 55英寸 4K超高清",
                "goodsExtendName": "智能安卓7.0 享受视觉盛宴 醇音技术",
                "goodsMarketPrice": 0,
                "goodsPrice": "¥5,199.00",
                "virtualSales": 0,
                "goodsSalesNum": 5,
                "goodsType": 1,
                "goodsClick": 0
            }
        ]
    }
}

# 单页文章调用

调用地址 https://demo.dbshop.net/shop-api/shop/shopCms (opens new window)
请求方法 shopCms
请求类型 get
参数 必填 参数说明
cmsCode 文章调用标记代码
{
    "status": "success",
    "code": 200,
    "result": {
        "cmsList": [
            {
                "singleCmsId": 14,
                "singleCmsTitle": "在线支付",
                "singleCmsBody": null
            }
        ]
    }
}

# 手机验证码发送

调用地址 https://demo.dbshop.net/shop-api/shop/sendPhoneCaptcha (opens new window)
请求方法 sendPhoneCaptcha
请求类型 post
参数 必填 参数说明
areaCode 电话国际地区区号
phoneNumber 手机号码
sendType 发送类型,如 login
checkUserPhone 手机号码检查,checkNotExist 判断手机号码不存在, checkExist 判断手机号码存在

# 获取地区列表

调用地址 https://demo.dbshop.net/shop-api/shop/region (opens new window)
请求方法 region
请求类型 get
参数 必填 参数说明
regionTopId 上一级的地区id,0是获取顶级地区信息
{
    "status": "success",
    "code": 200,
    "result": [
        {
            "regionId": 1,
            "regionName": "北京",
            "regionTopId": 0,
            "regionSort": 255,
            "regionPath": "1"
        },
        {
            "regionId": 2,
            "regionName": "天津",
            "regionTopId": 0,
            "regionSort": 255,
            "regionPath": "2"
        }
    ]
}

# 在线支付列表

调用地址 https://demo.dbshop.net/shop-api/shop/getPaymentList (opens new window)
请求方法 getPaymentList
请求类型 get
参数 必填 参数说明
currencyCode 当前的货币编码,人民币是 CNY
userToken 登录凭证字符串
{
    "status": "success",
    "code": 200,
    "result": [
        {
            "payCode": "BalancePay",
            "paymentName": {
                "title": "支付方式名称",
                "content": "余额支付",
                "nameId": "paymentName",
                "inputType": "text",
                "class": "form-control",
                "width": "col-sm-6"
            },
            "paymentLogo": {
                "title": "支付方式Logo",
                "content": "https://demo.dbshop.net/upload/payment/balancePay.gif",
                "nameId": "paymentLogo",
                "inputType": "image"
            }
        },
        {
            "payCode": "Wxpay",
            "paymentName": {
                "title": "支付方式名称",
                "content": "微信支付",
                "nameId": "paymentName",
                "inputType": "text",
                "class": "form-control",
                "width": "col-sm-6"
            },
            "paymentLogo": {
                "title": "支付方式Logo",
                "content": "https://demo.dbshop.net/upload/payment/wxmpay.png",
                "nameId": "paymentLogo",
                "inputType": "image"
            }
        }
    ]
}

# 小程序二维码

调用地址 https://demo.dbshop.net/shop-api/shop/wechatSmallQrcode (opens new window)
请求方法 wechatSmallQrcode
请求类型 get
参数 必填 参数说明
userToken 登录凭证字符串
{
    "status": "success",
    "code": 200,
    "result": {
        "wxImage": "https://demo.dbshop.net/upload/user/wechatInvitation/11.png"
    }
}