Scheduling a Pickup

UPS

Get Pickup Rate

Example:

<?php
$pickup = new \RocketShipIt\Pickup('UPS');

$pickup->setParameter("pickupAddr1", '235 E Garvey Ave');
$pickup->setParameter("pickupCity", 'Monterey Park');
$pickup->setParameter("pickupState", 'CA');
$pickup->setParameter("pickupCode", '91755');
$pickup->setParameter("pickupCountry", 'US');

$pickup->setParameter("closeTime", '0800');
$pickup->setParameter("readyTime", '0900');
$pickup->setParameter("pickupDate", '20110612');

$response = $pickup->getPickupRate();

Create Pickup

Example:

<?php
$pickup = new \RocketShipIt\Pickup('UPS');

$pickup->setParameter('pickupCompanyName', 'RocketShip');
$pickup->setParameter('pickupContactName', 'Mark Sanborn');
$pickup->setParameter('pickupAddr1', '235 E Garvey Ave');
$pickup->setParameter('pickupCity', 'Monterey Park');
$pickup->setParameter('pickupState', 'CA');
$pickup->setParameter('pickupCode', '91755');
$pickup->setParameter('pickupCountry', 'US');
$pickup->setParameter('pickupPhone', '(626) 288-8613');

$pickup->setParameter('pickupServiceCode', '002');
$pickup->setParameter('pickupQuantity', '2');
$pickup->setParameter('pickupDestination', 'US');
$pickup->setParameter('pickupContainerCode', '01');

$pickup->setParameter('pickupAlternative', 'N');
$pickup->setParameter('pickupOverweight', 'N');

$paymentCode = '00';
$pickup->setParameter('paymentMethodCode', $paymentCode);

// Example using cc as payment method
if ($paymentCode == '03') {
    $pickup->setParameter('pickupCardHolder', 'Mark Eteson');
    $pickup->setParameter('pickupCardType', '06');
    $pickup->setParameter('pickupCardNumber', '4111111111111111');
    $pickup->setParameter('pickupCardExpiry', '201204');
    $pickup->setParameter('pickupCardSecurity', '123');
    $pickup->setParameter('pickupCardAddress', '235 E Garvey Ave,  Monterey Park CA');
    $pickup->setParameter('pickupCardCountry', 'US');
}

$pickup->setParameter("readyTime", '0800');
$pickup->setParameter("closeTime", '0900');
$pickup->setParameter("pickupDate", '20110612');

$response = $pickup->createPickupRequest();

Get Pickup Status

Example:

<?php
$pickup = new \RocketShipIt\Pickup('UPS');
$response = $pickup->requestPendingStatus();

Cancel Pickup

Example:

<?php
$pickup = new \RocketShipIt\Pickup('UPS');
$pickup->setParameter('pickupPRN', '2929AONCALL');
$response = $pickup->cancelPickupRequest();

Parameters

  • pickupCompanyName
  • pickupContactName
  • pickupAddr1
  • pickupCity
  • pickupState
  • pickupCode
  • pickupCountry
  • pickupPhone
  • pickupResidential - Indicates pickup address is residential, leave blank if commercial
  • pickupAlternative - If present, will indicate alternative address than what is associated with shipper account.
  • closeTime - HHmm 0-23, 0-59
  • readyTime - HHmm 0-23, 0-59
  • pickupDate - yyyyMMdd
  • accountNumber - Your carrier account number
  • pickupContainerCode - 01 - Package, 02 - UPS LETTER
  • pickupDestination
  • pickupQuantity - Number of packages
  • pickupCardExpiry - yyyyMM
  • pickupCardNumber - CC Number
  • pickupCardHolder - Name of card holder
  • pickupCardSecurity - 3-4 digit security code on back of card
  • pickupCardAddress - Address associated with CC
  • pickupCardCountry - Country of CC
  • pickupPRN - Pickup Request Number used for canceling pickups

pickupServiceCode

  • 001 - UPS Next Day Air
  • 002 - UPS Next Day Air
  • 003 - UPS Ground
  • 004 - UPS Ground, UPS Standard
  • 007 - UPS Worldwide Express
  • 008 - UPS Worldwide Expedited
  • 011 - UPS Standard
  • 012 - UPS Three Day Select
  • 013 - UPS Next Day Air Saver
  • 014 - UPS Next Day Air Early A.M.
  • 021 - UPS Economy
  • 031 - UPS Basic
  • 054 - UPS Worldwide Express Plus
  • 059 - UPS Second Day Air A.M.
  • 064 - UPS Express NA1
  • 065 - UPS Saver
  • 082 - UPS Today Standard
  • 083 - UPS Today Dedicated Courier
  • 084 - UPS Today Intercity
  • 085 - UPS Today Express
  • 086 - UPS Today Express Saver

paymentMethodCode

  • 00 = No payment needed
  • 01 = Pay by shipper account
  • 02 = Pay by return service
  • 03 = Pay by charge card
  • 04 = Pay by tracking number

pickupCardType

  • 01 = American Express
  • 03 = Discover
  • 04 = Mastercard
  • 06 = VISA

FedEx

Create Pickup

Example:

<?php
$pickup = new \RocketShipIt\Pickup('fedex');
$pickup->setParameter('pickupName', 'Mark Sanborn');
$pickup->setParameter('pickupCompany', 'RocketShipIt');
$pickup->setParameter('pickupPhone', '7077262676');
$pickup->setParameter('pickupAddr1', '76 Sycamore St');
$pickup->setParameter('pickupCity', 'San Francisco');
$pickup->setParameter('pickupState', 'CA');
$pickup->setParameter('pickupCode', '94110');
$pickup->setParameter('pickupCountry', 'US');
$pickup->setParameter('pickupResidential', 'true');
$pickup->setParameter('packageCount', '1');
//$pickup->setParameter('pickupPackageLocation', 'REAR');
$pickup->setParameter('readyTime', date('c', strtotime('+12 hours')));
$pickup->setParameter('closeTime', '23:00:00');

$response = $pickup->createPickupRequest();

pickupPackageLocation

  • FRONT
  • NONE
  • REAR
  • SIDE

DHL

Create Pickup

Example:

<?php
$pickup = new \RocketShipIt\Pickup('dhl');
$pickup->setParameter('pickupName', 'Mark Sanborn');
$pickup->setParameter('pickupCompany', 'RocketShipIt');
$pickup->setParameter('pickupPhone', '7077262676');
$pickup->setParameter('pickupAddr1', '76 Sycamore St');
$pickup->setParameter('pickupAddr2', 'Apt 2');
$pickup->setParameter('pickupCity', 'San Francisco');
$pickup->setParameter('pickupState', 'CA');
$pickup->setParameter('pickupCode', '94110');
$pickup->setParameter('pickupCountry', 'US');
$pickup->setParameter('pickupResidential', 'true');
$pickup->setParameter('packageCount', '1');
$pickup->setParameter('pickupPackageLocation', 'REAR');
$pickup->setParameter('readyDate', date("Y-m-d", strtotime('+3 hours')));
$pickup->setParameter('readyTime', date("H:i", strtotime('+3 hours')));
$pickup->setParameter('closeTime', '23:00');
$pickup->setParameter('numberOfPieces', '2');

$response = $pickup->createPickupRequest();

Cancel Pickup

Example:

<?php
$pickup = new \RocketShipIt\Pickup('dhl');
$pickup->setParameter('confirmationNumber', '743511');
$pickup->setParameter('originSvcArea', '406');
$response = $pickup->cancelPickupRequest();

Stamps.com

Example:

<?php
$pickup = new \RocketShipIt\Pickup('stamps');

$pickup->setParameter('pickupContactName', 'Mark Sanborn');
$pickup->setParameter('pickupAddr1', '123 Main St');
$pickup->setParameter('pickupCity', 'Monterey Park');
$pickup->setParameter('pickupState', 'CA');
$pickup->setParameter('pickupCode', '91755');
$pickup->setParameter('pickupPhone', '7077262676');
$pickup->setParameter('pickupTotalWeight', '20');
$pickup->setParameter('pickupLocation', 'FrontDoor');
$pickup->setParameter('numberOfPriorityMailPieces', '1');

$response = $pickup->createPickupRequest();

Parameters

  • pickupContactName
  • pickupCompany
  • pickupAddr1
  • pickupApt
  • pickupCity
  • pickupState
  • pickupCode
  • pickupCodeExtended
  • pickupPhone
  • pickupPhoneExt
  • numberOfExpressMailPieces
  • numberOfPriorityMailPieces
  • numberOfInternationalPieces
  • numberOfOtherPieces
  • pickupTotalWeight
  • pickupLocation
  • specialInstruction

pickupLocation

  • FrontDoor - Packages are at front door.
  • BackDoor - Packages are at back door.
  • SideDoor - Packages are at side door.
  • KnockOnDoorOrRingBell - Carrier needs to knock on door or ring bell to get the packages.
  • MailRoom - Packages are in mail room.
  • Office - Packages are in office.
  • Reception - Packages are at reception area.
  • InOrAtMailbox - Packages are in mail box.
  • Other - Packages are at the location other than above places. SpecialInstruction must be provided.