Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
...
Table of Contents |
---|
...
method
...
post
...
body
...
接口功能 | 添加产品 | ||
支持格式 | JSON | 开发人员 | |
请求方式 | POST | 发布日期 |
请求参数说明:
参数 | 必选 | 类型 | 说明 |
---|---|---|---|
product_id |
...
产品ID
...
| INT(10) | 产品id , 参考接口: 产品的增删改查 | |||||||
consignment_id |
...
订单ID
| BINGINT(16) | 订单ID | |||||||
product_type |
| VARCHAR | 产品类型 |
...
必填
...
'NORMAL'
...
,默认“NORMAL” | |||||||||
quantity |
| INT | 数量 | ||||||
is_directional_shared_product |
| BOOL | 是否定向共享产品 |
...
ebay_transaction_id |
| VARCHAR | eBay订单交易号 | ||||||
ebay_item_no |
| VARCHAR | eBay产品ID | ||||||
sales_price |
| FLOAT(‘%.2f’) | 销售价格 |
参数说明:
参数 | 类型 | 说明 |
---|---|---|
sold_quantity | INT | 出售数量 |
count | INT | 产品数量 |
product_customs_name | VARCHAR | 海关属性名称 |
product_weight | FLOAT(‘%.2f’) | 产品重量 |
total_price_customs_export | FLOAT(‘%.3f’) | 总出口报关价 |
product_client_ref | VARCHAR | 产品SKU |
id | INT | 订单产品列表ID |
product_id | INT | 产品ID |
consignment_id | INT | 订单ID |
quantity | INT | 数量 |
unit_product_price | FLOAT(‘%.2f’) | 产品单价 |
unit_product_cost | FLOAT(‘%.2f’) | 产品成本 |
unit_product_length | FLOAT(‘%.2f’) | 产品长 |
unit_product_width | FLOAT(‘%.2f’) | 产品宽 |
unit_product_depth | FLOAT(‘%.2f’) | 产品高 |
unit_product_weight | FLOAT(‘%.2f’) | 产品重 |
price_customs_export | FLOAT(‘%.3f’) | 出口报关价 |
price_customs_export_internal | FLOAT(‘%.3f’) | 内部出口报关价 |
price_customs_export_origin | FLOAT(‘%.3f’) | 出口报关价来源 |
price_customs_export_internal_origin | FLOAT(‘%.3f’) | 内部出口报关价来源 |
sales_price | FLOAT(‘%.2f’) | 销售价格 |
sn | VARCHAR | SN唯一码(sn !=product_id && sn != product_client_ref) |
product_type | VARCHAR | 产品类型:[“NORMAL”||“DIRECTIONAL”] |
primary_keys | VARCHAR | 主键:[“id”] |
2、接口示例:
接口请求示例
URL:http://test.birdsystem.com/client/Consignment-Product
请求接口示例
Code Block | ||
---|---|---|
| ||
#api_key和company_id和提交数据中consignment_id &product_id需要替换成实际数据
-Headers 'api_key: {{bs.default_api_key}}' \ #所需登录站点company_id
-Headers 'company_id: {{bs.default_company_id}}' \ #所需登录账号的api_key
-Headers 'content-type: application/x-www-form-urlencoded' \ |
接口请求参数示例
(一次请求只能推送一次产品,多件产品需推送多次)
Code Block | |
---|---|
|
...
| |
{ "consignment_id":2011180360000239, " |
...
product_id": |
...
2989352,
"quantity":1
} |
接口返回示例
Code Block | ||
---|---|---|
| ||
{ "data": { |
...
样例
Code Block | ||||
---|---|---|---|---|
| ||||
# api_key和company_id和提交数据中的delivery_service_id需要替换成实际数据
curl -X POST \
https://test.birdsystem.com/client/consignment-product \
-H 'api_key: 248ccb90dff2b99465b54c113765360c' \
-H 'company_id: 36' \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'consignment_id=1904160360000015&product_id=200876&quantity=1' |
...
"sold_quantity": null,
"count": null,
"product_customs_name": null,
"product_weight": null,
"total_price_customs_export": null,
"product_client_ref": null,
"id": 71525956,
"product_id": 2989354,
"consignment_id": 2012140360000997,
"quantity": "2",
"unit_product_price": "2.00",
"unit_product_cost": "0.00",
"unit_product_weight": "50.00",
"unit_product_length": "50.00",
"unit_product_width": "50.00",
"unit_product_depth": "50.00",
"price_customs_export": "5.000",
"price_customs_export_internal": "1.000",
"price_customs_export_origin": "0.000",
"price_customs_export_internal_origin": "0.000",
"sales_price": "50.00",
"sn": null,
"product_type": "NORMAL",
"primary_keys": [
"id"
]
},
"success": true,
"moduleName": "client"
} |
返回异常示例(检查产品ID是否允许添加产品或检查产品是否正常,库存是否充足)
Code Block | ||
---|---|---|
| ||
{
"success": false,
"message": "Can not find product by id [2989352222]."
} |