Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After downloading the GET_FBA_FULFILLMENT_CUSTOMER_RETURNS_DATA report, a parsing error occurs. #809

Open
BaiNight opened this issue Nov 7, 2024 · 0 comments

Comments

@BaiNight
Copy link

BaiNight commented Nov 7, 2024

Version:v7.2.3

Download GET_FBA_FULFILLMENT_CUSTOMER_RETURNS_DATA with the following example code:

  use SellingPartnerApi\SellingPartnerApi;
  
  $reportType = 'GET_FBA_FULFILLMENT_CUSTOMER_RETURNS_DATA';
  $documentId = 'amzn1.spdoc.1.4.na....2610';
  
  $connector = SellingPartnerApi::seller(/* ... */);
  $response = $connector->reportsV20210630()->getReportDocument($documentId, $reportType);
  
  $reportDocument = $response->dto();
  
  $contents = $reportDocument->download($reportType);

After calling the: download method, an error occurs::The conversion from Windows-1252 to UTF-8 failed.

Call stack as follows:

#0 D:\php-project\amazon-api\vendor\openspout\openspout\src\Common\Helper\EncodingHelper.php(96): OpenSpout\Common\Helper\EncodingHelper->attemptConversion('Incorrect size,...', 'Windows-1252', 'UTF-8')
#1 D:\php-project\amazon-api\vendor\openspout\openspout\src\Reader\CSV\RowIterator.php(204): OpenSpout\Common\Helper\EncodingHelper->attemptConversionToUTF8('Incorrect size,...', 'Windows-1252')
#2 D:\php-project\amazon-api\vendor\openspout\openspout\src\Reader\CSV\RowIterator.php(132): OpenSpout\Reader\CSV\RowIterator->getNextUTF8EncodedRow()
#3 D:\php-project\amazon-api\vendor\openspout\openspout\src\Reader\CSV\RowIterator.php(90): OpenSpout\Reader\CSV\RowIterator->readDataForNextRow()
#4 D:\php-project\amazon-api\vendor\jlevers\selling-partner-api\src\Traits\DownloadsDocument.php(173): OpenSpout\Reader\CSV\RowIterator->next()
#5 D:\php-project\amazon-api\vendor\jlevers\selling-partner-api\src\Traits\DownloadsDocument.php(128): SellingPartnerApi\Seller\ReportsV20210630\Responses\ReportDocument->parseSpreadsheet('return-date\tord...')
#6 D:\php-project\amazon-api\vendor\jlevers\selling-partner-api\src\Traits\DownloadsDocument.php(84): SellingPartnerApi\Seller\ReportsV20210630\Responses\ReportDocument->parseDocument('return-date\tord...')
#7 D:\php-project\amazon-api\app\Http\Services\AmazonReportDocService.php(36): SellingPartnerApi\Seller\ReportsV20210630\Responses\ReportDocument->download('GET_FBA_FULFILL...')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant