Example #1
0
 /**
  * Create Inbound Shipment
  * Creates an inbound shipment. It may include up to 200 items.
  * The initial status of a shipment will be set to 'Working'.
  * This operation will simply return a shipment Id upon success,
  * otherwise an explicit error will be returned.
  * More items may be added using the Update call.
  *
  * @param mixed $request array of parameters for FBAInboundServiceMWS_Model_CreateInboundShipment request or FBAInboundServiceMWS_Model_CreateInboundShipment object itself
  * @see FBAInboundServiceMWS_Model_CreateInboundShipmentRequest
  * @return FBAInboundServiceMWS_Model_CreateInboundShipmentResponse
  *
  * @throws FBAInboundServiceMWS_Exception
  */
 public function createInboundShipment($request)
 {
     if (!$request instanceof FBAInboundServiceMWS_Model_CreateInboundShipmentRequest) {
         $request = new FBAInboundServiceMWS_Model_CreateInboundShipmentRequest($request);
     }
     $parameters = $request->toQueryParameterArray();
     $parameters['Action'] = 'CreateInboundShipment';
     $httpResponse = $this->_invoke($parameters);
     $response = FBAInboundServiceMWS_Model_CreateInboundShipmentResponse::fromXML($httpResponse['ResponseBody']);
     $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
     return $response;
 }
 * Uncomment to try out Mock Service that simulates FBAInboundServiceMWS
 * responses without calling FBAInboundServiceMWS service.
 *
 * Responses are loaded from local XML files. You can tweak XML files to
 * experiment with various outputs during development
 *
 * XML files available under FBAInboundServiceMWS/Mock tree
 *
 ***********************************************************************/
// $service = new FBAInboundServiceMWS_Mock();
/************************************************************************
 * Setup request parameters and uncomment invoke to try out
 * sample for Create Inbound Shipment Action
 ***********************************************************************/
// @TODO: set request. Action can be passed as FBAInboundServiceMWS_Model_CreateInboundShipment
$request = new FBAInboundServiceMWS_Model_CreateInboundShipmentRequest();
$request->setSellerId(MERCHANT_ID);
// object or array of parameters
invokeCreateInboundShipment($service, $request);
/**
 * Get Create Inbound Shipment Action Sample
 * Gets competitive pricing and related information for a product identified by
 * the MarketplaceId and ASIN.
 *
 * @param FBAInboundServiceMWS_Interface $service instance of FBAInboundServiceMWS_Interface
 * @param mixed $request FBAInboundServiceMWS_Model_CreateInboundShipment or array of parameters
 */
function invokeCreateInboundShipment(FBAInboundServiceMWS_Interface $service, $request)
{
    try {
        $response = $service->CreateInboundShipment($request);