Integration»Complex

Complex

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 UPS_Ship table:
BillToRadio [SMy UPS Account|My Credit Card|Receiver|Third Party|Consignee]
BillToUPSAccountNumber
BillToPostalCode
BillToCountry


Multiple Packages
If you have package data in your solution, you can easily create additional related records in the UPS_Ship_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 UPS_Ship_Packages table by setting the value of UPS_Ship_Packages::Ship_ID to the value from UPS_Ship::Ship_ID

For example, in your ship script, after you create a record in UPS_Ship you could set a variable $ship_id to the incremental UPS_Ship::Ship_ID.
When you are ready to create packages you can switch over to a layout based on UPS_Ship_Packages.
For each package, create a new record and set the UPS_Ship_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.


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 UPS_Ship table:
# These are the fields which will appear on the printed label
Shipper_Name
Shipper_AttentionName
Shipper_AddressLine1
Shipper_AddressLine2
Shipper_City
Shipper_StateProvinceCode
Shipper_PostalCode
Shipper_Country
Shipper_PhoneNumber

# These fields are used for rating purposes
ShipFrom_Name
ShipFrom_AttentionName
ShipFrom_AddressLine1
ShipFrom_AddressLine2
ShipFrom_City
ShipFrom_StateProvinceCode
ShipFrom_PostalCode
ShipFrom_Country
ShipFrom_PhoneNumber

Note that some international shipments MUST display the actual origin address.


Email Notifications
By setting a valid email address in UPS_Ship::ShipTo_EmailAddress and UPS_Ship::Email_SendEnabled to 1 then the information will be passed to UPS for automated notifications at the time of shipment.

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


International Shipments
NRGship provides the ability to printed or electronic commercial invoices. In order to populate the line items for a commercial invoice, you will need to create a relationship from UPS_Ship to UPS_Ship_IntlProduct based on UPS_Ship::Ship_ID to UPS_Ship_IntlProduct::Ship_ID. In the UPS_Ship_IntlProduct table, you will want to populate the following fields:
Unit_Number (Quantity)
Unit_Value
Unit_UnitOfMeasurementCode (Normally, "Pieces")
PartNumber
Description
CommodityCode
OriginCountryCode


In addition to the basic ship values you may also need to populate additional fields in the UPS_Ship 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_TermsOfSale
International_Forms_Invoice [1 if checked]
International_Forms_Other [NAFTA|CO|SED]
International_Discount_MonetaryValue
International_FreightCharges_MonetaryValue
International_InsuranceCharges_MonetaryValue
International_OtherCharges_MonetaryValue
International_OtherCharges_Description

Please consult the International layout for additional fields to populate when using NAFTA, CO or SED.