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
Signature Options
Sometimes you will want to require that the carrier get a signature or only deliver to an adult, set the following fields in the ShipManager table:
Special_DeliveryConfirmation [<Blank>|No Signature|Signature Required|Adult Signature Required]
Note that picking any of the options other than the blank value may incur ancillary fees.
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. Post-shipment, the ShipManager table always holds the master tracking number - if you track this at the carrier website it should show all packages. If you want all tracking numbers, you can pull the related values from ShipManager_Packages::Response_ShippingTrackNumber.t
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:
International_ExportDate
International_InvoiceDate
International_CountryOfUltimateDestination
International_ReasonForExport
International_DeclarationStatement
International_TermsOfShipment
International_Forms_Invoice [1 if checked]
International_Forms_Other [NAFTA|CO|SED]
If the recipient is different than the ShipTo information, then you must set SoldTo fields:
SoldTo_Name
SoldTo_AddressLine1
SoldTo_AddressLine2
SoldTo_City
SoldTo_StateProvinceCode
SoldTo_PostalCode
SoldTo_CountryCode
SoldTo_TaxIdentificationNumber
Shipper_TaxIdentificationNumber
If using a broker, set these fields:
International_Broker_Contact_CompanyName
International_Broker_Contact_PersonName
International_Broker_Address_Line1
International_Broker_Address_Line2
International_Broker_Address_City
International_Broker_Address_StateOrProvinceCode
International_Broker_Address_PostalCode
International_Broker_Address_CountryCode
International_Broker_Contact_PhoneNumber
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=XPO,3=Manual,4=FedEx,5=Estes,6=UPS,7=YRC,8=AAA,9=RRD,10=Echo,11=DYLT,12=EDI]
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.
Amazon Seller Fulfilled Prime (SFP)
To create a record that will be used for Amazon SFP that is not download from the NRGship Amazon integration, you need to be sure the additional fields are populated for rating and shipping - SHIP~TOG::AmazonOrderId and at the order level and ship_ITM_Items~ShipManagerID::AmazonOrderItemId at the line item level.
Address Validation from CRM
You can call address validation functions for use outside the shipping workfllow by creating a ship record, running External - Validate, checking results and then calling External - Delete. Check the field Ship::AV_Status to check validation results.
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. Endicia may provide delivery notifications for USPS - please confirm with Endicia support.
ShipTo_EmailAddress to valid email
Email_SendNotification_Receiver.n to 1
Email_SendNotification_ReceiverTypes.t [checkbox: ship|exception|delivery]
Note that FedEx will only send to to a single ShipTo_EmailAddress value. UPS allows up to three email addresses. You can delimit the ShipTo_EmailAddress value with comma or returns to separate.
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.