Adding Complex Features
While the walkthru provides a simple overview of creating and shipping records in NRGship, 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 FedEX_Ship table:
Payment_Payor_PayorType [Sender|Recipient|Third Party|Collect]
If you have package data in your solution, you can easily create additional related records in the FedEx_Packages table. Rather than the 1:1 relationship from the Basic integration, a more complex script could be utilized to create additional records in the FedEx_Packages table by setting the value of FedEx_Packages::Ship_ID to the value from FedEx_Ship::Ship_ID
For example, in your ship script, after you create a record in FedEx_Ship you could set a variable $ship_id to the incremental FedEx_Ship::Ship_ID.
When you are ready to create packages you can switch over to a layout based on FedEx_Packages.
For each package, create a new record and set the FedEx_Packages::Ship_ID value to the variable $ship_id.
Next, set all of the package values like weight, dimensions and reference number. Remember to commit the record after setting these values.
If you would like to do multiple shipments from a CRM system (ex: Contacts) or invoice database then you will likely 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 FedEx_Ship based on this ID instead of the primary key in your contacts or invoice table.
Return shipments can be created easily by using the External - Create Return Shipment and Show Ship ID script. Simply create a new shipment record and pass the Ship_ID or pass in the Ship_ID of an existing shipped record and the record will be converted to a return shipment and then displayed to the shipper for label generation.
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 FedEx_Ship table:
# These are the fields which will appear on the printed label
Rate/Ship from Alternate Locations
You may want to rate or create shipments that come from an address that is different from the address displayed on the label, for example if you're providing a label to a drop shipper. You will want to use the Drop Shipper fields in addition so that the address printed on the label shows your origin. In order to facilitate these shipments, you will need to set values in these fields in the FedEx_Ship table:
# These are the fields which will be used for rating and shipping origin
By setting a valid email address in Destination_Contact_EmailAddress and SpecialServices_EmailNotification_Recipient_ShipAlert to 1 then the information will be passed to FedEx for automated notifications at the time of shipment.
It may be preferred to take the post-ship _Tracking_TrackingNumber value and send out notifications from your own database so that you can include supplemental order information.
Fedex Provides four delivery confirmation options. Set the field according to your choice of the 4 options:
SpecialServices_SignatureOption [Deliver Without Signature|Indirect|Direct|Adult]
Values for SmartPost shipments are set from defaults in preferences, but can be overridden thru user scripts. The following fields can be modified as needed on a per-shipment basis. See value list for a listing of valid options for each field.
SmartPostDetail_CustomerManifestID.t - Customer value that shows on SmartPost billing.
SmartPostDetail_HubId.t - HubID for the shipment.
NRGship provides the ability to produce printed commercial invoices. In order to populate the line items for a commercial invoice, you will need to create a relationship from FedEx_Ship to International_Commodity based on FedEx_Ship::__pk_Ship_ID to FedEx_International_Commodity::__fk_Ship_ID. In the International_Commodity table, you will want to populate the following fields:
QuantityUnits (Normally Pcs)
In addition to the basic ship values you may also need to populate additional fields in the FedEx_Ship table:
International_Documents (Set to 1 if Documents Only)
International_DutiesPayment_PayorType [Sender|Recipient|Third Party|Collect]
Please consult the International layout for the fields to populate when using NAFTA, CO or SED.
You can automate pickup requests by creating a record in the FedEx_PickupRequest table. Once a record is created, you can then pass the __kp__PickupRequest_ID value to one of the external scripts to create or cancel a pickup request. You will need to set all of the PickupLocation fields along with PackageCount and TotalWeight.