GetPackageLabel Method
Generates a shipping label for the first package in the shipment.
Syntax
[VB.NET] Public Sub GetPackageLabel()
[C#] public void GetPackageLabel();
Remarks
When this method is called, the following properties are used to construct the request: properties:
- UserId (required for API authentication)
- FirstName (required unless Company is provided)
- MiddleInitial (optional)
- LastName (required unless Company is provided)
- Company (optional if FirstName and LastName are provided)
- Phone (required)
- Address1 (optional)
- Address2 (required)
- City (required)
- State (required)
- ZipCode (required)
- FirstName (you must send either a name or Company (or both))
- LastName (you must send either a name or Company (or both))
- Company (optional if name is provided)
- Address1 (at least one address line is required)
- Address2
- RecipientAddress3
- City (required)
- State (Province, optional)
- CountryCode (required)
- ZipCode (Postal Code, optional)
- Phone (optional)
- Fax (optional)
- Email (optional)
- NonDeliveryOption (if this is set to "REDIRECT" provide the return address via Config)
- Description (required)
- Quantity (required)
- Manufacturer (optional)
- Value (required)
- HarmonizedCode (optional)
- Weight (required)
- NetCharge (optional - if left blank the server will return the postage cost here)
- Weight (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)
- ShippingLabelFile (optional if you wish to save the labels to disk)
- CertificateNumber (optional)
- InvoiceNumber (optional)
- LicenseNumber (optional)
This method fills the following properties:
- NetCharge
- TrackingNumber
- TotalValue
- SDRValue
- IndemnityCoverage (Priority Mail only)
- Prohibitions
- Observations
- Restrictions
- Regulations
- Notes
- ShippingLabel
If ShippingLabelFile was specified with a path and filename, all of the returned label images will also be saved to disk.
NOTE: This method has a corresponding asynchronous version (GetPackageLabelAsync) for use in the Xamarin environment.