Integration»Adding Complex Features

Adding Complex Features

Adding Complex Features

While the basic script example provides a simple overview of creating and shipping records, it is likely that you may need to create complex shipments which include third-party/recipient billing and/or international shipping. By adding additional logic to your scripting you can easily add support for complex shipments.

Third Party/Bill Recipient/Consignee
Often the recipient will want to bill shipping on an alternate account. In order to facilitate this type of shipping, set the following fields in the ShipManager table:

PaymentMethod [Sender|Receiver|Third Party|Consignee]
ThirdPartyAccount
ThirdPartyAccountZip
ThirdPartyAccountCountryCode

Multiple Shipments
If your orders require multiple shipments (Backorders or different delivery date requests) you will want to create an interim "join" table between your table and the NRG tables.
Simply create a new record in the join table and then create your related record in ShipManager based on this ID instead of the primary key in your invoice table.
Thru a portal of the MultiShip table you could easily display each shipment's master tracking number along with associated costs.

Multiple Packages
If you want to automatically create multiple packages from your orders or invoice without using the ShipConnect UI, you would need to mirror the Packages table in your database. You would first create the related ShipManager record, grab the _pk_ShipManagerID of the record, and then loop thru the package records and create related records for each, making sure to set the _fk_ShipManagerID value in ShipManager_Packages with the _pk_ShipManagerID.

Displaying Ship Rates
Create a relationship like the Single Shipment sample above, and then expose the ShipManager_Rates portal in your solution. After you create the related record in the ShipManager table, you can then call the External - Get Rates script to populate values.

See the ShipConnect integration sample for more detail.


Return Shipments
In order to create a return label you can create a related record as you would for any other shipment, but then you would set the value for Ship::ReturnLabel.n to 1 and be sure to include a return description in Ship::ReturnLabel_Desc.t. If you want to print this label out to PDF for emailing, then also set Output_ToPdf.n to value of 1. After you call External - Ship, the field Packages::LabelContainer.r will contain a PNG image which you can put onto your own layout for use in a Print to PDF script.

Future Ship Date
If you will be creating a label today for a shipment that will be picked up in the future, you can set the field LabelDate in the ShipManager table to a future date.

Drop Shipments
You may want to create shipments that have an address displayed on the label that is different from the actual sending location. In order to facilitate these shipments, you will need to set values in these fields in the ShipManager table:

ShipFrom_Name
ShipFrom_AttentionName
ShipFrom_AddressLine1
ShipFrom_AddressLine2
ShipFrom_AddressLine3
ShipFrom_City
ShipFrom_StateProvinceCode
ShipFrom_PostalCode
ShipFrom_Country
ShipFrom_PhoneNumber

NOTE: Some international shipments MUST display the actual origin address. ShipManager will utilize the proper addresses as needed for carrier compliance.

Packing Lists
ShipManager provides the ability to create integrated packing lists where the shipping label and packing list are printed on a single page of laser output. In order to populate the line items, you will need to create a relationship from ShipManager to ShipManager_Items based on ShipManager::_pk_ShipManagerID.n to ShipManager_Items::_fk_ShipManagerID.n. In the ShipManger_Items table, you will want to populate the following fields:

Quantity
QuantityUnits [Ea|Pcs]
UnitPrice
PartNumber
Description
CountryOfManufacture [required for Intl]
HarmonizedCode [required for Intl]

If applicable, you will also want to populate the following fields in the ShipManager table:

Order_Discount.n
Order_Insurance.n
Order_Shipping.n
Order_Other.n
Order_Other_Desc.t
Order_TaxRate.n

International Shipments
In addition to the basic ship values, you will need to populate commodities just as you would for a packing list, even if you are not using an integrated label.

First you will need to populate additional fields in the ShipManager table:
SoldTo_Name
SoldTo_AddressLine1
SoldTo_AddressLine2
SoldTo_City
SoldTo_StateProvinceCode
SoldTo_PostalCode
SoldTo_CountryCode
SoldTo_TaxIdentificationNumber
Shipper_TaxIdentificationNumber
International_ExportDate
International_InvoiceDate
International_CountryOfUltimateDestination
International_ReasonForExport
International_DeclarationStatement
International_TermsOfShipment
International_Forms_Invoice [1 if checked]
International_Forms_Other [NAFTA|CO|SED]

Next, set values for these in the ShipManager_Items table:
Quantity
PartNumber
Description
QuantityUnits (Pcs)
UnitPrice
CountryOfManufacture
HarmonizedCode

Depending on your commoidities, you may be creating one Item records per invoice line item, or if your product is consistent across line items you could create a single item - ex: Printed Materials.

Consult the International tab on the Parcel - Detail screen for additional fields to populate when using NAFTA, CO or SED.

Freight-LTL Shipments
To create a record that will be used for freight, simply set the ShipManager::Carrier value to LTL on record creation. You may also want to pre-set some of the other fields in the ShipManager table:
Service [Name of the LTL Carrier]
Payment Method [Sender|Receiver|Third Party|Consignee]
Freight_Collect [1 if checked]
Freight_SpecialInstructions
Freight_SpecialServices [Return delimited list of services]
Freight_Comments
Freight_HazmatName
Freight_HazmatPhone
Freight_COD_AmountToCollect
Freight_SelectedOption.n [1=FreightQuote,2=ConWay,4=FedEx,5=Estes,10=Manual]

You may also want to set values to these fields in the following ShipManager_Packages table:

ProductDesc.t
Packaging.t [Pallet]
Pieces.n [Number of Pallets]
Cartons.n [Number of Cartons on Pallet]
Class.n
NMFC.t
Weight.n
Length.n
Width.n
Height.n
Value.n
Hazmat.t [Yes|No]
Stackable.t [Yes|No]

Courier Shipments
To create a record that will be used for courier, simply set the ShipManager::Carrier value to Courier on record creation.

Email Notifications
By setting a valid email address and notification indicator the information will be passed to the carriers for automated notifications. UPS will send out emails at the time of shipment, FedEx will send out Express notifications immediately while Ground are sent at end of day, however USPS does not provide any delivery notification.

ShipTo_EmailAddress to valid email
Email_SendNotification_Receiver.n to 1
Email_SendNotification_ReceiverTypes.t [checkbox: ship|exception|delivery]

It may be preferred to take the post-ship ShipManager::Response_ShippingTrackNumber.t value and send out notifications from your own database so that you can include supplemental order information.