You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Its just a simple test code and I am getting 200 in $response->status code but when I convert the response in dto(), it throws an exception. I have tried catalogue API and it works and converts in the DTO object successfully but in orders its not working. Please help.
Error:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function SellingPartnerApi\Seller\OrdersV0\Dto\Order::__construct(), 0 passed in C:\amazon-seller-api-test\vendor\jlevers\selling-partner-api\src\Traits\Deserializes.php on line 71 and at least 4 expected in C:\amazon-seller-api-test\vendor\jlevers\selling-partner-api\src\Seller\OrdersV0\Dto\Order.php on line 130
ArgumentCountError: Too few arguments to function SellingPartnerApi\Seller\OrdersV0\Dto\Order::__construct(), 0 passed in C:\amazon-seller-api-test\vendor\jlevers\selling-partner-api\src\Traits\Deserializes.php on line 71 and at least 4 expected in C:\amazon-seller-api-test\vendor\jlevers\selling-partner-api\src\Seller\OrdersV0\Dto\Order.php on line 130
Code
$ordersApi = $connector->ordersV0();
$orderId = $_ENV['ORDER_ID']; // Replace with the actual order ID$response = $ordersApi->getOrder($orderId);
if ($response->status() === 200) {
// Get the response as a DTO$orderDetails = $response->dto();
// Display order detailsecho"Order ID: " . $orderDetails->payload->orderId . "\n";
echo"Purchase Date: " . $orderDetails->payload->purchaseDate . "\n";
echo"Order Status: " . $orderDetails->payload->orderStatus . "\n";
echo"Buyer Email: " . $orderDetails->payload->buyerEmail . "\n";
}
else {
thrownewException("Failed to fetch order details. Status code: " . $response->status());
}
Seller Central SP API config page screenshot
your screenshot here
The text was updated successfully, but these errors were encountered:
Problem description:
Its just a simple test code and I am getting 200 in $response->status code but when I convert the response in dto(), it throws an exception. I have tried catalogue API and it works and converts in the DTO object successfully but in orders its not working. Please help.
Error:
Code
Seller Central SP API config page screenshot
your screenshot here
The text was updated successfully, but these errors were encountered: