Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

免费开源的接口管理平台 | 文档管理系统 | BUG管理系统--模块【商品】

本系统由CrapApi【crap.cn】提供技术支持

目录
1. 创建订单

2. 获取具体商品的信息

3. 获取所有在售的商品信息

1、 创建订单

(1) 功能说明

(2) URL地址

/api/order/create

(3) 版本号

1.0

(4) Mock地址

正确:http://api.crap.cn/mock/trueExam.do?id=163178239080712019608
错误:http://api.crap.cn/mock/falseExam.do?id=163178239080712019608

(5) HTTP请求方式

POST

(6) 返回contentType类型

application/json

(7) 请求头说明

名称 是否必须 类型 默认值 备注

(8) 输入参数说明

是否必 参数位
名称 类型 默认值 备注
须 置

ParterOrderNo true 普通参 string 商户方自己的订单编号



普通参
IdCardNo false string 订购人身份证姓名

普通参
IdCardName true string 订购人身份证号码

普通参
ContactName true string 收货人姓名

普通参
Mobile false string 订购人身份证号码

普通参
Province true string 收货地址的省份标准名称

普通参
City true string 收货地址的城市标准名称

普通参
District true string 收货地址的区标准名称

普通参
StreetAddress true string 收货地址的具体街道地址

普通参 订单的客户备注留言,不
Remark true string
数 超 过 256 个字符
普通参 boolea
NotPayByBalance true 是否余额支付
数 n
NotUsePreOrderedInventor 普通参 boolea
true 是否预购库存
y 数 n
普通参
Items true string 购买的商品 Item 信息集合

普通参 numbe
Items->Qty true 本次订单购买的数量
数 r
普通参 numbe
Items->SKUNo true 购买的商品的SKU 编号
数 r

(9) 返回数据说明

名称 类型 是否必须 备注
status int true 200
msg string true 成功
data string true 订单创建结果集合
所创建成功的新订单
OrderInfo object true
的信息
订单中购买商品的明
OrderItems string true
细情况
UnitPrice number true 商品供货单价
Qty number true 商品下单数量
SKUNo number true 商品编号
订单是否有拆单,对
于新创建的订单的返
Splitted boolean true
回数据里,此字段一
定为 false
StatusDesc string true 订单状态的文字描述
订单的状态,0: 待支
付;1: 处理中;2: 部
分 出库;3: 全部出库
;-1: 已作废;100: 海
关 清关中;101: 海关
清关失败。对于新创
建的 订单,返回的状
态只会为 0:待支付
Status number true
或者 1: 处理中(如
果创建订单时使用了
商户在优时通 的账户
余额或预购库存进行
足额抵扣的,那么 就
无需再人工支付,返
回的订单状态就为
1)
余额抵扣金额,金额
PrepayAmt number true
一定小于等于 0
ExtraTaxAmt number true 额外的税差金额
优惠减免金额,金额
DiscountAmt number true
一定小于等于 0
运费金额,金额一定
ShippingFeeAmt number true
大于等于 0
ProductAmt number true 商品总金额
还需要进行支付的金
NeedToPayAmt number true

TotalOrderAmt number true 订单的总金额
OrderNo number true 订单编号
ParterOrderNo string true 商户方的订单编号
如果创建订单失败
,则会是失败的原因
Message string true 描述, 如果创建订单
成功,则固定为"订单
创建成功"
Success boolean true 是否创建订单成功
ParterOrderNo string true 商户方的订单编号
(10) 正确返回示例

"status": 200,

"msg": "成功",

"data": [

"ParterOrderNo": "A20170428001012",

"Success": true,

"Message": "订单创建成功",

"OrderInfo": {

"ParterOrderNo": "A20170428001012",

"OrderNo": 10028402,

"TotalOrderAmt": 171,

"NeedToPayAmt": 171,

"ProductAmt": 171,

"ShippingFeeAmt": 0,

"DiscountAmt": 0,

"ExtraTaxAmt": 0,

"PrepayAmt": 0,

"Status": 0,

"StatusDesc": "待支付",

"Splitted": false,

"OrderItems": [

"SKUNo": 10150620,

"Qty": 1,

"UnitPrice": 171

],

"Packages": []

(11) 错误返回示例

"status": 500,
"msg": "服务器异常",

"data": []

(12) 错误码

Code Msg

2、 获取具体商品的信息

(1) 功能说明

(2) URL地址

/api/product/detail/:id

(3) 版本号

1.0

(4) Mock地址

正确:http://api.crap.cn/mock/trueExam.do?id=163178095831712019588
错误:http://api.crap.cn/mock/falseExam.do?id=163178095831712019588

(5) HTTP请求方式

GET

(6) 返回contentType类型

application/json

(7) 请求头说明

名称 是否必须 类型 默认值 备注

(8) 输入参数说明

名称 是否必须 参数位置 类型 默认值 备注


id true URL地址 int 0 商品id
(9) 返回数据说明

名称 类型 是否必须 备注
status number true 200 成功
msg string true 说明
data object false 商品信息
storeInfo object true 商品信息
brandDescription object true 商品品牌故事
description string true 故事详情
brand_id number true 故事id
brand_name string true 商品品牌名称
small_image string true 商品轮播图
description string true 商品详情
start_sale number true 商品起售数量
house_id number true 商品仓库id
brand_id number true 商品品牌id
label_id string true 商品标签
spu string true 商品spu
activity string true 商品活动
spec_type number true 商品规格
temp_id number true 运费模板id
code_path string true 商品二维码地址
browse number true 浏览量
is_vip number true 是否开启会员价格
is_sub number true 是否单独分佣
is_good number true 是否优品推荐
is_bargain string true 是否砍价
is_seckill number true 是否秒杀
cost string true 商品成本价
is_postage number true 是否包邮
add_time number true 添加时间
is_new number true 是否新品
is_best number true 是否精品
is_benefit number true 是否优惠
is_hot number true 是否热卖
is_show number true 商品上架状态
stock number true 商品库存
sales number true 商品销量
unit_name string true 单位名称
postage string true 运费
ot_price string true 商品原价
vip_price number true 商品vip价格
price string true 商品售价
cate_id string true 商品分类
bar_code string true 商品货号
keyword string true 商品关键字
store_name string true 商品名称
slider_image array[string] true 商品轮播图
recommend_image string true 商品推荐图
image string true 商品主图
id number true 商品id

(10) 正确返回示例

"status": 200,

"msg": "ok",

"data": {

"uid": 0,

"productAttr": [],

"productValue": [],

"storeInfo": {

"id": 18063,

"mer_id": 4,

"image": "https://img.adfmall.com/attach/2021/09/b44db202109122016165186.jpg",

"recommend_image": "",

"slider_image": [

"https://img.adfmall.com/attach/2021/09/b44db202109122016165186.jpg?imageView2/1/w/1500/h/1500"

],

"store_name": "雅诗兰黛 红石榴泡沫洁面乳125ml",

"store_info": "",

"keyword": "",

"bar_code": "887167381872",

"cate_id": "290",
"price": "170.00",

"vip_price": 0,

"ot_price": "365.00",

"postage": "0.00",

"unit_name": "支",

"sort": 0,

"sales": 0,

"stock": 1000,

"is_show": 1,

"is_hot": 0,

"is_benefit": 0,

"is_best": 0,

"is_new": 0,

"add_time": 1631449081,

"is_postage": 0,

"is_del": 0,

"mer_use": 0,

"give_integral": "0.00",

"cost": "0.00",

"is_seckill": 0,

"is_bargain": null,

"is_good": 0,

"is_sub": 0,

"is_vip": 0,

"ficti": 0,

"browse": 0,

"code_path": "",

"soure_link": "",

"video_link": "",

"temp_id": 4,

"spec_type": 0,

"activity": "0,1,2,3",

"spu": "5752535681696",

"label_id": "0",

"command_word": "",

"brand_id": 42,

"is_channel": 0,

"channel_price": 0,

"house_id": 20,

"start_sale": 1,
"book_flag": 0,

"ref_brand_product": [],

"description": "1234",

"image_base": "https://img.adfmall.com/attach/2021/09/b44db202109122016165186.jpg",

"fsales": 0,

"code_base": "https://img.adfmall.com/uploads/qrcode/18063_product_detail_wap.jpg",

"userCollect": false,

"userLike": false,

"small_image": "https://img.adfmall.com/attach/2021/09/b44db202109122016165186.jpg",

"brand_name": "Estée Lauder 雅诗兰黛",

"brandSource": [],

"brandDescription": {

"brand_id": 42,

"description": "<p>雅诗兰黛(ESTE LAUDER), 知名护肤、化妆品和香水公司,与其创始人同名。美国高端护肤品牌,以

延缓衰老修护护肤品闻名。1946年雅诗兰黛公司成立于美国纽约,拥有护肤品品牌Clinique(倩碧)、La Mer(海蓝之谜

)、LAB SERIES(朗仕)、Prescriptives、Origins(悦木之源),以及化妆品品牌Bobbi Brown、M・A・C,和男性香水品

牌Aramis等等。</p>"

},

"ref_product": []

},

"priceName": 0,

"reply": null,

"replyChance": 100,

"replyCount": 0,

"mer_id": 4,

"good_list": [],

"mapKey": "5WNBZ-2JYR6-SPUSL-M3WGH-U4KDT-K2FYV",

"store_self_mention": 0,

"activity": [],

"coupons": [],

"routine_contact_type": "0",

"discounts_products": [],

"new_discount": null,

"start_sale": 1,

"product_arrival_time": "到货时间:跨境商品一般7天左右,欧洲直发商品,例如手表、奢侈品包和部分美妆,时间会在

15到90天之间"

(11) 错误返回示例
{

"status": 500,

"msg": "服务器异常",

"data": []

(12) 错误码

Code Msg

3、 获取所有在售的商品信息

(1) 功能说明

(2) URL地址

/api/products

(3) 版本号

1.0

(4) Mock地址

正确:http://api.crap.cn/mock/trueExam.do?id=163178079403312019586
错误:http://api.crap.cn/mock/falseExam.do?id=163178079403312019586

(5) HTTP请求方式

GET

(6) 返回contentType类型

application/json

(7) 请求头说明

名称 是否必须 类型 默认值 备注

(8) 输入参数说明

名称 是否必须 参数位置 类型 默认值 备注


sid false 普通参数 int 0 二级分类编号
cid false 普通参数 int 0 一级分类编号
keyword false 普通参数 string 搜索
priceOrder false 普通参数 string 价格排序
salesOrder false 普通参数 string 销量排序
news false 普通参数 string 是否新品
type true 普通参数 int 0 商品类型
page false 普通参数 int 1 分页参数起始值
limit false 普通参数 string 10 分页数步长值

(9) 返回数据说明

名称 类型 是否必须 备注
status number true 200为成功
msg string true 文案说明
data array[object] false 商品信息集合
description string true 商品详细文本
vip_price number true 会员价格
is_vip number true 是否开启会员价
unit_name string true 单位
recommend_image string true 推荐图
spec_type number true 商品规格类型
ot_price string true 商品原价
stock number true 商品库存
price string true 商品售价
sales string true 商品销量
image string true 商品主图
cate_id string true 商品分类id
store_name string true 商品名称
id number true 商品id

(10) 正确返回示例

"status": 200,
"msg": "ok",

"data": [

"id": 18063,

"store_name": "雅诗兰黛 红石榴泡沫洁面乳125ml",

"cate_id": "290",

"image": "https://img.adfmall.com/attach/2021/09/b44db202109122016165186.jpg",

"sales": "0",

"price": "170.00",

"stock": 1000,

"activity": [],

"ot_price": "365.00",

"spec_type": 0,

"recommend_image": "",

"unit_name": "支",

"is_vip": 0,

"vip_price": 0,

"book_flag": 0,

"description": "1234",

"new_discount": null,

"checkCoupon": false

(11) 错误返回示例

"status": 500,

"msg": "服务器异常",

"data": []

(12) 错误码

Code Msg

You might also like