Closed phploader closed 2 years ago
No bug in your code, SP-API doesn't return buyer data via this API even though you have the PII permission. In my contact with the amazon support this should be changed with the next release of the orders API, but I wouldn't bet on it.
We're currently using the GET_ORDER_REPORT_DATA_INVOICING report to get the buyer address.
Please allow me to inform you that the file sent on 19-08-2022 has an access token sent in the request. Calling a restricted operation with an access token will allow you to call an operation, but the PII will not be returned.
Please note: Token starting with Atzr is a refresh token (R for refresh) Token starting with Atza is an access token (A for Access) Token starting with Atz.sprdt is a restricted data token (sprdt could mean Selling Partner Restricted Data Token).
Please feel free to check the attachment, and you will see that the value provided for x-amz-access-token starts with Atza|XXXXX
I would like to request you to please follow the guide provided below to generate a restricted data token, and use that RDT to call any restricted operation.
@KhorneHoly Otherwise, could you give me a code example of how you retrieve the data via GEZ_ORDER_REPORT_DATA_INVOICING?
@phploader
You forgot to pass the 2nd argument in getOrder, it should be:
$result = $apiInstance->getOrder($order_id, $data_elements);
@gmauro99 has the correct solution here -- I'm going to close this. @phploader, please feel free to respond to this if you still need help.
Hello, @gmauro99 thanks for the hint, unfortunately this did not bring the solution either. I have changed the line as follows.
$result = $apiInstance->getOrder($order_id, $data_elements);
The output is unfortunately the same without the customer address.
The problem still exists.
@jlevers Can you please open the topic again? The topic is not closed.
Hello, I am trying to retrieve order information with the following code: ` $config = new Configuration([ "lwaClientId" => "amzn1.application-oa2-client.xxx", "lwaClientSecret" => "7904axxxxx", "lwaRefreshToken" => "Atzr|xxxxxx", "awsAccessKeyId" => "AKIA4xxxxx", "awsSecretAccessKey" => "sLX3zoxxxxxxx", "endpoint" => Endpoint::EU ]);
In response I get the following result. As you can see, customer data is missing like name, first name, street:
`SellingPartnerApi\Model\OrdersV0\GetOrderResponse Object ( [container:protected] => Array ( [payload] => SellingPartnerApi\Model\OrdersV0\Order Object ( [container:protected] => Array ( [amazon_order_id] => 302-8046517-XXXXXXX [seller_order_id] => 302-8046517-XXXXXXX [purchase_date] => 2022-08-07T18:46:22Z [last_update_date] => 2022-08-08T01:16:16Z [order_status] => Shipped [fulfillment_channel] => AFN [sales_channel] => Amazon.de [order_channel] => [ship_service_level] => Expedited [order_total] => SellingPartnerApi\Model\OrdersV0\Money Object ( [container:protected] => Array ( [currency_code] => EUR [amount] => XX.XX )
)`
(Please note that I made sensitive data with XX away).
Amazon support says that I already have PII roll and the data I had already received with the old interface MWS as well.
Can you please tell me if it is a bug in my code that I am not getting this data?
2022.09.26 edit: from:
$result = $apiInstance->getOrder($order_id);
to:$result = $apiInstance->getOrder($order_id, $data_elements);
Result: Problem exists.