selling-partner-api icon indicating copy to clipboard operation
selling-partner-api copied to clipboard

Missing model fields for the Shipping API on v6

Open bgarret opened this issue 10 months ago • 0 comments

Problem description:

Hello,

I'm implementing the Shipping V2 API and it looks like there are a few model fields missing while using the getTracking method :

  • The ErrorList has an errorList field, it should be errors.
  • SellingPartnerApi\Seller\ShippingV2\Dto\Event has an optional shipmentType field.
  • SellingPartnerApi\Seller\ShippingV2\Dto\TrackingSummary has an optional trackingDetailCodes field.

Is there documentation on how to regenerate DTO classes? I'm open to fixing this, but I understood that the DTO classes are auto-generated and I couldn't find the process on how to do so.

Thanks again for all your work!

Error:

ErrorList

Warning: Unknown keys when deserializing into SellingPartnerApi\Seller\ShippingV2\Responses\ErrorList: errors

Fatal error: Uncaught ArgumentCountError: Too few arguments to function SellingPartnerApi\Seller\ShippingV2\Responses\ErrorList::__construct(), 0 passed in /var/www/vendor/highsidelabs/saloon-sdk-generator/src/Traits/Deserializes.php on line 74 and exactly 1 expected in /var/www/vendor/jlevers/selling-partner-api/src/Seller/ShippingV2/Responses/ErrorList.php:15

Event and TrackingSummary

Warning: Unknown keys when deserializing into SellingPartnerApi\Seller\ShippingV2\Dto\Event: shipmentType
Warning: Unknown keys when deserializing into SellingPartnerApi\Seller\ShippingV2\Dto\TrackingSummary: trackingDetailCodes

Code

try {
    /** @var ShippingV2\Responses\GetTrackingResponse $response */
    $response = $api->getTracking($tracking, "AMZN_FR")->dto();
} catch (\Saloon\Exceptions\Request\ClientException $e) {
    $e->getResponse()->dto();
    var_dump($e->__toString());
}

bgarret avatar Apr 02 '24 09:04 bgarret