025349 Implement FedEx RESTful API

Overview

Khaos Control includes an integration with FedEx REST, allowing shipments to be created directly from within Khaos Control and submitted to FedEx electronically.
Once configured, Khaos Control can:
  • Create shipments with FedEx.
  • Return shipping labels automatically.
  • Support domestic and international shipments.
  • Generate commercial invoice information where required.
  • Record shipping errors returned by FedEx.
This integration is managed through the standard courier functionality within Khaos Control.

Prerequisites

Before configuring the integration, you will need:
  • A FedEx account.
  • FedEx REST API credentials.
  • The latest Khaos Control update and changelog containing the FedEx REST integration.

Configure the FedEx REST Courier

Create the Courier

  1. Open System Data.
  2. Expand Courier / Shipping - Couriers.
  3. Press F3 or click New Item.
  4. Enter a suitable courier name, for example FedEx REST.
  5. Select FedEx REST from the CourierExport lookup.
  6. Save the courier.

Open Courier Configuration

  1. Right-click the newly created courier.
  2. Select Configure.
The configuration window contains the following options.

FedEx REST Configuration Options

API Settings

OptionDescription
Use Sandbox APIConnects to the FedEx test environment instead of the live environment.
Client KeyThe client key supplied by FedEx.
Client SecretThe client secret supplied by FedEx.
Account NumberYour FedEx account number.

Shipment Settings

OptionDescriptionExample
Pickup TypeDefines how the shipment is collected.USE_SCHEDULED_PICKUP
Service TypeFedEx service to use.FEDEX_PRIORITY
Packaging TypeFedEx packaging type.FEDEX_PAK
Sender Pays ShippingDetermines whether shipping costs are paid by the sender or recipient.Ticked or Unticked
Sender Pays DutiesDetermines whether duties are paid by the sender or recipient.Ticked or Unticked
Signature Option TypeSignature level required from the recipient.INDIRECT
Requires Consignment RefPrevents invoices moving beyond Shipping if no consignment reference exists.Ticked or Unticked

Shipper Details

OptionDescriptionExample
Shipper Address Line 1First address line.1-3 Priest Court
Shipper Address Line 2Second address line.
Shipper Town/CityTown or city.Grantham
Shipper Postal CodePostcode.NG31 7FZ
Shipper Country CodeTwo-character country code.GB
Shipper Contact NameContact name.John Smith
Shipper Email AddressContact email address.JS@khaoscontrol.com
Shipper TelephoneContact phone number.01234567890
Shipper TINTax identification number.GB1234567890
Shipper TIN TypeTax identification number type.BUSINESS_UNION

Label Configuration

OptionDescriptionExample
Label Stock TypeLabel format used by FedEx.PAPER_85X11_TOP_HALF_LABEL
Label RotationUsed for thermal printers with roll stock.
Label Printing OrientationUsed for thermal printers with roll stock.
Label ResolutionLabel image resolution.203 or 300 DPI
Printer NameGeneral courier option. Not used by the FedEx REST integration.

Weight and Dimensions

OptionDescriptionExample
Weight UnitsWeight unit used when sending shipments.KG or LB
Dimensions UnitsDimension unit used when sending shipments.CM or IN
Weight ScaleMultiplier applied before sending weights to FedEx.0.001
Nominal WeightUsed when a packed box calculates as zero weight.1
Dimension ScaleNot used for this integration.
Default Stock WeightWeight used where stock records have no valid weight.0
Example: If stock weights are stored in grams and the courier expects kilograms, set Weight Units to KG and Weight Scale to 0.001.

Commercial Invoice Settings

OptionDescription
Invoice Originator NameName displayed as the commercial invoice originator.
Invoice Special InstructionsAdditional instructions shown on the commercial invoice.
Invoice Declaration StatementDeclaration text printed on the commercial invoice.
Letterhead ImagePNG or GIF image used as the invoice letterhead.
Signature ImagePNG or GIF image used for invoice signatures.

International Shipping Options

OptionDescription
International ShipmentsEnables this courier for international shipments.
Windsor FrameworkEnables this courier for Windsor Framework green-lane shipments.
IncotermsIncoterms code used for international shipments. Example: DDP

Default Package Settings

These values are used when an invoice has not been packed into boxes.
OptionDescription
Default Package WidthDefault package width.
Default Package HeightDefault package height.
Default Package LengthDefault package length.

Unused Options

The following settings are present because they are part of the standard courier framework but are not used by the FedEx REST integration:
  • Raw Dump to Table
  • Note Choice
  • Primary Reference
  • Secondary Reference
  • Printer Name (FedEx-specific functionality does not use this setting)
  • Dimension Scale

Using the FedEx REST Integration

Create a Sales Order

  1. Create a sales order as normal.
  2. Go to Sales Order | Detail | Additional.
  3. Select the FedEx REST courier.
  4. Save the order.
Orders imported into Khaos Control may have a courier assigned automatically, depending on the import method being used.

Process the Order

  1. Open Sales Invoice Manager.
  2. Progress the order through the normal stages.
  3. If required, pack the order using Pack Boxes in the Packing stage.
  4. Continue processing until the order reaches the Shipping stage.

Confirm Shipment

  1. Green-select the invoice.
  2. Click Confirm Shipment.
  3. Check the Shipment Date.
  4. Double-click the invoice to move it to the lower grid.
  5. If necessary, select a different courier by:
    • Clicking the Courier column.
    • Pressing F4.
    • Selecting the required courier.
  6. Review the shipment weight.
If the calculated weight needs to be changed:
  • Enter the correct value in the Actual Weight column.
  1. Click OK.

Assign the Shipment to FedEx

  1. Click Assign to Courier.
Khaos Control will submit the shipment details to the FedEx REST API using the courier configuration settings.

Successful Submission

If the shipment is accepted:
  • FedEx creates the shipment.
  • Shipping labels are returned to Khaos Control.
  • The invoice can continue through the shipping process.

Failed Submission

If FedEx rejects the shipment:
  • The error details returned by FedEx are displayed in the Shipping Error column within the Confirm Shipment window.

Troubleshooting

No Labels Returned

Check:
  • Client Key and Client Secret.
  • FedEx Account Number.
  • Service Type.
  • Packaging Type.
  • Shipment address information.

Shipping Error Displayed

Review the message in the Shipping Error column.
Common causes include:
  • Invalid account credentials.
  • Invalid service selection.
  • Missing shipment information.
  • Invalid weight or customs information.
  • Address validation failures.

Invoice Cannot Move Beyond Shipping

If Requires Consignment Ref is enabled, confirm that a valid consignment reference has been assigned before progressing the invoice.

Additional Information

  • A FedEx account is required before the courier can be configured.
  • Sandbox mode is available for testing and training purposes.
  • International shipment support is included.
  • Commercial invoice information can be generated as part of the shipment process.
  • Shipping labels are returned directly from FedEx when a shipment is successfully created.

Did you find this article helpful?