GetPackageLabel Method
Generates a shipping label for the first package in the shipment.
Object Oriented Interface
public function doGetPackageLabel();
Procedural Interface
inship_uspsshipintl_do_getpackagelabel($res);
Remarks
When this method is called, the following properties are used to construct the request: properties:
- USPSUserId (required for API authentication)
- SenderFirstName (required unless SenderCompany is provided)
- SenderMiddleInitial (optional)
- SenderLastName (required unless SenderCompany is provided)
- SenderCompany (optional if SenderFirstName and SenderLastName are provided)
- SenderPhone (required)
- SenderAddress1 (optional)
- SenderAddress2 (required)
- SenderCity (required)
- SenderState (required)
- SenderZipCode (required)
- RecipientFirstName (you must send either a name or RecipientCompany (or both))
- RecipientLastName (you must send either a name or RecipientCompany (or both))
- RecipientCompany (optional if name is provided)
- RecipientAddress1 (at least one address line is required)
- RecipientAddress2
- RecipientAddress3
- RecipientCity (required)
- RecipientState (Province, optional)
- RecipientCountryCode (required)
- RecipientZipCode (Postal Code, optional)
- RecipientPhone (optional)
- RecipientFax (optional)
- RecipientEmail (optional)
- NonDeliveryOption (if this is set to "REDIRECT" provide the return address via Config)
- CommodityDescription (required)
- CommodityQuantity (required)
- CommodityManufacturer (optional)
- CommodityValue (required)
- CommodityHarmonizedCode (optional)
- CommodityWeight (required)
- PackageNetCharge (optional - if left blank the server will return the postage cost here)
- PackageWeight (required)
- Contents (required - if set to ctOther OtherContents must be set)
- Comments (optional)
- ShipDate (optional. If specified must be within 3 days)
- MailingLocation (optional)
- CustomerId (optional)
- LabelImageType (required)
- ImageLayout (required)
- PackageShippingLabelFile (optional if you wish to save the labels to disk)
- CertificateNumber (optional)
- InvoiceNumber (optional)
- LicenseNumber (optional)
This method fills the following properties:
- PackageNetCharge
- PackageTrackingNumber
- TotalValue
- SDRValue
- IndemnityCoverage (Priority Mail only)
- Prohibitions
- Observations
- Restrictions
- Regulations
- Notes
- PackageShippingLabel
If PackageShippingLabelFile was specified with a path and filename, all of the returned label images will also be saved to disk.