Ship Request

Function to request specific rate information, this function will return specific shipping rates to any destination serviced by Fedex from a valid US destination.

Function ShipRequest
Output Type 1 Standard CF Query: qFedexRateQuery

1 Standard CF Variable:
TrackingNumber

Image file written to server (Labels directory)
TrackingNumber.png
Error Capture Variables FedexError
- 0 = Success
- 1 = Failure
- 2 = Hard Error (configuration problem)

FedexErrorDesc
(contains description of error if present)
Test Environment Available Yes
Additional Requirements You must have a directory at the same level as the page you are making this request from named Labels as the Shipment Image will be written to this directory upon a successful request (otherwise a file write error will be thrown by ColdFusion Server if this directory is not present or is present but write permissions have not been granted to the CF Server user)
Example Usage

INSTALLED AS A CUSTOM TAG
<cf_adminpro_fedexxml
function="ShipRequest"
accountnumber="your-fedex-account-number"
fedexindentifier="your-fedex-identifier"
dropofftype="REGULARPICKUP"
servicelevel="STANDARDOVERNIGHT"
packagetype="YOURPACKAGING"
ssfuturedayshipment="1"
packageweightunit="LBS"
packageweight="5"
packagelength="10"
packagewidth="7"
packageheight="7"
packageunitofmeasurement="IN"
shippercontactname="Joe Smith"
shippercompany="ABC Corp"
shipperdept="Shipping"
shipperphone="4045551212"
shipperpager=""
shipperfax="4045551313"
shipperemail="info@abccorp.com"
shipperstreet="100 Peachtree St"
shipperstreet2=""
shippercity="Atlanta"
shipperstate="GA"
shipperzip="30324"
shippercountry="US"
shiptocontactname="John Doe"
shiptocompany="ACME Corp"
shiptodept="Receiving Dept"
shiptophone="2135551212"
shiptopager=""
shiptofax="2135551313"
shiptoemail="info@acmecorp.com"
shiptostreet="1000 Santa Monica Blvd"
shiptostreet2=""
shiptocity="Los Angeles"
shiptostate="CA"
shiptozip="90046"
shiptocountry="US"
payortype="SENDER"
ssresdelivery="1"
requestlistrates="1"
testingenvironment="true"
debug="false"
>

*Note to use as a custom tag you must install the tool in your ColdFusion server CustomTags directory or have it present in the directory you are calling it from.

CFMODULE
<cfmodule template="adminpro_fedexxml.cfm"
function="ShipRequest"
accountnumber="your-fedex-account-number"
fedexindentifier="your-fedex-identifier"
dropofftype="REGULARPICKUP"
servicelevel="STANDARDOVERNIGHT"
packagetype="YOURPACKAGING"
ssfuturedayshipment="1"
packageweightunit="LBS"
packageweight="5"
packagelength="10"
packagewidth="7"
packageheight="7"
packageunitofmeasurement="IN"
shippercontactname="Joe Smith"
shippercompany="ABC Corp"
shipperdept="Shipping"
shipperphone="4045551212"
shipperpager=""
shipperfax="4045551313"
shipperemail="info@abccorp.com"
shipperstreet="100 Peachtree St"
shipperstreet2=""
shippercity="Atlanta"
shipperstate="GA"
shipperzip="30324"
shippercountry="US"
shiptocontactname="John Doe"
shiptocompany="ACME Corp"
shiptodept="Receiving Dept"
shiptophone="2135551212"
shiptopager=""
shiptofax="2135551313"
shiptoemail="info@acmecorp.com"
shiptostreet="1000 Santa Monica Blvd"
shiptostreet2=""
shiptocity="Los Angeles"
shiptostate="CA"
shiptozip="90046"
shiptocountry="US"
payortype="SENDER"
ssresdelivery="1"
requestlistrates="1"
testingenvironment="true"
debug="false"
>

Supplied Example Files example_scenario9.cfm


Rate Request
Input Attributes (attributes that can be passed to the custom tag with a valid value)
Attribute Name Required Preset value/value list Default Value Restrictions Explanation/Notes
AccountNumber Yes   NO VALUE Your active Fedex account number Your Fedex account number you use for shipping
FedexIndentifier Yes   NO VALUE Your Fedex meter number Your Fedex meter number, received either from Fedex or by running the RegisterRequest function.
PickupDate Yes   Today's date, if Friday or a weekend
the next business day is pre-populated.
  Valid Ship date in format
YYYY-MM-DD
DropOffType Yes REGULARPICKUP REQUESTCOURIER
DROPBOX BUSINESSSERVICECENTER STATION
REGULARPICKUP   How shipment will be tendered to Fedex
ServiceLevel Yes Domestic Service (1 – 150 lbs) STANDARDOVERNIGHT PRIORITYOVERNIGHT FIRSTOVERNIGHT FEDEX2DAY FEDEXEXPRESSSAVER FEDEXGROUND GROUNDHOMEDELIVERY

Domestic Service (over 150 lbs) FEDEX1DAYFREIGHT FEDEX2DAYFREIGHT FEDEX3DAYFREIGHT

International Service (1 - 150 lbs) INTERNATIONALPRIORITY INTERNATIONALECONOMY INTERNATIONALFIRST INTERNATIONALPRIORITYFREIGHT INTERNATIONALECONOMYFREIGHT
    Valid code for Fedex Service
RequestListRates Yes 0 = Do not request list rates to be returned
1 = Request list rates to be returned
1   Determines whether list/book rates are returned with the request, it is advised to always have this enabled even when requiring discount rates only
LabelType Yes 2DCOMMON 2DCOMMON   Specifies Fedex label type to be generated, use 2DCOMMON
LabelImageType   PDF
PNG4X6
ELTRON
ZEBRA
PDF   Label type to be generated. Options are
PDF (Standard Adobe PDF format label is created)
PNG4X6
(Graphic image that can be displayed and printed directly from a modern web browser. .png image file is created in labels directory)
ELTRON (Thermal printer file which must be manually sent directly to a label printer, user must have ability to perform this function and appropriate drivers otherwise PDF image type is suggested. a .epl file is created in labels directory)
ZEBRA (Thermal printer file which must be manually sent directly to a label printer, user must have ability to perform this function and appropriate drivers otherwise PDF image type is suggested. a .zpl file is created in labels directory)
ReturnShipment No PRINTRETURNLABEL NO VALUE   Use this parameter if you wish to create a return shipment label. Set the parameter as follows:

ReturnShipment="PRINTRETURNLABEL"
Thermal Label Specifications
LabelStockOrientation   LEADING
TRAILING
NONE
NONE   Applies to thermal label (ELTRON) only
ThermalLabelDocTabLocation   TOP
BOTTOM
NONE
TOP    
ThermalLabelType   STANDARD
ZONE001
BARCODED
NONE
STANDARD    
Package Information
Packaging Yes Domestic Shipments
FEDEXENVELOPE
FEDEXPAK
FEDEXBOX
FEDEXTUBE
YOURPACKAGING

International Shipments

FEDEX10KGBOXFEDEX25KGBOX
YOURPACKAGING   Valid package type to be used for this shipment
PackageWeightUnit Yes LBS
KGS
LBS    
PackageWeight Yes   1   Allowable shipment weight for all service types is 1-150 lbs. Over 150 lb requests can be accepted for freight service levels only – see below for all service levels.

Pass in decimal format with 1 decimal place
(e.g. 30.0)

Max Weight values per package type
FedEx Letter - 1 LB/.4 KG
FedEx Pak - 20 LB/9.1 KG
FedEx Box - 20 LB/9.1 KG
FedEx Tube - 20 LB/9.1 KG
FedEx 10 KG Box - 150 LB/68.1 KG
FedEx 25 KG Box - 150 LB/68.1 KG
Your Packaging, Express Services
150 LB/68.1 KG
Your Packaging, Freight Services
2200 LB / 1000 KG
PackageLength No       Optional: Numeric value 1-3 digits only
PackageWidth No       Optional: Numeric value 1-3 digits only
PackageHeight No       Optional: Numeric value 1-3 digits only
PackageUnitOfMeasurement No IN
CM
IN    
PackageCount Yes 1      
ReferencePONumber No       Include a P/O (Purchase Order) number on the label if desired
ReferenceInvoiceNumber No       Include a Invoice number on the label if desired
Shipper (Origin) Information
ShipperContactName Yes       Shipper Contact Name
ShipperCompany Yes       Shipper Company name
ShipperPhone Yes       Shipper Phone Number (numbers only)
ShipperDept No       Shipper Department (e.g. Shipping Dept)
ShipperFax No       Shipper Fax Number
ShipperEmail No       Shipper Email address
ShipperStreet Yes       Shipper Street address (line 1)
ShipperStreet2 No       Shipper Street address (line 2)
ShipperState Yes     2 chars maximum Required only if Sender Country Code is USA or Canada. State or province from which the shipment will be originating/shipped from
ShipperZip Yes     16 chars maximum Zip code/Postcode of origin shipper address
ShipperCountry Yes   US 2 chars maximum Sender/shipper Country (2 letter country code)
Ship To (Destination) Information
ShipToContactName Yes       Destination Contact Name
ShipToCompany Yes       Destination Company name
ShipToPhone Yes       Destination Phone Number (numbers only)
ShipToDept No       Destination Department (e.g. Shipping Dept)
ShipToFax No       Destination Fax Number
ShipToEmail No       Destination Email address
ShipToStreet Yes       Destination Street address (line 1)
ShipToStreet2 No       Destination Street address (line 2)
ShipToState Yes     2 chars maximum State of the address to be validated (must be valid 2 character US state)
ShipToZip No     16 chars maximum Destination Zip code
ShipToCountry No   US 2 chars maximum Destination Country (2 letter country code)
Payment Information
PayorType Yes   SENDER   How shipment will be paid for/billed to
CreditCardExpiration No       Credit Card expiration date in format: MMYY
* PayorType must be CREDITCARD
CreditCardNumber No       Valid credit card number to bill shipping charges to
* PayorType must be CREDITCARD
CreditCardType No       Credit card to bill shipping charges to. Valid card types accepted below:
VISA
MASTERCARD
AMEX
* PayorType must be CREDITCARD
DeclaredValue No       Insured value of shipment with 1 decimal place

For Ground Shipment MUST Pass a Value here of 1.0 or above
CurrencyCode No Argentina Astral ARA
Australian Dollar AUD
Austrian Schilling AUS
Bahrain Dinar BHD
Belgian Franc BFR
Brazilian Cruzado BRC
British Pound Sterling UKL
Canadian Dollar CAD
Chilean Peso CHP
Denmark Krone DKK
Dutch Guilder DFL
EURO EUR
Finland Markka FIM
French Franc FFR
German Deutsche Mark DMK
Hong Kong Dollar HKD
Irish Punts IRL
Italian Lire LIT
Japanese Yen JYE
Kuwait Dinar KUD
Luxembourg Franc LFR
Macau Patacas MOP
Malaysian Ringgits MYR
Mexican Peso NMP
New Taiwan Dollar NTD
New Zealand Dollar NZD
Norway Krone NOK
Philippine Peso PHP
Portuguese Escudo ESC
Singapore Dollar SID
South Korean Won WON
Spanish Peseta PTS
Sweden Krone SEK
Swiss Franc SFR
Thailand Baht THB
Turkish LIre TRL
U.S. Dollar USD
United Arab Emirates Dirham DHS
Uruguay New Peso UYP
Venezuela Bolivar VEB
   

Valid 3 Character of the currency being passed in the declared amount

Special Services Optional Parameters
SSCodAmount No       COD dollar amount with 2 decimal places (less freight charges and any other charges)
SSCODType No ANY
GUARANTEEDFUNDS
CASH
     
SSDangerousGoods No ACCESSIBLE
INACCESSIBLE
     
SSDryIce No 1 = Yes
0 = No
0    
SSDryIceWeight Conditional (Must be present if SSDryIce="1" above)       Cumulative dry weight for the entire shipment. Dry ice weight cannot be greater than shipment weight. Weight type is KGS only.
SSDryIceWeightUnits Conditional (Must be present if SSDryIce="1" above) KGS KGS    
SSResDelivery No 1 = Yes
0 = No
    Denotes whether delivery is to a residential address or not
SSHoldAtLocation No 1 = Yes
0 = No
0   FDXE (Express) Shipments only
SSHoldAtLocationPhone Conditional (Must be present if SSHoldAtLocation="1" above)       Phone number for the location where the shipment is being held.
SSHoldAtLocationStreet1 Conditional (Must be present if SSHoldAtLocation="1" above)       Street Address for the location where the shipment is being held.
SSHoldAtLocationCity Conditional (Must be present if SSHoldAtLocation="1" above)       City for the location where the shipment is being held.
SSHoldAtLocationState Conditional (Must be present if SSHoldAtLocation="1" above)       State for the location where the shipment is being held.
SSHoldAtLocationZip Conditional (Must be present if SSHoldAtLocation="1" above)       Zipcode for the location where the shipment is being held.
SSInsidePickup No 1 = Yes
0 = No
     
SSInsideDelivery No 1 = Yes
0 = No
     
SSSatPickup  No 1 = Yes
0 = No
    Denotes Saturday pickup is requested for this shipment
SSSatDelivery  No 1 = Yes
0 = No
    Denotes Saturday delivery is requested for this shipment
SSAOD No 1 = Yes
0 = No
     
SSAutoPOD No 1 = Yes
0 = No
     
SSNonStdContainer No 1 = Yes
0 = No
     
SSSignatureOption No DELIVERWITHOUTSIGNATURE
INDIRECT
DIRECT
ADULT
    Use to specify the delivery signature option for the package.
Email Notification
ShipAlertFaxNumber No       Fax Number to send shipment alert to, cannot use this element and also email notification elements below.
ShipAlertOptionalMessage No       Custom message that will be added to default email notification message transmitted.
ShipperNotify No 1 = Yes
0 = No
0   Enables/Disables e-mail notifications to be sent to Shipper (ShipperEmail value will be the email address used).
ShipperShipAlert Conditional (May be present if ShipperNotify="1" above) 1 = Yes
0 = No
0   Enables/Disables e-mail notifications to be sent to Shipper upon package shipment. (ShipperNotify must also be set to 1).
ShipperDeliveryNotification Conditional (May be present if ShipperNotify="1" above) 1 = Yes
0 = No
0   Enables/Disables e-mail notifications to be sent to Shipper upon package delivery. (ShipperNotify must also be set to 1).
ShipperExceptionNotification Conditional (May be present if ShipperNotify="1" above) 1 = Yes
0 = No
0   Enables/Disables e-mail notifications to be sent to Shipper upon shipment. (ShipperNotify must also be set to 1).
ShipperEmailFormat Conditional (May be present if ShipperNotify="1" above) Text
HTML
WIRELESS
Text   Format of e-mail notification sent to Shipper.
ShipperLanguageCode Conditional (May be present if ShipperNotify="1" above) da = Danish
de = German
en = English
es = Spanish
fr = French
it = Italian
ja = Kanji
ko = Korean
nl = Dutch
pt = Portuguese
sv = Swedish
zh = Chinese
en   The language the Email notification will be use.
ShipperLocaleCode Conditional (May be present if ShipperLanguageCode above denotes a language that supports an additional locale code) ES = Spain
(If ShipperLanguageCode="es")

CA
= Canadian French
(If ShipperLanguageCode="fr")

CN
= Chinese Simple
(If ShipperLanguageCode="zh")

HK
– Chinese Traditional Hong Kong
(If ShipperLanguageCode="zh")

TW
– Chinese Traditional Taiwan
(If ShipperLanguageCode="zh")
    Optional additional specific dialect of the language
denoted in above element.
RecipientNotify No 1 = Yes
0 = No
0   Enables/Disables e-mail notifications to be sent to Recipient (ShipToEmail value will be the email address used).
RecipientShipAlert Conditional (May be present if RecipientNotify="1" above) 1 = Yes
0 = No
0   Enables/Disables e-mail notifications to be sent to Shipper upon package shipment. (RecipientNotify must also be set to 1).
RecipientDeliveryNotification Conditional (May be present if RecipientNotify="1" above) 1 = Yes
0 = No
0   Enables/Disables e-mail notifications to be sent to Shipper upon package delivery. (RecipientNotify must also be set to 1).
RecipientExceptionNotification Conditional (May be present if RecipientNotify="1" above) 1 = Yes
0 = No
0   Enables/Disables e-mail notifications to be sent to Shipper upon shipment. (RecipientNotify must also be set to 1).
RecipientEmailFormat Conditional (May be present if RecipientNotify="1" above) Text
HTML
WIRELESS
Text   Format of e-mail notification sent to Recipient.
RecipientLanguageCode Conditional (May be present if RecipientNotify="1" above) da = Danish
de = German
en = English
es = Spanish
fr = French
it = Italian
ja = Kanji
ko = Korean
nl = Dutch
pt = Portuguese
sv = Swedish
zh = Chinese
en   The language the Email notification will be use.
RecipientLocaleCode Conditional (May be present if RecipientLanguageCode above denotes a language that supports an additional locale code) ES = Spain
(If RecipientLanguageCode="es")

CA
= Canadian French
(If RecipientLanguageCode="fr")

CN
= Chinese Simple
(If RecipientLanguageCode="zh")

HK
– Chinese Traditional Hong Kong
(If RecipientLanguageCode="zh")

TW
– Chinese Traditional Taiwan
(If RecipientLanguageCode="zh")
    Optional additional specific dialect of the language
denoted in above element.

Successful Transaction Variables
Variables are returned in form of a Query named "qFedexRateQuery" AND a single variable for the generated tracking number “TrackingNumber” (NOTE: TrackingNumber will only be present for successful transactions).

**Additional IMPORTANT NOTES/SETUP REQUIREMENTS**

Upon completion of a successful transaction with Fedex the function will write to your server an image file named trackingnumber.png (for a PNG Label Image Type) or trackingnumber.epl (for an ELTRON label Image Type) where trackingnumber is a valid Fedex tracking number generated by this request and available in the TrackingNumber variable. The file will be written to a directory at the same level as the calling template named “Labels” so you must have a directory present on your server at that level named Labels and it must have write permissions enabled.

Once the label image has been written to the server, in the case of the default image type (PNG) the image must be rendered at correct dpi in a html template and displayed in a browser to be printed. We provide a sample file named Label.cfm that will handle this for you, simply reference the example files provided for this scenario to see examples of its usage. Eltron labels must be sent directly to the label printer by your own means, we provide no assistance with this label type as each setup will be unique. Note that the epl file is written to the server so if you wish to print this file to a label printer attached to a machine other then the server you will need to first download this file to the local machine with the label printer attached.

Example code used to view label using the supplied label.cfm file

<a href="label.cfm?TrackingNumber=<cfoutput>#TrackingNumber#</cfoutput>" target="_blank">View Shipping Label</a>


Rate Request - Output
Output Query "qFedexRateQuery" (*variables for display with <cfoutput query="qFedexRateQuery" > tag after call to custom tag)
Column name Always Present Default Value Explanation/Notes
Response Failure Variables (Present if FedexError = 1 or 2)
FedexError Yes [0 (Successful transaction), 1 (Error from Fedex based on request), 2 (Hard Error, error with request that could not be handled by Fedex, check attributes passed are valid)]
FedexErrorDesc Yes Description of error received
Success Query named qFedexRateQuery (Present if FedexError = 0)
DimWeightUsed Yes EMPTY If this dimensional weight was used to calculate rates rather then the actual weight
Oversize Yes   Denotes if the item is rated as oversized
RateScale Yes    
RateZone Yes   Rate Zone for this shipment
CurrencyCode Yes   Currency code for this rate
BilledWeight Yes   Actual billable weight
DimWeight Yes   Dimensional weight
DISCOUNT RATE Variables
You may specify whether you wish to return your account's discount rates for this request, if so then the following discount rate columns may be populated. If you're account is eligible for a Fedex discount these rates will differ from the columns populated with the list or book rates noted below.
DiscBaseFreightCharges Yes   Fedex base (book) rate (excluding any applicable surcharges)
DiscDiscountAmt Yes   If your account receives a discount from fedex then this column will return the discount amount (for example DiscBaseFreightCharges is $20, DiscNetTotalCharge is $18.75 then this column will contain $1.85)
DiscNetTotalCharge Yes   Total discounted charge (based on any applicable discount assigned to your fedex account) including all applicable surcharges
DiscTotalRebate Yes   Any rebate amount your account has received for this service
DiscBaseTotalCharges Yes   This is the total base (book rate) charge for this shipment, includes total of base freight charge and total surcharges assessed. This amount is provided here for convenience, if you have requested List Rates to be provided and are rating a Fedex Express shipment (not Ground) this amount will be present also in the ListNetTotalCharge column below and may be more accurate! It is suggested to check for a value in the ListNetTotalCharge column first and if unavailable use this column. This amount will be slightly different to the ListNetTotalCharge column value if your account number receives a discount off Fedex book rates.
DISCOUNT Surcharge Variables
Following columns may contain specific amounts for any and all surcharges that apply to this rate request.
DiscSurchargeCOD Yes    
DiscSurchargeSatPickup Yes    
DiscSurchargeDV Yes    
DiscSurchargeAOD Yes    
DiscSurchargeAD Yes    
DiscSurchargeAutoPOD Yes    
DiscSurchargeHomeDelivery Yes    
DiscSurchargeHomeDeliveryDC Yes    
DiscSurchargeHomeDeliveryEvening Yes    
DiscSurchargeHomeDeliverySig Yes    
DiscSurchargeNonStd Yes    
DiscSurchargeHazMat Yes    
DiscSurchargeRes Yes    
DiscSurchargeVAT Yes    
DiscSurchargeHST Yes    
DiscSurchargeGST Yes    
DiscSurchargePST Yes    
DiscSurchargeSatDeliv Yes    
DiscSurchargeDG Yes    
DiscSurchargeOutOfPickupArea Yes    
DiscSurchargeOutOfDeliveryArea Yes    
DiscSurchargeInsidePickup Yes    
DiscSurchargeInsideDeliv Yes    
DiscSurchargePryAlert Yes    
DiscSurchargeDelivArea Yes    
DiscSurchargeFuel Yes    
DiscSurchargeFICE Yes    
DiscSurchargeOffshore Yes    
DiscSurchargeOther Yes    
DiscSurchargeTotal Yes   Total amount of all surcharges that apply to this rate request
LIST/BOOK RATE Variables
ListBaseFreightCharges Yes   Fedex base (book) rate (excluding any applicable surcharges)
ListDiscountAmt Yes    
ListNetTotalCharge Yes   Fedex base (book) rate (including any applicable surcharges)
ListTotalRebate Yes    
LIST/BOOK RATE Surcharge Variables
Following columns may contain specific amounts for any and all surcharges that apply to this rate request.
ListSurchargeCOD Yes    
ListSurchargeSatPickup Yes    
ListSurchargeDV Yes    
ListSurchargeAOD Yes    
ListSurchargeAD Yes    
ListSurchargeAutoPOD Yes    
ListSurchargeHomeDelivery Yes    
ListSurchargeHomeDeliveryDC Yes    
ListSurchargeHomeDeliveryEvening Yes    
ListSurchargeHomeDeliverySig Yes    
ListSurchargeNonStd Yes    
ListSurchargeHazMat Yes    
ListSurchargeRes Yes    
ListSurchargeVAT Yes    
ListSurchargeHST Yes    
ListSurchargeGST Yes    
ListSurchargePST Yes    
ListSurchargeSatDeliv Yes    
ListSurchargeDG Yes    
ListSurchargeOutOfPickupArea Yes    
ListSurchargeOutOfDeliveryArea Yes    
ListSurchargeInsidePickup Yes    
ListSurchargeInsideDeliv Yes    
ListSurchargePryAlert Yes    
ListSurchargeDelivArea Yes    
ListSurchargeFuel Yes    
ListSurchargeFICE Yes    
ListSurchargeOffshore Yes    
ListSurchargeOther Yes    
ListSurchargeTotal Yes   Total amount of all surcharges that apply to this rate request
VariableHandling Yes    
ListVariableHandlingCharge Yes    
TotalCustomerCharge Yes    
ListTotalCustomerCharge Yes    
MultiweightVariableHandlingCharge Yes    
MultiweightTotalCustomerCharge Yes    
* Denotes success variables are available if response was successful (FedexError = 0)