Contract and Rate Management

How to Set Up FedEx Rating Engine

The FedEx application programming interfaces (API) from the FedEx rating engine provide the external rates and transit details that OTM can use to calculate a shipment's rate and transit time. The request calls can be made from OTM to get the rates via REST web service.

Setting up FedEx Rates and Transit API

The following configurations must be done for setting up the FedEx API in OTM:

  1. Create an External System with the API URL and authorization details. While creating the External System, you must provide the FedEx-specific inputs as follows:
    1. Select the Authentication Type as OAuth 2.0 - Client Credentials and then select the Client Credentials in Message option from the Authorization Service Authentication Type drop-down list.
    2. Authorization Service URL - https://apis.fedex.com/rate/v1/rates/quotes
    3. URL - https://apis.fedex.com/oauth/token
    4. Enter the Client ID, and Client Secret provided by FedEx.

      Note: Refer to API Authorization Documentation | FedEx Developer Portal for the FedEx authorization detail.

  2. Create a Rate Service with the rate service ID the same as the service types the FedEx API support. Refer to Reference Guide | FedEx Developer Portal for the FedEx-provided service types. In the Rate Header tab, you have to choose Rate Service Type as EXTERNALTRANSITDAYS to get the transit time details. 
  3. Create an External Rating Engine FieldSet for FedEx. While creating the External Rating Engine FieldSet, you must provide the FedEx-specific inputs as follows:
    1. Select the external rating engine FEDEX from the Valid External Rating Engine ID drop-down list.
    2. Enter the java class as glog.business.rate.rateengine.external.REXFedEx in the Implementing Java Class field.
    3. Enter the External System ID created in Step 1.
  4. Create a Rate Offering with the Rate Offering type which has the rate attribute "EXTERNALRATINGENGINE". Provide the FedEx-specific inputs as follows:
    1. Select the Rate Service created in Step 2. 
    2. In the Attributes tab, select External Rating Engine ID as "FEDEX" and provide the External Rating Engine FieldSet ID created in Step 3.
  5. Create a Rate Record using the Rate offering created in step 4.
  6. Create an Order Release between the location pair or inquire about the rates using Rate Inquiry for getting the rate and transit details.             

Additional Configurations

Following are the additional configurations required to send the following parameters in the request calls:

  1. Account Number: The accountNumber is a mandatory request parameter. This is configured against a reference number qualifier ID specified against the  property glog.RatingEngine.fedex.accountNumberQual on either Source stop location, shipment, or order release. You must define a reference number qualifier ID against the  property glog.RatingEngine.fedex.accountNumberQual on at least any one of the business objects Shipment, Order Release, or Source locations. The application fetches the reference number qualifier value from either of the following in priority order: 1. Shipment 2. Order Release 3. Source stop location. Refer to Getting Started | FedEx Developer Portal to get the account numbers specific to your FedEx account.
  2. Carrier Code:  The carrierCodes is an optional request parameter. You can configure it on the service provider to pick a specific carrier. This can be configured as the SCAC code on the service provider or as a value against the service provider alias qualifier ID as SC.

    Note: If you don't specify the carrierCodes in the FedEx request, the application gets the list of carriers and picks the random one.

  3. Postal Code and Country Code:  The postalCode and countryCode are mandatory request parameters in both shipper and recipient addresses.

    Note: Make sure the locations have the postal and country codes.

  4. Pick Up Type:  The pickupType is a mandatory request parameter. Configure this parameter against the reference number qualifier PICKUP_TYPE. You must define the reference number qualifier with ID PICKUP_TYPE on at least any one of the business objects Shipment, Order Release, or Source locations. Refer to Reference Guide | FedEx Developer Portal for the FedEx-provided pickup types. The application looks for the value of the reference number qualifier ID from either of the following in priority order: 1. Shipment 2. Order Release 3. Source location.
  5. Packaged Item: The requestedPackageLineItems is a mandatory request parameter. This is used to determine the packaged item as either a Ship unit or a Ship unit line based on the field Package Count is determined by on the Rate Offering.
  6. Packaged Count: The totalPackageCount is used to get the total number of packages either in a Ship unit or a Ship unit line. If the package count is of a Ship unit, the application sum up the total package count values, and if it is a Ship unit line, the application sum up the values of the total packaged count.
  7. Weight: The weight is a mandatory request parameter that indicates the gross weight of the package considered either from the ship unit or the ship unit line. The unit of measurement (UOM) of weight is configured in the property glog.RatingEngine.fedex.WeightUOM. The default value is P. If the property value is set to P, the unit is in LB else the unit is in KG.
  8. Dimensions: The dimensions is an optional request parameter that indicates the dimension of a ship unit (dimensions are only for the Ship unit). The UOM of the dimension is configured in the property glog.RatingEngine.fedex.WeightUOM. The default value is I. If the property value is set to I, the unit is in IN else the unit is in CM.
  9. Packaging Type: The packagingType is an optional request parameter. Configure this to retrieve the packaging type associated with this rate. The is configured against the reference number qualifier PACK_TYPE either on the ship unit or ship unit line. You must define the reference number qualifier with ID PACK_TYPE on at least any one of the business objects Shipment, Order Release, or Source locations. Refer to Reference Guide | FedEx Developer Portal for the FedEx-provided package types.

    Note: All the ship units or ship unit lines on the shipment must have the same packaging type.

Response from FedEx

OTM captures the following response for calculating the rate and transit time of a shipment:

  1. totalBaseCharge: The totalBaseCharge received in the response from FedEx is created as the base cost.
  2. totalFreightDiscount: The totalFreightDiscount received in the response from FedEx is considered as the discount amount.
  3. surCharges: The surCharges received in response are created as an individual accessorial cost. For these surcharges, OTM has Charge Tokens defined. In Charge Tokens, the type of surcharge is mapped to the charge token value. The Charge Tokens have corresponding accessorial codes defined in the Charge Token Set. Based on these mappings, an accessorial cost is created for each surcharge.
  4. UnCategorized charges: The extra charges apart from the surCharges are considered uncategorized charges or other charges.
  5. Transit Details: The DeliveryDate received in the response from FedEx is considered for calculating the transit days. 

Related Topics