Ups Mail Innovations¶
Domestic¶
Label Example:
<?php
// Note: Your UPS account must have Mail Innovations access
$shipment = new \RocketShipIt\Shipment('UPS');
$shipment->setParameter('shipCompany', 'RocketShipIt');
$shipment->setParameter('shipAddr1', '1 Zoo Road');
$shipment->setParameter('shipCity', 'San Francisco');
$shipment->setParameter('shipState', 'CA');
$shipment->setParameter('shipCode', '94132');
$shipment->setParameter('toCompany', 'John Doe');
$shipment->setParameter('toPhone', '1231231234');
$shipment->setParameter('toAddr1', '1 Zoo Road');
$shipment->setParameter('toAddr2', 'Building A');
$shipment->setParameter('toCity', 'San Francisco');
$shipment->setParameter('toState', 'CA');
$shipment->setParameter('toCode', '94132');
// USPS Endorsements
// 1 = Return Service Requested
// 2 = Forwarding Service Requested 3 = Address Service Requested
// 4 = Change Service Requested
// 5 = No Service Selected
$shipment->setParameter('uspsEndorsement', '1');
// USPS Specific Service Types
// M2 = First Class Mail - Domestic (use 59 - First Class packagingType)
// M3 = Priority Mail - Domestic (use 60 - Priority packagingType)
// M4 = Expedited Mail Innovations - Domestic
// M5 = Priority Mail Innovations - International
// M6 = Economy Mail Innovations - International
$shipment->setParameter('service', 'M4');
// Customer assigned alpha numeric identifier for report and billing
// summarization -- displays to the right of the Cost Center title.
$shipment->setParameter('costCenter', '00000');
// Customer-assigned alpha numeric unique piece identifier that
// returns visibility events
$shipment->setParameter('packageId', '1');
$package = new \RocketShipIt\Package('UPS');
$package->setParameter('weight','5');
$package->setParameter('weightUnit', 'OZS'); // Specific to service
// 59 = First Class
// 60 = Priority
// 61 = Machinables - 6 - 15.99oz
// 62 = Irregulars - 1 - 15.99oz
// 63 = Parcel Post - 1 - XXlbs
// 64 = BPM Parcel - 1 - 15lb
// 65 = Media Mail - 1 - XXlbs
// 66 = BMP Flat - < 1lb
// 67 = Standard Flat - 1 - 15.99oz
$package->setParameter('packagingType', '62'); // Irregular 1 - 15.9 oz
$shipment->addPackageToShipment($package);
$response = $shipment->submitShipment();
print_r($response);
Delivery Confirmation¶
In order to track Mail Innovation shipments you need to specify the signature option to 4 during shipment creation:
<?php
$package->setParameter('signatureType', '4');
Note
For Mail Innovations forward shipments, USPS Delivery Confirmation is allowed for Priority, First Class, Machineables, Irregulars, Parcel Post, BPM Parcel, and Media Mail package types.
Note
USPS Delivery Confirmation is prohibited for Standard Flats, BPM, BPM Flats, and Parcels package types.
International¶
Label Example with CN22 Form:
<?php
// Note: Your UPS account must have Mail Innovations access
$shipment = new \RocketShipIt\Shipment('UPS');
$shipment->setParameter('toCompany', 'RocketShipIt');
$shipment->setParameter('toAttentionName', 'John Doe');
$shipment->setParameter('toPhone', '1231231234');
$shipment->setParameter('toAddr1', '3/92 Rialto Street');
$shipment->setParameter('toAddr2', 'Queensland');
$shipment->setParameter('toCity', 'Greenslopes');
$shipment->setParameter('toCode', '4120');
$shipment->setParameter('toCountry', 'AU');
$shipment->setParameter('service', 'M5');
$shipment->setParameter('uspsEndorsement', '5');
$shipment->setParameter('costCenter', 'Shipping');
$shipment->setParameter('packageId', '100203049');
$shipment->setParameter('weightUnit', 'OZS');
$shipment->setParameter('soldCompany', 'RocketShipIt');
$shipment->setParameter('soldName', 'Mark Sanborn');
$shipment->setParameter('soldTaxId', '803070713RT0001');
$shipment->setParameter('soldPhone', '7077262676');
$shipment->setParameter('soldAddr1', '60 Healey Road');
$shipment->setParameter('soldAddr2', 'Unit 2');
$shipment->setParameter('soldCity', 'Bolton');
$shipment->setParameter('soldState', 'ON');
$shipment->setParameter('soldCode', 'L7E5A5');
$shipment->setParameter('soldCountry', 'CA');
$shipment->setParameter('customsForms', '09');
// You can also specify PDF or GIF
$shipment->setParameter('cn22LabelPrintType', 'zpl');
$shipment->setParameter('labelPrintMethodCode', 'zpl');
$package = new \RocketShipIt\Package('UPS');
$package->setParameter('packagingType','56');
$package->setParameter('weightUnit', 'LBS');
$package->setParameter('weight','2');
$shipment->addPackageToShipment($package);
// You can specify up to three of these content lines
$content = new \RocketShipIt\Cn22Content('UPS');
$content->setParameter('cn22ContentQty', '9');
$content->setParameter('cn22ContentDescription', '3 x New Garcinia Cambogia');
$content->setParameter('cn22ContentWeightUnit', 'OZS');
$content->setParameter('cn22ContentWeight', '0.3');
$content->setParameter('cn22ContentTotalValue', '21.00');
$content->setParameter('cn22ContentCurrencyCode', 'USD');
$content->setParameter('cn22ContentCountryOfOrigin', 'US');
$shipment->addCn22ContentToShipment($content);
$customs = new \RocketShipIt\Customs('ups');
$customs->setParameter('invoiceLineNumber', '1');
$customs->setParameter('invoiceLinePartNumber', '123');
$customs->setParameter('invoiceLineDescription', '3 x New Garcinia Cambogia');
$customs->setParameter('invoiceLineValue', '19.00');
$customs->setParameter('weightUnit', 'OZS');
$customs->setParameter('unitCode', 'EA');
$customs->setParameter('invoiceLineOriginCountryCode', 'US');
$shipment->addCustomsLineToShipment($customs);
$response = $shipment->submitShipment();