【发布时间】:2017-10-23 07:22:11
【问题描述】:
我需要通过亚马逊订单 ID 在亚马逊 MWS 中获取订单跟踪 ID,如果有人对此有任何想法,请帮助我
【问题讨论】:
标签: php amazon-web-services amazon amazon-mws amazon-marketplace
我需要通过亚马逊订单 ID 在亚马逊 MWS 中获取订单跟踪 ID,如果有人对此有任何想法,请帮助我
【问题讨论】:
标签: php amazon-web-services amazon amazon-mws amazon-marketplace
_GET_AMAZON_FULFILLED_SHIPMENTS_DATA_ 报告为您提供 shipmentid 以及实际的 trackingnumber 和 carrier(USPS、FEDEX 等)
这是你要找的吗?
编辑:
好吧,在您请求之前需要安排很多报告。这是一。我喜欢通过暂存器管理很多这类事情,https://mws.amazonservices.com 在这里,如果需要,您可以将报告设置为每天在特定时间自动运行。然后,一旦安排好,创建一个脚本到GetReportList,并指定该报告类型。那会给你reportid。然后,您可以将该报告 ID 用于GetReport
该过程的高级示例如下:
<?php
$config = array (
'ServiceURL' => $this->companyServiceURL[$this->company],
'ProxyHost' => null,
'ProxyPort' => -1,
'MaxErrorRetry' => 3,
);
$service = new MarketplaceWebService_Client(
AWS_ACCESS_KEY_ID,
AWS_SECRET_ACCESS_KEY,
$config,
APPLICATION_NAME,
APPLICATION_VERSION);
$request = new MarketplaceWebService_Model_GetReportRequestListRequest();
$request->setMerchant(MERCHANT_ID);
$reports = new MarketplaceWebService_Model_TypeList();
$reports->setType('_GET_AMAZON_FULFILLED_SHIPMENTS_DATA_');
$request->setReportTypeList($reports);
$request->setMaxCount(50);
$reportId = $this->invokeGetReportRequestList($service, $request);
$reportRequest = new MarketplaceWebService_Model_GetReportRequest();
$reportRequest->setMerchant(MERCHANT_ID);
$reportRequest->setReport(@fopen('php://memory', 'rw+'));
$reportRequest->setReportId($reportId);
$resultArray = $this->invokeGetReportAmazonFulfilledShipments($service, $reportRequest);
$this->updateAmazonFulfilledShipments($resultArray, $this->companySiteArray[$this->company], $this->companyIdArray[$this->company]);
【讨论】:
$this->companyServiceURL[$this->company]是什么
获取reportType“_GET_AMAZON_FULFILLED_SHIPMENTS_DATA_”的报告。它将为您提供订单跟踪号、承运人和履行详情。
最佳做法是使用Amazon Scratchpad 并在继续之前测试您的查询。
首先,您需要请求“RequestReport”(您会在 API 部分中选择“报告”后出现的操作部分中找到它)。
其次,您需要使用下一个 API“GetReportList”。在这里您会找到“reportId”,它将在获取报告的第三步也是最后一步中使用。
最后一步是点击 API“GetReport”。
【讨论】: