function addPackageLineItem1(){ $packageLineItem = array( 'SequenceNumber'=>1, 'GroupPackageCount'=>1, 'InsuredValue' => array( 'Amount' => 100.00, 'Currency' => 'USD' ), 'Weight' => array( 'Value' => 70.0, 'Units' => 'LB' ), 'Dimensions' => array( 'Length' => 20, 'Width' => 10, 'Height' => 10, 'Units' => 'IN' ), 'CustomerReferences' => array( '0' => array( 'CustomerReferenceType' => 'CUSTOMER_REFERENCE', // valid values CUSTOMER_REFERENCE, INVOICE_NUMBER, P_O_NUMBER and SHIPMENT_INTEGRITY 'Value' => 'GR4567892' ), '1' => array( 'CustomerReferenceType' => 'INVOICE_NUMBER', 'Value' => 'INV4567892' ), '2' => array( 'CustomerReferenceType' => 'P_O_NUMBER', 'Value' => 'PO4567892' ) ), 'SpecialServicesRequested' => addSpecialServices1() ); return $packageLineItem; }
$request['TransactionDetail'] = array('CustomerTransactionId' => '*** Intra India Shipping Request using PHP ***'); $request['Version'] = array( 'ServiceId' => 'ship', 'Major' => '17', 'Intermediate' => '0', 'Minor' => '0' ); $request['RequestedShipment'] = array( 'ShipTimestamp' => date('c'), 'DropoffType' => 'REGULAR_PICKUP', // valid values REGULAR_PICKUP, REQUEST_COURIER, DROP_BOX, BUSINESS_SERVICE_CENTER and STATION 'ServiceType' => 'STANDARD_OVERNIGHT', // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_EXPRESS_SAVER 'PackagingType' => 'YOUR_PACKAGING', // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ... 'Shipper' => addShipper(), 'Recipient' => addRecipient(), 'ShippingChargesPayment' => addShippingChargesPayment(), 'SpecialServicesRequested' => addSpecialServices1(), //Used for Intra-India shipping - cannot use with PRIORITY_OVERNIGHT 'CustomsClearanceDetail' => addCustomClearanceDetail(), 'LabelSpecification' => addLabelSpecification(), 'CustomerSpecifiedDetail' => array('MaskedData'=> 'SHIPPER_ACCOUNT_NUMBER'), 'PackageCount' => 1, 'RequestedPackageLineItems' => array( '0' => addPackageLineItem1() ) ); try{ if(setEndpoint('changeEndpoint')){ $newLocation = $client->__setLocation(setEndpoint('endpoint')); }