Open joseramoneras opened 4 months ago
Good afternoon, I'm sending you the complete example in case you can't see it well.
I don't see anything obviously wrong with the getReportDocument
call, but try passing $date_from
and $date_to
to createReport
as DateTime
objects, instead of turning them into strings first.
Problem description:
The function ReportsV20210630()->getReportDocument return error 400
Error:
"errors": [ { "code": "InvalidInput", "message": "Invalid or unsupported document ID found", "details": "" } ]
Code
<?php
use SellingPartnerApi\SellingPartnerApi; use SellingPartnerApi\Enums\Endpoint; use SellingPartnerApi\Seller\ReportsV20210630\Dto\CreateReportSpecification;
require_once $_SERVER["DOCUMENT_ROOT"] . '/erp_produccion/libs/selling-partner-api/vendor/autoload.php';
new Pruebas();
class Pruebas { private $connector;
public function __construct() { $this->connector = SellingPartnerApi::seller( clientId: 'xxxxxxxxx', clientSecret: 'xxxxxxxxxxxxxxx', refreshToken:'xxxxxxxxxxxx', endpoint: Endpoint::EU );
}
private function requestReport($report_type, $marketplace_id = NULL){ date_default_timezone_set('UTC'); if (!$report_type) return false;
} }