Contract and Rate Management

How to Set Up FedEx Rating Engine

The FedEx rating engine provides the external rates and transit details using the FedEx API 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.

Note: The FedEx integration has been deprecated and Oracle is in the process of replacing it with an integration that is supported by the FedEx Compatible program.

Setting up FedEx Rates and Transit API

Note: Direct integration with FedEx is not supported for international rates. It is not possible to create an external system that can directly access the FedEx REST API. Instead, you must implement an External Rating Engine (ERE) as defined in the External Rating Engine Chapter of the External Programming Interface Guide.

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/oauth/token
    3. URL - https://apis.fedex.com/rate/v1/rates/quotes
    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

The request parameters OTM supports for getting the rates from FedEx are as follows:

Request Parameters

Configuration Details

“accountNumber”

The accountNumber is a mandatory request parameter. This is configured against a reference number qualifier ID configured against the  property glog.RatingEngine.fedex.accountNumberQual. Refnum Qualifier with this ID should be configured either on  Source stop location, shipment, or order release. The default Refnum Qualifier ID for the property is FEDEX_ACCOUNT_NUMBER. 
The application fetches the value for the reference number  qualifier using the following 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.

"carrierCodes"

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.

This specifies the four letter code of a FedEx operating company that meets your requirements.
Examples of FedEx Operating Companies are:
FDXE - FedEx Express
FDXG - FedEx Ground
FXSP - FedEx SmartPost
FXCC - FedEx Custom Critical.

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

"packagingType":"FEDEX_SMALL_BOX"

The packagingType is an optional request parameter.  Packaging type is configured as value for the Reference Number Qualifier “PACK_TYPE” on Order Release Ship Unit or Order Release Line Item. 

If Reference Number Qualifier "PACK_TYPE" is not present then it will look for the Remark Qualifier with ID "PACK_TYPE".

The value for the Reference Number Qualifier or Remark Qualifier should be same on all the ship units or line items i.e. all the ship units or ship unit lines on the shipment must have the same packaging type.

"pickupType":"DROPOFF_AT_FEDEX_LOCATION"

The value is configured as a value for the Refnum Qualifier ID PICKUP_TYPE on source location or shipment or order release.
The precedence order for reading the Refnum Qualifier is Shipment, Order release and Shipment Source Location. Pick up types can be one of CONTACT_FEDEX_TO_SCHEDULE, DROPOFF_AT_FEDEX_LOCATION, USE_SCHEDULED_PICKUP, ON_CALL, PACKAGE_RETURN_PROGRAM, and REGULAR_STOP

"rateRequestControParameters":{"returnTransitTimes":true} The value for returnTransitTimes is set as true by default to receive the transit details always from FedEx.
"rateRequestType":["ACCOUNT"] The value is set as 'ACCOUNT' by default to receive only the account specific rates.
"requestedPackageLineItems": [
      {
        "weight": {
          "units": "LB",
          "value": 4.4092452
        },
        "dimensions": {
          "length": 12,
          "width": 12,
          "height": 12,
          "units": "IN"
        }
      }

The dimensions is an optional request parameter. Based on the field "Package Count is determined by:" on the Rate Offering the packaged item is determined as either Ship unit or Ship unit line.

Weight : Ship unit / Ship unit line Unit weight.
The weight uom is defined by the property glog.RatingEngine.fedex.WeightUOM. Default value is P. 
If property value is 'P' then unit is "LB" else the unit is "KG"

If the packaged item is a Ship unit, then the weight is the Gross Weight Per Shipunit. If the Gross Weight Per Shipunit is not present then the total weight (sum of weights of all the ship unit lines) divided by the Transport Handling Unit Count gives the weight value.

If the packaged item is the Ship unit line then the weight is the Ship Unit Line Weight divided by Total Package Count.

Dimensions: If packaged item is ship unit line, then the length/width/height of the ship unit line is considered. If the shipunit line do not have the dimensions specified then the dimensions of the packaged item is considered. 

If the packaged item is shipunit then length/width/height of the shipunit is considered.
The uom for the dimensions is defined by the property glog.RatingEngine.fedex.LengthUOM. Default value is I. 
If property value is  'I' then unit is "IN" else the unit is "CM"

"requestedShipment":

{

"shipper":{"address":{"city":"LAS VEGAS","stateOrProvinceCode":"NV","postalCode":"89119","countryCode":"US","residential":false}},

"recipient":{"address":{"city":"LOS ANGELES","stateOrProvinceCode":"CA","postalCode":"90009","countryCode":"US","residential":false}

}

Used to specify the shipper and recipient addresses.

  • Postal code and country code are mandatory in both shipper and recipient addresses. Country code is a two characters code.
  • Shipper will hold the city, province code, postal code, country code and the residential flag of the source location.
  • Recipient will hold the city, province code, postal code, country code and the residential flag of the destination location.
  • Residential flag is set based on the 
  • Rate Classification ID of the location
"ServiceType" The ServiceType is a mandatory request parameter. This is configured as RateService XID specified in the Rate Offering. 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.
"totalPackageCount":2

This specifies the total number of packages of the shipment. The totalPackageCount is used to get the total number of packages either in a Ship unit or a Ship unit line. 

 

The sample FedEx Request is as follows:
{
  "accountNumber": {
    "value": "740561073"
  },
  "rateRequestControParameters": {
    "returnTransitTimes": true
  },
  "requestedShipment": {
    "shipper": {
      "address": {
        "city": "LAS VEGAS",
        "stateOrProvinceCode": "NV",
        "postalCode": "89119",
        "countryCode": "US",
        "residential": false
      }
    },
    "recipient": {
      "address": {
        "city": "LOS ANGELES",
        "stateOrProvinceCode": "CA",
        "postalCode": "90009",
        "countryCode": "US",
        "residential": false
      }
    },
    "serviceType": "FEDEX_EXPRESS_SAVER",
    "rateRequestType": [
      "ACCOUNT"
    ],
    "shipDateStamp": "2023-04-27",
    "pickupType": "DROPOFF_AT_FEDEX_LOCATION",
    "requestedPackageLineItems": [
      {
        "weight": {
          "units": "LB",
          "value": 4.4092452
        },
        "dimensions": {
          "length": 12,
          "width": 12,
          "height": 12,
          "units": "IN"
        }
      },
      {
        "weight": {
          "units": "LB",
          "value": 2.2046226
        },
        "dimensions": {
          "length": 12,
          "width": 12,
          "height": 12,
          "units": "IN"
        }
      }
    ],
    "packagingType": "FEDEX_SMALL_BOX",
    "totalPackageCount": 2
  },
  "carrierCodes": [
    "FDXE"
  ]
}

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