Fedex API. Delivery marking. Delivery to multiple packages

I am using the FeDex API to print labels. The shortcut for 1 package prints successfully, but when I try to print several packages, I get an error:

stdClass Object ( [Severity] => ERROR [Source] => ship [Code] => 2463 [Message] => The number of RequestedPackages in the RequestedShipment must be equal to 1 [LocalizedMessage] => The number of RequestedPackages in the RequestedShipment must be equal to 1 ) 

The request I have included TotalWeight, PackageCount, but it does not help

 $request['WebAuthenticationDetail'] = array('UserCredential' =>array('Key' => $auth['key'], 'Password' => $auth['password'])); $request['ClientDetail'] = array('AccountNumber' => $auth['accountNumber'], 'MeterNumber' => $auth['meterNumber']); $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Ground Domestic Shipping Request v12 using PHP ***'); $request['Version'] = array('ServiceId' => 'ship', 'Major' => '12', 'Intermediate' => '1', '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' => 'FEDEX_GROUND', // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ... 'PackagingType' => 'YOUR_PACKAGING', // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ... 'Shipper' => $this->addShipper(), 'Recipient' => $this->recipient, 'ShippingChargesPayment' => $this->addShippingChargesPayment(), 'LabelSpecification' => $this->addLabelSpecification(), 'RateRequestTypes' => array('LIST'), // valid values ACCOUNT and LIST 'PackageCount' => count($this->packages), 'TotalWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'PackageDetail' => 'INDIVIDUAL_PACKAGES', 'RequestedPackageLineItems' => $this->packageLineItem//array('0' => $this->packageLineItem) ); $this->packageLineItem[] = array('SequenceNumber'=>$i, 'GroupPackageCount' => count($this->packages), 'MasterTrackingID' => '123123123123', 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'Weight' => array('Value' => $this->packages[$i-1], //weight!!!!!!!!!!!!! 'Units' => 'LB'), 'CustomerReferences' => array('0' => array('CustomerReferenceType' => 'CUSTOMER_REFERENCE', 'Value' => 'GR4567892'), // valid values CUSTOMER_REFERENCE, INVOICE_NUMBER, P_O_NUMBER and SHIPMENT_INTEGRITY '1' => array('CustomerReferenceType' => 'INVOICE_NUMBER', 'Value' => 'INV4567892'), '2' => array('CustomerReferenceType' => 'P_O_NUMBER', 'Value' => 'PO4567892')), 'SpecialServicesRequested' => array('SpecialServiceTypes' => array('COD'), 'CodDetail' => array('CodCollectionAmount' => array('Currency' => 'USD', 'Amount' => 150), 'CollectionType' => 'ANY')// ANY, GUARANTEED_FUNDS ) ); array ( 'UserCredential' => array ( 'Key' => $ auth [ 'key'], 'Password' => $ auth [ 'password'])); $request['WebAuthenticationDetail'] = array('UserCredential' =>array('Key' => $auth['key'], 'Password' => $auth['password'])); $request['ClientDetail'] = array('AccountNumber' => $auth['accountNumber'], 'MeterNumber' => $auth['meterNumber']); $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Ground Domestic Shipping Request v12 using PHP ***'); $request['Version'] = array('ServiceId' => 'ship', 'Major' => '12', 'Intermediate' => '1', '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' => 'FEDEX_GROUND', // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ... 'PackagingType' => 'YOUR_PACKAGING', // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ... 'Shipper' => $this->addShipper(), 'Recipient' => $this->recipient, 'ShippingChargesPayment' => $this->addShippingChargesPayment(), 'LabelSpecification' => $this->addLabelSpecification(), 'RateRequestTypes' => array('LIST'), // valid values ACCOUNT and LIST 'PackageCount' => count($this->packages), 'TotalWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'PackageDetail' => 'INDIVIDUAL_PACKAGES', 'RequestedPackageLineItems' => $this->packageLineItem//array('0' => $this->packageLineItem) ); $this->packageLineItem[] = array('SequenceNumber'=>$i, 'GroupPackageCount' => count($this->packages), 'MasterTrackingID' => '123123123123', 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'Weight' => array('Value' => $this->packages[$i-1], //weight!!!!!!!!!!!!! 'Units' => 'LB'), 'CustomerReferences' => array('0' => array('CustomerReferenceType' => 'CUSTOMER_REFERENCE', 'Value' => 'GR4567892'), // valid values CUSTOMER_REFERENCE, INVOICE_NUMBER, P_O_NUMBER and SHIPMENT_INTEGRITY '1' => array('CustomerReferenceType' => 'INVOICE_NUMBER', 'Value' => 'INV4567892'), '2' => array('CustomerReferenceType' => 'P_O_NUMBER', 'Value' => 'PO4567892')), 'SpecialServicesRequested' => array('SpecialServiceTypes' => array('COD'), 'CodDetail' => array('CodCollectionAmount' => array('Currency' => 'USD', 'Amount' => 150), 'CollectionType' => 'ANY')// ANY, GUARANTEED_FUNDS ) ); array ( 'ShipTimestamp' => date ( 'c'), $request['WebAuthenticationDetail'] = array('UserCredential' =>array('Key' => $auth['key'], 'Password' => $auth['password'])); $request['ClientDetail'] = array('AccountNumber' => $auth['accountNumber'], 'MeterNumber' => $auth['meterNumber']); $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Ground Domestic Shipping Request v12 using PHP ***'); $request['Version'] = array('ServiceId' => 'ship', 'Major' => '12', 'Intermediate' => '1', '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' => 'FEDEX_GROUND', // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ... 'PackagingType' => 'YOUR_PACKAGING', // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ... 'Shipper' => $this->addShipper(), 'Recipient' => $this->recipient, 'ShippingChargesPayment' => $this->addShippingChargesPayment(), 'LabelSpecification' => $this->addLabelSpecification(), 'RateRequestTypes' => array('LIST'), // valid values ACCOUNT and LIST 'PackageCount' => count($this->packages), 'TotalWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'PackageDetail' => 'INDIVIDUAL_PACKAGES', 'RequestedPackageLineItems' => $this->packageLineItem//array('0' => $this->packageLineItem) ); $this->packageLineItem[] = array('SequenceNumber'=>$i, 'GroupPackageCount' => count($this->packages), 'MasterTrackingID' => '123123123123', 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'Weight' => array('Value' => $this->packages[$i-1], //weight!!!!!!!!!!!!! 'Units' => 'LB'), 'CustomerReferences' => array('0' => array('CustomerReferenceType' => 'CUSTOMER_REFERENCE', 'Value' => 'GR4567892'), // valid values CUSTOMER_REFERENCE, INVOICE_NUMBER, P_O_NUMBER and SHIPMENT_INTEGRITY '1' => array('CustomerReferenceType' => 'INVOICE_NUMBER', 'Value' => 'INV4567892'), '2' => array('CustomerReferenceType' => 'P_O_NUMBER', 'Value' => 'PO4567892')), 'SpecialServicesRequested' => array('SpecialServiceTypes' => array('COD'), 'CodDetail' => array('CodCollectionAmount' => array('Currency' => 'USD', 'Amount' => 150), 'CollectionType' => 'ANY')// ANY, GUARANTEED_FUNDS ) ); , // valid values REGULAR_PICKUP, REQUEST_COURIER, DROP_BOX, BUSINESS_SERVICE_CENTER and STATION $request['WebAuthenticationDetail'] = array('UserCredential' =>array('Key' => $auth['key'], 'Password' => $auth['password'])); $request['ClientDetail'] = array('AccountNumber' => $auth['accountNumber'], 'MeterNumber' => $auth['meterNumber']); $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Ground Domestic Shipping Request v12 using PHP ***'); $request['Version'] = array('ServiceId' => 'ship', 'Major' => '12', 'Intermediate' => '1', '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' => 'FEDEX_GROUND', // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ... 'PackagingType' => 'YOUR_PACKAGING', // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ... 'Shipper' => $this->addShipper(), 'Recipient' => $this->recipient, 'ShippingChargesPayment' => $this->addShippingChargesPayment(), 'LabelSpecification' => $this->addLabelSpecification(), 'RateRequestTypes' => array('LIST'), // valid values ACCOUNT and LIST 'PackageCount' => count($this->packages), 'TotalWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'PackageDetail' => 'INDIVIDUAL_PACKAGES', 'RequestedPackageLineItems' => $this->packageLineItem//array('0' => $this->packageLineItem) ); $this->packageLineItem[] = array('SequenceNumber'=>$i, 'GroupPackageCount' => count($this->packages), 'MasterTrackingID' => '123123123123', 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'Weight' => array('Value' => $this->packages[$i-1], //weight!!!!!!!!!!!!! 'Units' => 'LB'), 'CustomerReferences' => array('0' => array('CustomerReferenceType' => 'CUSTOMER_REFERENCE', 'Value' => 'GR4567892'), // valid values CUSTOMER_REFERENCE, INVOICE_NUMBER, P_O_NUMBER and SHIPMENT_INTEGRITY '1' => array('CustomerReferenceType' => 'INVOICE_NUMBER', 'Value' => 'INV4567892'), '2' => array('CustomerReferenceType' => 'P_O_NUMBER', 'Value' => 'PO4567892')), 'SpecialServicesRequested' => array('SpecialServiceTypes' => array('COD'), 'CodDetail' => array('CodCollectionAmount' => array('Currency' => 'USD', 'Amount' => 150), 'CollectionType' => 'ANY')// ANY, GUARANTEED_FUNDS ) ); LIST'), // valid values ACCOUNT and LIST $request['WebAuthenticationDetail'] = array('UserCredential' =>array('Key' => $auth['key'], 'Password' => $auth['password'])); $request['ClientDetail'] = array('AccountNumber' => $auth['accountNumber'], 'MeterNumber' => $auth['meterNumber']); $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Ground Domestic Shipping Request v12 using PHP ***'); $request['Version'] = array('ServiceId' => 'ship', 'Major' => '12', 'Intermediate' => '1', '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' => 'FEDEX_GROUND', // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ... 'PackagingType' => 'YOUR_PACKAGING', // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ... 'Shipper' => $this->addShipper(), 'Recipient' => $this->recipient, 'ShippingChargesPayment' => $this->addShippingChargesPayment(), 'LabelSpecification' => $this->addLabelSpecification(), 'RateRequestTypes' => array('LIST'), // valid values ACCOUNT and LIST 'PackageCount' => count($this->packages), 'TotalWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'PackageDetail' => 'INDIVIDUAL_PACKAGES', 'RequestedPackageLineItems' => $this->packageLineItem//array('0' => $this->packageLineItem) ); $this->packageLineItem[] = array('SequenceNumber'=>$i, 'GroupPackageCount' => count($this->packages), 'MasterTrackingID' => '123123123123', 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'Weight' => array('Value' => $this->packages[$i-1], //weight!!!!!!!!!!!!! 'Units' => 'LB'), 'CustomerReferences' => array('0' => array('CustomerReferenceType' => 'CUSTOMER_REFERENCE', 'Value' => 'GR4567892'), // valid values CUSTOMER_REFERENCE, INVOICE_NUMBER, P_O_NUMBER and SHIPMENT_INTEGRITY '1' => array('CustomerReferenceType' => 'INVOICE_NUMBER', 'Value' => 'INV4567892'), '2' => array('CustomerReferenceType' => 'P_O_NUMBER', 'Value' => 'PO4567892')), 'SpecialServicesRequested' => array('SpecialServiceTypes' => array('COD'), 'CodDetail' => array('CodCollectionAmount' => array('Currency' => 'USD', 'Amount' => 150), 'CollectionType' => 'ANY')// ANY, GUARANTEED_FUNDS ) ); packageLineItem // array ( ' $request['WebAuthenticationDetail'] = array('UserCredential' =>array('Key' => $auth['key'], 'Password' => $auth['password'])); $request['ClientDetail'] = array('AccountNumber' => $auth['accountNumber'], 'MeterNumber' => $auth['meterNumber']); $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Ground Domestic Shipping Request v12 using PHP ***'); $request['Version'] = array('ServiceId' => 'ship', 'Major' => '12', 'Intermediate' => '1', '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' => 'FEDEX_GROUND', // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ... 'PackagingType' => 'YOUR_PACKAGING', // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ... 'Shipper' => $this->addShipper(), 'Recipient' => $this->recipient, 'ShippingChargesPayment' => $this->addShippingChargesPayment(), 'LabelSpecification' => $this->addLabelSpecification(), 'RateRequestTypes' => array('LIST'), // valid values ACCOUNT and LIST 'PackageCount' => count($this->packages), 'TotalWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'PackageDetail' => 'INDIVIDUAL_PACKAGES', 'RequestedPackageLineItems' => $this->packageLineItem//array('0' => $this->packageLineItem) ); $this->packageLineItem[] = array('SequenceNumber'=>$i, 'GroupPackageCount' => count($this->packages), 'MasterTrackingID' => '123123123123', 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'Weight' => array('Value' => $this->packages[$i-1], //weight!!!!!!!!!!!!! 'Units' => 'LB'), 'CustomerReferences' => array('0' => array('CustomerReferenceType' => 'CUSTOMER_REFERENCE', 'Value' => 'GR4567892'), // valid values CUSTOMER_REFERENCE, INVOICE_NUMBER, P_O_NUMBER and SHIPMENT_INTEGRITY '1' => array('CustomerReferenceType' => 'INVOICE_NUMBER', 'Value' => 'INV4567892'), '2' => array('CustomerReferenceType' => 'P_O_NUMBER', 'Value' => 'PO4567892')), 'SpecialServicesRequested' => array('SpecialServiceTypes' => array('COD'), 'CodDetail' => array('CodCollectionAmount' => array('Currency' => 'USD', 'Amount' => 150), 'CollectionType' => 'ANY')// ANY, GUARANTEED_FUNDS ) ); Value' => array_sum ($ this-> packages), 'Units' => 'LB'), $request['WebAuthenticationDetail'] = array('UserCredential' =>array('Key' => $auth['key'], 'Password' => $auth['password'])); $request['ClientDetail'] = array('AccountNumber' => $auth['accountNumber'], 'MeterNumber' => $auth['meterNumber']); $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Ground Domestic Shipping Request v12 using PHP ***'); $request['Version'] = array('ServiceId' => 'ship', 'Major' => '12', 'Intermediate' => '1', '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' => 'FEDEX_GROUND', // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ... 'PackagingType' => 'YOUR_PACKAGING', // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ... 'Shipper' => $this->addShipper(), 'Recipient' => $this->recipient, 'ShippingChargesPayment' => $this->addShippingChargesPayment(), 'LabelSpecification' => $this->addLabelSpecification(), 'RateRequestTypes' => array('LIST'), // valid values ACCOUNT and LIST 'PackageCount' => count($this->packages), 'TotalWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'PackageDetail' => 'INDIVIDUAL_PACKAGES', 'RequestedPackageLineItems' => $this->packageLineItem//array('0' => $this->packageLineItem) ); $this->packageLineItem[] = array('SequenceNumber'=>$i, 'GroupPackageCount' => count($this->packages), 'MasterTrackingID' => '123123123123', 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'Weight' => array('Value' => $this->packages[$i-1], //weight!!!!!!!!!!!!! 'Units' => 'LB'), 'CustomerReferences' => array('0' => array('CustomerReferenceType' => 'CUSTOMER_REFERENCE', 'Value' => 'GR4567892'), // valid values CUSTOMER_REFERENCE, INVOICE_NUMBER, P_O_NUMBER and SHIPMENT_INTEGRITY '1' => array('CustomerReferenceType' => 'INVOICE_NUMBER', 'Value' => 'INV4567892'), '2' => array('CustomerReferenceType' => 'P_O_NUMBER', 'Value' => 'PO4567892')), 'SpecialServicesRequested' => array('SpecialServiceTypes' => array('COD'), 'CodDetail' => array('CodCollectionAmount' => array('Currency' => 'USD', 'Amount' => 150), 'CollectionType' => 'ANY')// ANY, GUARANTEED_FUNDS ) ); => 'CUSTOMER_REFERENCE', $request['WebAuthenticationDetail'] = array('UserCredential' =>array('Key' => $auth['key'], 'Password' => $auth['password'])); $request['ClientDetail'] = array('AccountNumber' => $auth['accountNumber'], 'MeterNumber' => $auth['meterNumber']); $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Ground Domestic Shipping Request v12 using PHP ***'); $request['Version'] = array('ServiceId' => 'ship', 'Major' => '12', 'Intermediate' => '1', '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' => 'FEDEX_GROUND', // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ... 'PackagingType' => 'YOUR_PACKAGING', // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ... 'Shipper' => $this->addShipper(), 'Recipient' => $this->recipient, 'ShippingChargesPayment' => $this->addShippingChargesPayment(), 'LabelSpecification' => $this->addLabelSpecification(), 'RateRequestTypes' => array('LIST'), // valid values ACCOUNT and LIST 'PackageCount' => count($this->packages), 'TotalWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'PackageDetail' => 'INDIVIDUAL_PACKAGES', 'RequestedPackageLineItems' => $this->packageLineItem//array('0' => $this->packageLineItem) ); $this->packageLineItem[] = array('SequenceNumber'=>$i, 'GroupPackageCount' => count($this->packages), 'MasterTrackingID' => '123123123123', 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'Weight' => array('Value' => $this->packages[$i-1], //weight!!!!!!!!!!!!! 'Units' => 'LB'), 'CustomerReferences' => array('0' => array('CustomerReferenceType' => 'CUSTOMER_REFERENCE', 'Value' => 'GR4567892'), // valid values CUSTOMER_REFERENCE, INVOICE_NUMBER, P_O_NUMBER and SHIPMENT_INTEGRITY '1' => array('CustomerReferenceType' => 'INVOICE_NUMBER', 'Value' => 'INV4567892'), '2' => array('CustomerReferenceType' => 'P_O_NUMBER', 'Value' => 'PO4567892')), 'SpecialServicesRequested' => array('SpecialServiceTypes' => array('COD'), 'CodDetail' => array('CodCollectionAmount' => array('Currency' => 'USD', 'Amount' => 150), 'CollectionType' => 'ANY')// ANY, GUARANTEED_FUNDS ) ); => 'INVOICE_NUMBER', $request['WebAuthenticationDetail'] = array('UserCredential' =>array('Key' => $auth['key'], 'Password' => $auth['password'])); $request['ClientDetail'] = array('AccountNumber' => $auth['accountNumber'], 'MeterNumber' => $auth['meterNumber']); $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Ground Domestic Shipping Request v12 using PHP ***'); $request['Version'] = array('ServiceId' => 'ship', 'Major' => '12', 'Intermediate' => '1', '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' => 'FEDEX_GROUND', // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ... 'PackagingType' => 'YOUR_PACKAGING', // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ... 'Shipper' => $this->addShipper(), 'Recipient' => $this->recipient, 'ShippingChargesPayment' => $this->addShippingChargesPayment(), 'LabelSpecification' => $this->addLabelSpecification(), 'RateRequestTypes' => array('LIST'), // valid values ACCOUNT and LIST 'PackageCount' => count($this->packages), 'TotalWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'PackageDetail' => 'INDIVIDUAL_PACKAGES', 'RequestedPackageLineItems' => $this->packageLineItem//array('0' => $this->packageLineItem) ); $this->packageLineItem[] = array('SequenceNumber'=>$i, 'GroupPackageCount' => count($this->packages), 'MasterTrackingID' => '123123123123', 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'Weight' => array('Value' => $this->packages[$i-1], //weight!!!!!!!!!!!!! 'Units' => 'LB'), 'CustomerReferences' => array('0' => array('CustomerReferenceType' => 'CUSTOMER_REFERENCE', 'Value' => 'GR4567892'), // valid values CUSTOMER_REFERENCE, INVOICE_NUMBER, P_O_NUMBER and SHIPMENT_INTEGRITY '1' => array('CustomerReferenceType' => 'INVOICE_NUMBER', 'Value' => 'INV4567892'), '2' => array('CustomerReferenceType' => 'P_O_NUMBER', 'Value' => 'PO4567892')), 'SpecialServicesRequested' => array('SpecialServiceTypes' => array('COD'), 'CodDetail' => array('CodCollectionAmount' => array('Currency' => 'USD', 'Amount' => 150), 'CollectionType' => 'ANY')// ANY, GUARANTEED_FUNDS ) ); CodCollectionAmount' => array ( 'Currency' => 'USD', 'Amount' => $request['WebAuthenticationDetail'] = array('UserCredential' =>array('Key' => $auth['key'], 'Password' => $auth['password'])); $request['ClientDetail'] = array('AccountNumber' => $auth['accountNumber'], 'MeterNumber' => $auth['meterNumber']); $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Ground Domestic Shipping Request v12 using PHP ***'); $request['Version'] = array('ServiceId' => 'ship', 'Major' => '12', 'Intermediate' => '1', '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' => 'FEDEX_GROUND', // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ... 'PackagingType' => 'YOUR_PACKAGING', // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ... 'Shipper' => $this->addShipper(), 'Recipient' => $this->recipient, 'ShippingChargesPayment' => $this->addShippingChargesPayment(), 'LabelSpecification' => $this->addLabelSpecification(), 'RateRequestTypes' => array('LIST'), // valid values ACCOUNT and LIST 'PackageCount' => count($this->packages), 'TotalWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'PackageDetail' => 'INDIVIDUAL_PACKAGES', 'RequestedPackageLineItems' => $this->packageLineItem//array('0' => $this->packageLineItem) ); $this->packageLineItem[] = array('SequenceNumber'=>$i, 'GroupPackageCount' => count($this->packages), 'MasterTrackingID' => '123123123123', 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'Weight' => array('Value' => $this->packages[$i-1], //weight!!!!!!!!!!!!! 'Units' => 'LB'), 'CustomerReferences' => array('0' => array('CustomerReferenceType' => 'CUSTOMER_REFERENCE', 'Value' => 'GR4567892'), // valid values CUSTOMER_REFERENCE, INVOICE_NUMBER, P_O_NUMBER and SHIPMENT_INTEGRITY '1' => array('CustomerReferenceType' => 'INVOICE_NUMBER', 'Value' => 'INV4567892'), '2' => array('CustomerReferenceType' => 'P_O_NUMBER', 'Value' => 'PO4567892')), 'SpecialServicesRequested' => array('SpecialServiceTypes' => array('COD'), 'CodDetail' => array('CodCollectionAmount' => array('Currency' => 'USD', 'Amount' => 150), 'CollectionType' => 'ANY')// ANY, GUARANTEED_FUNDS ) ); ) // ANY, GUARANTEED_FUNDS $request['WebAuthenticationDetail'] = array('UserCredential' =>array('Key' => $auth['key'], 'Password' => $auth['password'])); $request['ClientDetail'] = array('AccountNumber' => $auth['accountNumber'], 'MeterNumber' => $auth['meterNumber']); $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Ground Domestic Shipping Request v12 using PHP ***'); $request['Version'] = array('ServiceId' => 'ship', 'Major' => '12', 'Intermediate' => '1', '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' => 'FEDEX_GROUND', // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ... 'PackagingType' => 'YOUR_PACKAGING', // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ... 'Shipper' => $this->addShipper(), 'Recipient' => $this->recipient, 'ShippingChargesPayment' => $this->addShippingChargesPayment(), 'LabelSpecification' => $this->addLabelSpecification(), 'RateRequestTypes' => array('LIST'), // valid values ACCOUNT and LIST 'PackageCount' => count($this->packages), 'TotalWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'PackageDetail' => 'INDIVIDUAL_PACKAGES', 'RequestedPackageLineItems' => $this->packageLineItem//array('0' => $this->packageLineItem) ); $this->packageLineItem[] = array('SequenceNumber'=>$i, 'GroupPackageCount' => count($this->packages), 'MasterTrackingID' => '123123123123', 'TotalShipmentWeight' => array('Value' => array_sum($this->packages), 'Units' => 'LB'), 'Weight' => array('Value' => $this->packages[$i-1], //weight!!!!!!!!!!!!! 'Units' => 'LB'), 'CustomerReferences' => array('0' => array('CustomerReferenceType' => 'CUSTOMER_REFERENCE', 'Value' => 'GR4567892'), // valid values CUSTOMER_REFERENCE, INVOICE_NUMBER, P_O_NUMBER and SHIPMENT_INTEGRITY '1' => array('CustomerReferenceType' => 'INVOICE_NUMBER', 'Value' => 'INV4567892'), '2' => array('CustomerReferenceType' => 'P_O_NUMBER', 'Value' => 'PO4567892')), 'SpecialServicesRequested' => array('SpecialServiceTypes' => array('COD'), 'CodDetail' => array('CodCollectionAmount' => array('Currency' => 'USD', 'Amount' => 150), 'CollectionType' => 'ANY')// ANY, GUARANTEED_FUNDS ) ); 

Does anyone know how to be a valid request?

+4
source share
2 answers

There is a difference between the API-interface FedEx Rate and API delivery FedEx. You can evaluate multiple packages using a single SOAP request; however, to send Multiple Pieces Shipment (MPS), you need to make a request to send to each of the packets.

The first package (the package in the first query) will be your Master, containing the basic tracking number. Once you have this wizard control number, you must attach it to the request to send the remaining packages. Please refer to the latest FedEx Developer's Guide for more information on the supply and load MPS example of the domestic express delivery with FedEx MPS developer portal.

Something to keep in mind is that the delivery process does not happen as a transaction, so if you try to send 3 packets and packets 1 and 2 are sent successfully, but packet 3 does not work for such an unknown reason, you carry It is the responsibility to cancel package 1 and 2 or resend package 3. I would recommend everyone check the delivery (using the same delivery API) before creating the actual dispatch.

Best!

+10
source

In FeDex manual there is an error: "MasterTrackingID" is incorrect. "MasterTrackingId" is right.

0
source

All Articles