shopping.md
23.6 KB
1、获取用户可用的优惠券张数
说明
获取用户可用的优惠券张数(app.Shopping.countUsableCoupon)
请求参数
参数名称 | 参数类型 | 可否为空 | 示例 | 默认值 | 备注 |
---|---|---|---|---|---|
uid | int | 否 | 3236556 | 0 | 用户id |
请求示例
http://192.168.102.205:8080/gateway?method=app.Shopping.countUsableCoupon&uid=8041834&debug=XYZ
响应
code为200即为成功,否则是失败。 响应JSON格式如下所示:
{
"alg":"SALT_MD5",
"code":200,
"data":{"count":5},
"md5":"c1d725306fb09dcbf504776d276521cb",
"message":"ok"
}
2、获取用户可用和不可用优惠券列表
说明
获取用户优惠券列表,可用和不可用(app.Shopping.listCoupon)
请求参数
参数名称 | 参数类型 | 可否为空 | 示例 | 默认值 | 备注 |
---|---|---|---|---|---|
uid | int | 否 | 3236556 | 0 | 用户id |
请求示例
http://192.168.102.205:8080/gateway?method=app.Shopping.listCoupon&uid=8041834&debug=XYZ
响应
code为200即为成功,否则是失败。 响应JSON格式如下所示:
{
"alg": "SALT_MD5",
"code": 200,
"data": {
"usable_coupons":[
{
"coupon_code": "amccccc",
"coupon_name": "生日券",
"coupon_type": "3",
"coupon_validity": "2013.11.01-2017.01.31",
"coupon_value": "55"
}
],
"unusable_coupons": [
{
"coupon_code": "ambb2345",
"coupon_name": "生日券",
"coupon_type": "3",
"coupon_validity": "2013.11.01-2017.01.31",
"coupon_value": "55"
}
]
},
"md5": "c1d725306fb09dcbf504776d276521cb",
"message": "ok"
}
3、购物车结算接口
说明
购物车结算(app.Shopping.payment)
请求参数
参数名称 | 参数类型 | 可否为空 | 示例 | 默认值 | 备注 |
---|---|---|---|---|---|
uid | int | 否 | 3236556 | 0 | 用户id |
cart_type | string | 是 | ordinary | ordinary | 购物车类型 |
yoho_coin_mode | int | 是 | 1 | 1 | 是否使用yoho币,1使用,0不使用 |
product_sku_list | string | 是 | [{'type':'limitcode','sku':307502,'limitproductcode':'2016030711453248','buy_number':1,'skn':51001888}] | 购买限购商品 | |
is_support_apple_pay | string | 否 | Y | N | 客户端设备是否支持apple pay |
响应
code为200即为成功,否则是失败。 响应JSON格式如下所示:
{
"alg": "SALT_MD5",
"code": 200,
"data": {
"delivery_address": {
"address": "南京",
"address_id": "4555851",
"area": "北京市 北京市 东城区",
"area_code": "110101",
"consignee": "123",
"is_delivery": "Y",
"is_support": "Y",
"mobile": "139****4768",
"phone": ""
},
"delivery_time": [{
"default": "N",
"delivery_time_id": 1,
"delivery_time_string": "只工作日送货"
}, {
"default": "Y",
"delivery_time_id": 2,
"delivery_time_string": "工作日、双休日和节假日均送货"
}, {
"default": "N",
"delivery_time_id": 3,
"delivery_time_string": "只双休日、节假日送货(工作日不送货)"
}],
"delivery_way": [{
"default": "Y",
"delivery_way_cost": 10,
"delivery_way_id": 1,
"delivery_way_name": "普通快递",
"is_delivery": "Y",
"is_support": "Y"
}, {
"default": "N",
"delivery_way_cost": 15,
"delivery_way_id": 2,
"delivery_way_name": "顺丰速运",
"is_delivery": "Y",
"is_support": "Y"
}],
"goods_list": [{
"attribute": "1",
"brand_id": "141",
"buy_limit": 0,
"buy_number": "1",
"cn_alphabet": "TYAKASHABaiSeNanNvTongKuanJiaoYinJiRouJiBenKuanTXuAJN01T16XSAJN01W",
"color_id": "1",
"color_name": "白色",
"expect_arrival_time": "",
"fit_promotions": ["8479", "8477", "8475"],
"get_yoho_coin": "0",
"goods_id": "529095",
"goods_images": "http://img10.static.yhbimg.com/goodsimg/2016/04/11/10/01717d13ad6eab0a039f013dfecdb0e4a7.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
"goods_type": "ordinary",
"is_advance": "N",
"is_jit": "N",
"is_limited": "N",
"is_outlets": "N",
"is_special": "N",
"last_price": "168.0",
"last_vip_price": 168,
"market_price": 168,
"max_sort_id": "1",
"middle_sort_id": "11",
"off_shelves": 0,
"product_id": 417451,
"product_name": "TYAKASHA 白色男女通款胶印肌肉基本款T恤 ",
"product_skc": "373162",
"product_skn": "51228710",
"product_sku": "1164186",
"promotion_flag": "108",
"promotion_id": "0",
"real_price": 168,
"real_vip_price": 0,
"sale_price": 0,
"sales_price": 168,
"selected": "Y",
"shop_id": 0,
"shopping_cart_goods_id": "106796919",
"shopping_cart_id": "131919063",
"size_id": "201",
"size_name": "L",
"small_sort_id": "114",
"storage_number": "100",
"str_subtotal": "¥168.00",
"subtotal": 168,
"supplier_id": 0,
"uid": "10921691",
"vip1_price": "159.60",
"vip2_price": "151.20",
"vip3_price": "147.84",
"vip_discount": 1,
"vip_discount_money": 0,
"vip_discount_type": "1",
"vip_price": 0,
"yoho_coin_num": "0"
}],
"invoices": {
"invoices_title": "",
"invoices_type_id": 0,
"invoices_type_list": [{
"invoices_type_id": 1,
"invoices_type_name": "图书"
}, {
"invoices_type_id": 2,
"invoices_type_name": "资料"
}, {
"invoices_type_id": 3,
"invoices_type_name": "办公用品"
}, {
"invoices_type_id": 4,
"invoices_type_name": "洗涤用品"
}, {
"invoices_type_id": 5,
"invoices_type_name": "化妆品"
}, {
"invoices_type_id": 6,
"invoices_type_name": "体育用品"
}, {
"invoices_type_id": 7,
"invoices_type_name": "服装"
}, {
"invoices_type_id": 8,
"invoices_type_name": "饰品"
}, {
"invoices_type_id": 9,
"invoices_type_name": "配件"
}, {
"invoices_type_id": 10,
"invoices_type_name": "数码产品"
}],
"invoiceContentList": -- 发票内容
[{
"invoices_type_id": 1,
"invoices_type_name": "服装"
}, {
"invoices_type_id": 2,
"invoices_type_name": "图书"
}, {
"invoices_type_id": 3,
"invoices_type_name": "配件"
}, {
"invoices_type_id": 4,
"invoices_type_name": "日用品"
}, {
"invoices_type_id": 5,
"invoices_type_name": "办公用品"
}, {
"invoices_type_id": 6,
"invoices_type_name": "体育用品"
}, {
"invoices_type_id": 7,
"invoices_type_name": "数码产品"
}],
"invoices_type_name": ""
},
"payment_way": [{
"default": "Y",
"is_support": "Y",
"payment_id": 15,
"payment_name": "支付宝",
"payment_type": 1,
"payment_type_name": "在线支付(推荐)",
"is_support_message":""
}, {
"default": "N",
"is_support": "Y",
"payment_id": 0,
"payment_name": "货到付款",
"payment_type": 2,
"payment_type_name": "货到付款",
"is_support_message":"送货上门后再付款"
}],
"promo_code_enabled": 0,
"shopping_cart_data": {
"discount_amount": 0,
"fast_shopping_cost": 15,
"gain_yoho_coin": 0,
"goods_count": 1,
"last_order_amount": 178,
"order_amount": 168,
"promotion_formula": "总计¥178.00=商品金额¥168.00+运费¥10.00",
"promotion_formula_list": [{
"promotion": "商品金额",
"promotion_amount": "¥168.00"
}, {
"promotion": "运费",
"promotion_amount": "+¥10.00"
}],
"selected_goods_count": 1,
"shipping_cost": 10,
"str_discount_amount": "¥0.00",
"str_order_amount": "¥168.00",
"is_multi_package":"Y",
"package_list":[{
"supplier_id":"0",
"goods_list":[{
"buy_number": "1",
"goods_images": "http://img11.static.yhbimg.com/goodsimg/2015/12/23/07/0115f6f0e2ca345d2b413396202f97c8b5.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
"goods_type": "ordinary",
"product_id": 329795,
"product_name": "Blackbird 黑鸟锥形香-Ai香型",
"product_skc": "320280",
"product_skn": "51184595",
"product_sku": "1003938"
}],
"shopping_cost":3,
"shopping_cut_cost": 7,
"shopping_orig_cost:10
},
{
"supplier_id":"23",
"goods_list":[{
"buy_number": "1",
"goods_images": "http://img11.static.yhbimg.com/goodsimg/2015/12/23/07/0115f6f0e2ca345d2b413396202f97c8b5.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
"goods_type": "gift",
"product_id": 329795,
"product_name": "Blackbird 黑鸟锥形香-Ai香型",
"product_skc": "320280",
"product_skn": "51184595",
"product_sku": "1003938"
}],
"shopping_cost":3,
"shopping_cut_cost": 7,
"shopping_orig_cost:10
}]
},
"shopping_cart_tag": "3613572d1571f9cf448e3dacb8ec4c37",
"uid": 10921691,
"use_yoho_coin": 0,
"yoho_coin": 0
},
"md5": "3c89d2af5917a0f12070df8281b39fe8",
"message": "payment data."
}
4、购物车compute接口
说明
购物车结算(app.Shopping.compute)
请求参数
参数名称 | 参数类型 | 可否为空 | 示例 | 默认值 | 备注 |
---|---|---|---|---|---|
uid | int | 否 | 3236556 | 0 | 用户id |
cart_type | string | 是 | ordinary | ordinary | 购物车类型 |
yoho_coin_mode | int | 是 | 1 | 1 | 是否使用yoho币,1使用,0不使用 |
payment_type | int | 否 | 1 | 1 | 支付方式,1 在线支付 2 货到付款 |
delivery_way | int | 否 | 1 | 1 | 快递方式,1 普通 2 加急 |
use_yoho_coin | double | 是 | 1.00 | 使用的yoho币金额,单位元 | |
use_red_envelopes | double | 是 | 1.00 | 使用的红包,单位元 | |
coupon_code | string | 是 | b123456 | 优惠券code | |
promotion_code | string | 是 | 1345abc | 优惠码code | |
product_sku_list | string | 是 | [{'type':'limitcode','sku':307502,'limitproductcode':'2016030711453248','buy_number':1,'skn':51001888}] | 购买限购商品 |
响应
code为200即为成功,否则是失败。 响应JSON格式如下所示:
{
"alg": "SALT_MD5",
"code": 200,
"data": {
"coupon_amount": 0,
"delivery_way": [{
"default": "Y",
"delivery_way_cost": 0,
"delivery_way_id": 1,
"delivery_way_name": "普通快递",
"is_delivery": "Y",
"is_support": "Y"
}, {
"default": "N",
"delivery_way_cost": 5,
"delivery_way_id": 2,
"delivery_way_name": "顺丰速运",
"is_delivery": "Y",
"is_support": "Y"
}],
"discount_amount": 0,
"fast_shopping_cost": 5,
"gain_yoho_coin": 0,
"goods_count": 4,
"last_order_amount": 340,
"order_amount": 335,
"payment_way": [{
"default": "Y",
"is_support": "Y",
"is_support_message": "",
"payment_id": 15,
"payment_name": "支付宝",
"payment_type": 1,
"payment_type_name": "在线支付(推荐)"
}, {
"default": "N",
"is_support": "Y",
"is_support_message": "送货上门后再付款",
"payment_id": 0,
"payment_name": "货到付款",
"payment_type": 2,
"payment_type_name": "货到付款"
}],
"promotion_formula": "总计¥340.00=商品金额¥335.00+运费¥5.00",
"promotion_formula_list": [{
"promotion": "商品金额",
"promotion_amount": "¥335.00"
}, {
"promotion": "运费",
"promotion_amount": "+¥5.00"
}],
"selected_goods_count": 2,
"shipping_cost": 0,
"str_discount_amount": "¥0.00",
"str_order_amount": "¥335.00",
"use_red_envelopes": 0,
"use_yoho_coin": 0,
"is_multi_package":"Y",
"package_list":[{
"supplier_id":"0",
"goods_list":[{
"buy_number": "1",
"goods_images": "http://img11.static.yhbimg.com/goodsimg/2015/12/23/07/0115f6f0e2ca345d2b413396202f97c8b5.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
"goods_type": "ordinary",
"product_id": 329795,
"product_name": "Blackbird 黑鸟锥形香-Ai香型",
"product_skc": "320280",
"product_skn": "51184595",
"product_sku": "1003938"
}],
"shopping_cost":3,
"shopping_cut_cost": 7,
"shopping_orig_cost:10
},
{
"supplier_id":"23",
"goods_list":[{
"buy_number": "1",
"goods_images": "http://img11.static.yhbimg.com/goodsimg/2015/12/23/07/0115f6f0e2ca345d2b413396202f97c8b5.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
"goods_type": "gift",
"product_id": 329795,
"product_name": "Blackbird 黑鸟锥形香-Ai香型",
"product_skc": "320280",
"product_skn": "51184595",
"product_sku": "1003938"
}],
"shopping_cost":3,
"shopping_cut_cost": 7,
"shopping_orig_cost:10
}]
},
"md5": "c743135bb9ee4afe3c522c59e64604ea",
"message": "compute list."
}
7、限购商品立即购买接口
说明
限购商品立即购(app.Shopping.easyPayment)
请求参数
参数名称 | 参数类型 | 可否为空 | 示例 | 默认值 | 备注 |
---|---|---|---|---|---|
uid | int | 否 | 3236556 | 0 | 用户id |
cart_type | string | 否 | ordinary | ordinary | 购物车类型 |
yoho_coin_mode | int | 否 | 1 | 1 | 是否使用yoho币,1使用,0不使用 |
product_sku_list | string | 否 | [{'type':'limitcode','sku':307502,'limitproductcode':'2016030711453248','buy_number':1,'skn':51001888}] | 购买限购商品 | |
is_support_apple_pay | string | 否 | Y | N | 客户端设备是否支持apple pay |
响应
code为200即为成功,否则是失败。 响应JSON格式如下所示:
{
"alg": "SALT_MD5",
"code": 200,
"data": {
"delivery_address": {
"address": "南京",
"address_id": "4555851",
"area": "北京市 北京市 东城区",
"area_code": "110101",
"consignee": "123",
"is_delivery": "Y",
"is_support": "Y",
"mobile": "139****4768",
"phone": ""
},
"delivery_time": [{
"default": "N",
"delivery_time_id": 1,
"delivery_time_string": "只工作日送货"
}, {
"default": "Y",
"delivery_time_id": 2,
"delivery_time_string": "工作日、双休日和节假日均送货"
}, {
"default": "N",
"delivery_time_id": 3,
"delivery_time_string": "只双休日、节假日送货(工作日不送货)"
}],
"delivery_way": [{
"default": "Y",
"delivery_way_cost": 10,
"delivery_way_id": 1,
"delivery_way_name": "普通快递",
"is_delivery": "Y",
"is_support": "Y"
}, {
"default": "N",
"delivery_way_cost": 15,
"delivery_way_id": 2,
"delivery_way_name": "顺丰速运",
"is_delivery": "Y",
"is_support": "Y"
}],
"goods_list": [{
"attribute": "1",
"brand_id": "141",
"buy_limit": 0,
"buy_number": "1",
"cn_alphabet": "TYAKASHABaiSeNanNvTongKuanJiaoYinJiRouJiBenKuanTXuAJN01T16XSAJN01W",
"color_id": "1",
"color_name": "白色",
"expect_arrival_time": "",
"fit_promotions": ["8479", "8477", "8475"],
"get_yoho_coin": "0",
"goods_id": "529095",
"goods_images": "http://img10.static.yhbimg.com/goodsimg/2016/04/11/10/01717d13ad6eab0a039f013dfecdb0e4a7.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
"goods_type": "ordinary",
"is_advance": "N",
"is_jit": "N",
"is_limited": "N",
"is_outlets": "N",
"is_special": "N",
"last_price": "168.0",
"last_vip_price": 168,
"market_price": 168,
"max_sort_id": "1",
"middle_sort_id": "11",
"off_shelves": 0,
"product_id": 417451,
"product_name": "TYAKASHA 白色男女通款胶印肌肉基本款T恤 ",
"product_skc": "373162",
"product_skn": "51228710",
"product_sku": "1164186",
"promotion_flag": "108",
"promotion_id": "0",
"real_price": 168,
"real_vip_price": 0,
"sale_price": 0,
"sales_price": 168,
"selected": "Y",
"shop_id": 0,
"shopping_cart_goods_id": "106796919",
"shopping_cart_id": "131919063",
"size_id": "201",
"size_name": "L",
"small_sort_id": "114",
"storage_number": "100",
"str_subtotal": "¥168.00",
"subtotal": 168,
"supplier_id": 0,
"uid": "10921691",
"vip1_price": "159.60",
"vip2_price": "151.20",
"vip3_price": "147.84",
"vip_discount": 1,
"vip_discount_money": 0,
"vip_discount_type": "1",
"vip_price": 0,
"yoho_coin_num": "0"
}],
"invoices": {
"invoices_title": "",
"invoices_type_id": 0,
"invoices_type_list": [{
"invoices_type_id": 1,
"invoices_type_name": "图书"
}, {
"invoices_type_id": 2,
"invoices_type_name": "资料"
}, {
"invoices_type_id": 3,
"invoices_type_name": "办公用品"
}, {
"invoices_type_id": 4,
"invoices_type_name": "洗涤用品"
}, {
"invoices_type_id": 5,
"invoices_type_name": "化妆品"
}, {
"invoices_type_id": 6,
"invoices_type_name": "体育用品"
}, {
"invoices_type_id": 7,
"invoices_type_name": "服装"
}, {
"invoices_type_id": 8,
"invoices_type_name": "饰品"
}, {
"invoices_type_id": 9,
"invoices_type_name": "配件"
}, {
"invoices_type_id": 10,
"invoices_type_name": "数码产品"
}],
"invoiceContentList": -- 发票内容
[{
"invoices_type_id": 1,
"invoices_type_name": "服装"
}, {
"invoices_type_id": 2,
"invoices_type_name": "图书"
}, {
"invoices_type_id": 3,
"invoices_type_name": "配件"
}, {
"invoices_type_id": 4,
"invoices_type_name": "日用品"
}, {
"invoices_type_id": 5,
"invoices_type_name": "办公用品"
}, {
"invoices_type_id": 6,
"invoices_type_name": "体育用品"
}, {
"invoices_type_id": 7,
"invoices_type_name": "数码产品"
}],
"invoices_type_name": ""
},
"payment_way": [{
"default": "Y",
"is_support": "Y",
"payment_id": 15,
"payment_name": "支付宝",
"payment_type": 1,
"payment_type_name": "在线支付(推荐)",
"is_support_message":""
}, {
"default": "N",
"is_support": "Y",
"payment_id": 0,
"payment_name": "货到付款",
"payment_type": 2,
"payment_type_name": "货到付款",
"is_support_message":"送货上门后再付款"
}],
"promo_code_enabled": 0,
"shopping_cart_data": {
"discount_amount": 0,
"fast_shopping_cost": 15,
"gain_yoho_coin": 0,
"goods_count": 1,
"last_order_amount": 178,
"order_amount": 168,
"promotion_formula": "总计¥178.00=商品金额¥168.00+运费¥10.00",
"promotion_formula_list": [{
"promotion": "商品金额",
"promotion_amount": "¥168.00"
}, {
"promotion": "运费",
"promotion_amount": "+¥10.00"
}],
"selected_goods_count": 1,
"shipping_cost": 10,
"str_discount_amount": "¥0.00",
"str_order_amount": "¥168.00",
"is_multi_package":"Y",
"package_list":[{
"supplier_id":"0",
"goods_list":[{
"buy_number": "1",
"goods_images": "http://img11.static.yhbimg.com/goodsimg/2015/12/23/07/0115f6f0e2ca345d2b413396202f97c8b5.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
"goods_type": "ordinary",
"product_id": 329795,
"product_name": "Blackbird 黑鸟锥形香-Ai香型",
"product_skc": "320280",
"product_skn": "51184595",
"product_sku": "1003938"
}],
"shopping_cost":3,
"shopping_cut_cost": 7,
"shopping_orig_cost:10
},
{
"supplier_id":"23",
"goods_list":[{
"buy_number": "1",
"goods_images": "http://img11.static.yhbimg.com/goodsimg/2015/12/23/07/0115f6f0e2ca345d2b413396202f97c8b5.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
"goods_type": "gift",
"product_id": 329795,
"product_name": "Blackbird 黑鸟锥形香-Ai香型",
"product_skc": "320280",
"product_skn": "51184595",
"product_sku": "1003938"
}],
"shopping_cost":3,
"shopping_cut_cost": 7,
"shopping_orig_cost:10
}]
},
"shopping_cart_tag": "3613572d1571f9cf448e3dacb8ec4c37",
"uid": 10921691,
"use_yoho_coin": 0,
"yoho_coin": 0
},
"md5": "3c89d2af5917a0f12070df8281b39fe8",
"message": "payment data."
}
8、购物车提交接口
说明
购物车提交订单(app.Shopping.submit)
请求参数
参数名称 | 参数类型 | 可否为空 | 示例 | 默认值 | 备注 |
---|---|---|---|---|---|
uid | int | 否 | 3236556 | 0 | 用户id |
cart_type | string | 否 | ordinary | ordinary | 购物车类型 |
address_id | int | 否 | 5816006 | 送货地址id | |
delivery_time | int | 否 | 2 | 寄送时间类型 | |
delivery_way | int | 否 | 1 | 发货方式(1:普通,2顺丰) | |
invoices_title | string | 是 | "" | "" | 发票抬头 |
invoices_type_id | int | 是 | "" | "" | 发票类型 |
use_yoho_coin | double | 是 | 1.00 | 使用的yoho币金额,单位元 | |
use_red_envelopes | double | 是 | 1.00 | 使用的红包,单位元 | |
payment_id | int | 否 | 15 | 支付id | |
payment_type | int | 否 | 1 | 支付类型 | |
remark | string | 是 | "" | "" | 备注 |
coupon_code | string | 是 | "" | "" | 优惠券码 |
product_sku_list | string | 否 | "" | "" | 立即购买,优先 |
client_type | string | 否 | web | iphone | 终端 |
qhy_union | String | 否 | {"go_url":"http:\/\/m.yohobuy.com\/?utm_source=dmwwap&utm_medium=none&utm_campaign=dmwwap","channel_code":"174168585","append":null,"client_id":3019,"mbr_name":"174168585","u_id":null} | 联盟参数,json格式,app没有 |
响应
code为200即为成功,否则是失败。 响应JSON格式如下所示:
{
"alg": "SALT_MD5",
"code": 200,
"data": {
"create_time": "2016-07-14 15:57:48",//订单创建时间
"order_amount": 1965,//订单金额
"order_code": 1613291832,//订单号
"pay_expire": "2016-07-14 17:57:48",//支付失效时间
"payment_status": 0//0 未支付,1已支付,只有0元订单才为1
},
"md5": "62723a6f81151e880b04a8480df4d2f9",
"message": "submit order ."
}