GetPackageLabel Method
Generates a shipping label for the specified package.
Syntax
[VB.NET] Public Sub GetPackageLabel(ByVal PackageIndex As Integer)
[C#] public void GetPackageLabel(int packageIndex);
Remarks
When this method is called, the following properties must have been set:
- CanadaPostAccount (required)
- GroupId (required if ContractId is set)
- Packages (required)
- PaymentMethod (required if ContractId is set)
- RecipientContact (required)
- RecipientAddress (required)
- SenderContact (required)
- SenderAddress (required)
- ServiceType (required)
- ShipmentSpecialServices (optional)
To print out the ShippingLabel, you can save it to the ShippingLabelFile file in LabelImageType format.
In order to print a label and manifest to be tendered to a Canada Post driver, you must:
- Assign each shipment a GroupId and then call GetPackageLabel for each package in the shipment.
- Call TransmitShipments with the GroupId for the shipment.
- Call GetManifest for each manifest in ManifestDetails.
Note that this only applies when submitting a contract shipment (ie. ContractId is set).
NOTE: This method has a corresponding asynchronous version (GetPackageLabelAsync) for use in the Xamarin environment.