You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

亚马逊SP API调用GET_MERCHANT_LISTINGS_ALL_DATA报告无库存数据问询

问题描述

使用Amazon Selling Partner API拉取库存数据时遇到异常,具体情况如下:
已完成库存相关报告创建,获取到了report_id、report_document_id等标识信息,调用GetReports接口获取报告返回的结构如下:

object(ClouSale\AmazonSellingPartnerAPI\Models\Reports\GetReportResponse)#482 (1) { ["container":protected]=> array(2) { ["payload"]=> object(ClouSale\AmazonSellingPartnerAPI\Models\Reports\Report)#491 (1) { ["container":protected]=> array(11) { ["marketplace_ids"]=> array(1) { [0]=> string(14) "A1VC38T7YXB528" } ["report_id"]=> string(11) "55933018913" ["report_type"]=> string(30) "GET_MERCHANT_LISTINGS_ALL_DATA" ["data_start_time"]=> object(DateTime)#506 (3) { ["date"]=> string(26) "2021-10-13 04:42:10.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } ["data_end_time"]=> object(DateTime)#483 (3) { ["date"]=> string(26) "2021-10-13 04:42:10.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } ["report_schedule_id"]=> NULL ["created_time"]=> object(DateTime)#502 (3) { ["date"]=> string(26) "2021-10-13 04:42:10.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } ["processing_status"]=> string(4) "DONE" ["processing_start_time"]=> object(DateTime)#481 (3) { ["date"]=> string(26) "2021-10-13 04:42:16.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } ["processing_end_time"]=> object(DateTime)#480 (3) { ["date"]=> string(26) "2021-10-13 04:42:25.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } ["report_document_id"]=> string(73) "amzn1.spdoc.1.3.2149a182-4354-4177-b03e-0bc4552cb190.T25GAW47NVJ50Z.47700" } } ["errors"]=> NULL } }

报告返回结构截图

调用GetReports接口拉取报告后,未展示预期的库存数据,期望获取的库存数据格式参考如下图:
预期库存数据格式截图

请问该情况是否属于正常现象?应如何排查解决该问题?

解答

该情况属于正常现象。GetReports接口的设计定位仅为返回报告的处理状态、关联ID等元数据,不会直接返回报告内的业务数据,你当前获取的返回结果完全符合SP API的接口规范。

可按以下步骤排查解决:

  • 调用GetReportDocument接口,传入你已获取到的report_document_id,该接口会返回报告的临时下载地址、压缩算法等信息。
  • 使用返回的临时下载地址拉取报告文件,按照接口返回的压缩算法对文件进行解压,SP API返回的报告默认采用gzip压缩。
  • 确认你使用的报告类型是否匹配需求:你当前使用的GET_MERCHANT_LISTINGS_ALL_DATA为全量商品上架报告,仅包含商品基础上架信息,不会返回FBA可售库存、在途库存、预留库存等明细库存字段。若需要获取FBA库存数据,建议更换为GET_FBA_INVENTORY_AVAILABILITY_DATA报告类型;若需要自发货库存数据,可使用GET_MERCHANT_FULFILLMENT_INVENTORY_SUMMARY报告类型。
  • 解压后的报告通常为TSV或CSV格式,使用对应分隔符、UTF-8编码解析即可拿到你需要的库存字段。

内容的提问来源于stack exchange,提问作者Ali Bektash

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.30 04:15:04