Lingxing
切换旧版

查询FBA成本计价流水

POST/cost/center/api/cost/stream

支持查询成本中心FBA成本计价流水

注意:
1.由于亚马逊库存分类账生成数据后5天内会发生变更,领星在获取数据的5天内会继续获取数据并覆盖更新历史版本,因此接口获取的5天内数据是有可能发生变更的。 2.business_types传参为1 - 期初库存-FBA上月结存时,change_other_amount、change_logistics_amount、change_purchase_amount、change_quantity字段不返回。

接口信息

API Path请求协议请求方式令牌桶容量
/cost/center/api/cost/stream HTTPSPOST10

请求参数

wh_namesarray<any>
仓库名
shop_namesarray<any>
店铺名
skusarray<any>
sku
mskusarray<any>
msku
disposition_typesarray<any>
库存属性:
1 可用在途
2 可用
3 次品
business_typesarray<any>必填
出入库类型:
1 期初库存-FBA上月结存
10 调拨入库-FBA补货入库
11 调拨入库-FBA途损补回
12 调拨入库-FBA超签入库
13 调拨入库-FBA超签入库(close后)
14 调拨入库-FBA补货入库(无发货单)
20 调拨入库-FBA调仓入库
35 调拨入库-FBA发货在途入库
25 盘点入库-FBA盘点入库
30 FBA退货-FBA无源单销售退货
31 FBA退货-FBA有源单销售退货
200 销售出库-FBA补发货销售
201 销售出库-FBA多渠道销售订单
202 销售出库-FBA亚马逊销售订单
205 其他出库-FBA补货出库
220 盘点出库-FBA盘点出库
15 调拨出库-FBA调仓出库
215 调拨出库-FBA移除
225 调拨出库-FBA发货在途出库
226 调拨出库-FBA发货途损
227 调拨出库-后补发货单在途出库
5 调整单- FBA对账差异入库调整
210 调整单-FBA对账差异出库调整
400 调整单-尾差调整
420 调整单-负库存数量调整
405 调整单-期初成本录入
query_typestring必填
日期查询类型:
01 库存动作日期【对应成本计价详情页面单据日期,即在FBA仓库内发生各项库存动作的日期】
02 结算日期【仅销售、退货场景会存在结算日期,其他库存动作结算日期为空】
start_datestring必填
起始日期,Y-m-d,不允许跨月
end_datestring必填
结束日期,Y-m-d,不允许跨月
business_numbersarray<any>
业务编号
origin_accountsarray<any>
源头单据号
offsetinteger
分页偏移量,默认0
lengthinteger
分页长度,默认200条

请求示例

{
    "wh_names": [
        "8P-US-2024美国仓"
    ],
    "shop_names": [
        "8P-US-2024"
    ],
    "skus": [
        "LX-0035",
        "00000000001",
        "SKU9988"
    ],
    "mskus": [
        "HOLDER001",
        "Pink_Head_Rope_1"
    ],
    "disposition_types": [1,2,3],
    "business_types": [
        1
    ],
    "query_type": "01",
    "start_date": "2023-06-01",
    "end_date": "2023-06-30",
    "business_numbers": [
        "FBA176M2LL9C",
        "FCInboundRoutingService-FTW1-GYR1-81d2e262-7a9b-459b-8878-2708f6f3e789"
    ],
    "origin_accounts": [
        "SP230413004(无源单取最近签收成本),业务编号:FBA16V31K78D,流水编号:20220903J0001X"
    ],
    "offset": 0,
    "length": 200
}

返回结果

Json Object

codeinteger必填
状态码,0 成功
msgstring必填
响应信息
successboolean必填
操作是否成功
traceIdstring必填
请求链路Id
dataobject必填
汇总数据
隐藏子属性
totalnumber必填
总记录条数
sizenumber必填
每个数据页大小
currentnumber必填
当前所在数据页
recordsarray<object>必填
分页数据列表
隐藏子属性
stream_datestring必填
库存动作日期
示例 2022-12-01
settlement_datestring
结算日期
示例 2022-12-01
source_data_timestring
数据源更新时间
示例 2022-12-28 00:13:21
unique_keystring
主键
示例 主键
data_versionstring必填
计算版本号
示例 1672156800661
business_numberstring
业务编号
示例 FBA15F9VZ512
origin_accountstring
源头单据号
示例 SP220210001
skustring必填
sku
示例 测试sku001
mskustring必填
msku
示例 1160U1713
wh_namestring必填
仓库名称
示例 xxxxxxx
shop_namestring
店铺名称
示例 xxxxxxx
disposition_typestring必填
库存属性
示例 可用在途
business_typestring必填
出入库类型编码
示例 1
business_type_descstring必填
出入库类型名称
示例 期初库存-FBA上月结存
cost_sourcestring必填
成本取值来源
示例 上月结存
change_quantitynumber必填
变动数量
示例 0
change_purchase_unit_pricestring必填
变动采购单价
示例 0
change_purchase_amountstring必填
变动采购成本
示例 0
change_logistics_unit_pricestring必填
变动头程单价
示例 0
change_logistics_amountstring必填
变动头程成本
示例 0
change_other_unit_pricestring必填
变动其他单价
示例 0
change_other_amountstring必填
变动其他成本
示例 0
balance_quantitynumber必填
结存数量
示例 70
balance_purchase_unit_pricestring必填
结存采购成本单价
示例 5.5815
balance_purchase_amountstring必填
结存采购成本
示例 390.71
balance_logistics_unit_pricestring必填
结存头程成本单价
示例 20.0000
balance_logistics_amountstring必填
结存头程成本
示例 1400.00
balance_other_unit_pricestring必填
结存其他成本单价
示例 2.4712
balance_other_amountstring必填
结存其他成本
示例 172.98
sales_platformstring
销售平台
reasonstring
盘点原因
示例 &nbsp;

返回成功示例

{
	"code": 0,
	"data": {
		"current": 0,
		"records": [
			{
				"balance_logistics_amount": "1.11",
				"balance_logistics_unit_price": "40.2469",
				"balance_other_amount": "1.11",
				"balance_other_unit_price": "40.2469",
				"balance_purchase_amount": "1.11",
				"balance_purchase_unit_price": "40.2469",
				"balance_quantity": 297,
				"business_number": "pock-Executor-BHX1-LCY2-1647210652366-627a54b1-37a9-4fbd-9e46-ffb58a3be20c",
				"business_type": "1",
				"business_type_desc": "期初库存-FBA上月结存",
				"change_logistics_amount": "1.11",
				"change_logistics_unit_price": "40.2469",
				"change_other_amount": "1.11",
				"change_other_unit_price": "40.2469",
				"change_purchase_amount": "1.11",
				"change_purchase_unit_price": "40.2469",
				"change_quantity": 297,
				"cost_source": "上月结存",
				"data_version": "1672053502119",
				"disposition_type": "可用",
				"msku": "1160U1152-A",
				"origin_account": "FBA15FN6XK4L",
				"reason": "原因",
				"sales_platform": "销售平台A",
				"settlement_date": "结算日期",
				"shop_name": "JHL Official-02",
				"sku": "sku003",
				"source_data_time": "2022-12-26 19:19:28",
				"streamDate": "2022-06-01",
				"unique_key": "null",
				"wh_name": "JHL Official-02"
			}
		],
		"size": 5,
		"total": 1
	},
	"msg": "操作成功",
	"success": true,
	"traceId": "320aba4f-6af1-4cac-aa0c-6b27bc77bae1.1673003238583"
}

返回失败示例

{
    "code": 1,
    "msg": "操作失败",
    "data": null,
    "traceId": "b2532fc7-9c1b-4b08-8d30-301b31b70562.1663226369188",
    "success": false
}