Creating a Letter Shipment

Example:

<?php
$s = new \RocketShipIt\Shipment('STAMPS');
$s->setParameter('toName', 'CPT JOHN DOE');
$s->setParameter('toAddr1', 'UNIT 2050 BOX 4190');
$s->setParameter('toCity', 'San Francisco');
$s->setParameter('toState', 'CA');
$s->setParameter('toCode', '94115');
// Thermal labels are not supported for letters
$s->setParameter('imageType', 'Png');

$rate = new \RocketShipIt\Rate('STAMPS');
// printLayout is required, see below
$rate->setParameter('printLayout', 'Envelope9');
$rate->setParameter('service', 'US-FC');
$rate->setParameter('packagingType', 'Letter');
$rate->setParameter('toCode', '94115');
$rate->setParameter('weightOunces', '1');
$package = $rate->getRate();

// Add the addons you want for this shipment
$addons = array();
$a = new \stdClass();
$package->AddOns = $addons;

$s->addPackageToShipment($package);

$response = $s->submitShipment();

printLayout

  • Envelope9 - Envelope #9 (3 7/8 x 8 7/8”)
  • Envelope10 - Envelope #10 (4 1/8 x 9 1/2”)
  • Envelope11 - Envelope #11 (4 1/2 x 10 3/8”)
  • Envelope12 - Envelope #12(4 3/4 x 11”)
  • EnvelopePersonal - Envelope Personal (3 5/8 x 6 1/2”)
  • EnvelopeMonarch - Envelope Monarch (3 7/8 x 7 1/2”)
  • EnvelopeInvitation - Envelope NCR Invitation (5 3/4 x 4 3/8”)
  • EnvelopeGreeting - Envelope NCR Greeting (8 3/4 x 5 3/4”)