sonnenglas / amazon-mws-laravel

A library to connect to Amazon's MWS web services in an object oriented manner
Apache License 2.0
64 stars 73 forks source link

ShipmentName issue while creating Inbound Shipment from Plan #40

Open shanijahania opened 4 years ago

shanijahania commented 4 years ago

Hello, I am trying to create inbound shipment using "CreateInboundShipment" but i am getting error "400 Bad Request:Request is invalid - ShipmentName is required" Since the "InboundShipmentHeader.ShipmentName" is required to create inbound shipment. Can you please Help.

Thanks

gaurav2262 commented 3 years ago

Hello,

Add this function in AmazonShipment.php after setShipmentId($s) function

/**
     * This function is created for set shipment name externally on 28-Sept-2020
     * Sets the shipment Name. (Required)
     * @param string $s <p>Shipment Name</p>
     * @return boolean <b>FALSE</b> if improper input
     */
    public function setShipmentName($s)
    {
        if (is_string($s) && $s) {
            $this->options['InboundShipmentHeader.ShipmentName'] = $s;
        } else {
            return false;
        }
    }

And call $amzRequest->setShipmentName($shipmentName); with AmazonShipment object;

Declare something like this https://prnt.sc/yyt7w7 and use something like this https://prnt.sc/yytk99.

hope this is useful.