我需要通过亚马逊订单 ID 在亚马逊 MWS中获取订单跟踪 ID ,如果有人对此有任何想法,请帮助我
2 回答
_GET_AMAZON_FULFILLED_SHIPMENTS_DATA_ 报告为您shipmentid
提供以及实际trackingnumber
和carrier
(USPS、FEDEX 等)
这是你想要的?
编辑:嗯,需要安排很多报告才能请求它们。这是一。我喜欢通过暂存器管理很多此类内容,https: //mws.amazonservices.com在这里,如果需要,您可以将报告设置为在每天的某个时间自动运行。然后,一旦安排好,创建一个脚本以GetReportList
指定该报告类型。那会给你reportid。然后,您可以使用该 reportidGetReport
该过程的一个高级示例如下:
<?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]);
获取reportType“_GET_AMAZON_FULFILLED_SHIPMENTS_DATA_”的报告。它将为您提供订单跟踪号、承运人和履行详情。
最佳实践是在继续之前使用Amazon Scratchpad并测试您的查询。
首先,您需要请求“RequestReport”(您会在 API 部分中选择“report”后出现的 Operation 部分中找到它)。
其次,您需要使用下一个 API“GetReportList”。在这里,您将找到“reportId”,它将在获取报告的第三步也是最后一步中使用。
最后一步是点击 API“GetReport”。