025349 Implement FedEx RESTful API
Table Of Contents
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
- Open System Data.
- Expand Courier / Shipping - Couriers.
- Press F3 or click New Item.
- Enter a suitable courier name, for example FedEx REST.
- Select FedEx REST from the CourierExport lookup.
- Save the courier.
Open Courier Configuration
- Right-click the newly created courier.
- Select Configure.
The configuration window contains the following options.
FedEx REST Configuration Options
API Settings
| Option | Description |
|---|---|
| Use Sandbox API | Connects to the FedEx test environment instead of the live environment. |
| Client Key | The client key supplied by FedEx. |
| Client Secret | The client secret supplied by FedEx. |
| Account Number | Your FedEx account number. |
Shipment Settings
| Option | Description | Example |
|---|---|---|
| Pickup Type | Defines how the shipment is collected. | USE_SCHEDULED_PICKUP |
| Service Type | FedEx service to use. | FEDEX_PRIORITY |
| Packaging Type | FedEx packaging type. | FEDEX_PAK |
| Sender Pays Shipping | Determines whether shipping costs are paid by the sender or recipient. | Ticked or Unticked |
| Sender Pays Duties | Determines whether duties are paid by the sender or recipient. | Ticked or Unticked |
| Signature Option Type | Signature level required from the recipient. | INDIRECT |
| Requires Consignment Ref | Prevents invoices moving beyond Shipping if no consignment reference exists. | Ticked or Unticked |
Shipper Details
| Option | Description | Example |
|---|---|---|
| Shipper Address Line 1 | First address line. | 1-3 Priest Court |
| Shipper Address Line 2 | Second address line. | |
| Shipper Town/City | Town or city. | Grantham |
| Shipper Postal Code | Postcode. | NG31 7FZ |
| Shipper Country Code | Two-character country code. | GB |
| Shipper Contact Name | Contact name. | John Smith |
| Shipper Email Address | Contact email address. | JS@khaoscontrol.com |
| Shipper Telephone | Contact phone number. | 01234567890 |
| Shipper TIN | Tax identification number. | GB1234567890 |
| Shipper TIN Type | Tax identification number type. | BUSINESS_UNION |
Label Configuration
| Option | Description | Example |
|---|---|---|
| Label Stock Type | Label format used by FedEx. | PAPER_85X11_TOP_HALF_LABEL |
| Label Rotation | Used for thermal printers with roll stock. | |
| Label Printing Orientation | Used for thermal printers with roll stock. | |
| Label Resolution | Label image resolution. | 203 or 300 DPI |
| Printer Name | General courier option. Not used by the FedEx REST integration. |
Weight and Dimensions
| Option | Description | Example |
|---|---|---|
| Weight Units | Weight unit used when sending shipments. | KG or LB |
| Dimensions Units | Dimension unit used when sending shipments. | CM or IN |
| Weight Scale | Multiplier applied before sending weights to FedEx. | 0.001 |
| Nominal Weight | Used when a packed box calculates as zero weight. | 1 |
| Dimension Scale | Not used for this integration. | |
| Default Stock Weight | Weight 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
| Option | Description |
|---|---|
| Invoice Originator Name | Name displayed as the commercial invoice originator. |
| Invoice Special Instructions | Additional instructions shown on the commercial invoice. |
| Invoice Declaration Statement | Declaration text printed on the commercial invoice. |
| Letterhead Image | PNG or GIF image used as the invoice letterhead. |
| Signature Image | PNG or GIF image used for invoice signatures. |
International Shipping Options
| Option | Description |
|---|---|
| International Shipments | Enables this courier for international shipments. |
| Windsor Framework | Enables this courier for Windsor Framework green-lane shipments. |
| Incoterms | Incoterms code used for international shipments. Example: DDP |
Default Package Settings
These values are used when an invoice has not been packed into boxes.
| Option | Description |
|---|---|
| Default Package Width | Default package width. |
| Default Package Height | Default package height. |
| Default Package Length | Default 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
- Create a sales order as normal.
- Go to Sales Order | Detail | Additional.
- Select the FedEx REST courier.
- Save the order.
Orders imported into Khaos Control may have a courier assigned automatically, depending on the import method being used.
Process the Order
- Open Sales Invoice Manager.
- Progress the order through the normal stages.
- If required, pack the order using Pack Boxes in the Packing stage.
- Continue processing until the order reaches the Shipping stage.
Confirm Shipment
- Green-select the invoice.
- Click Confirm Shipment.
- Check the Shipment Date.
- Double-click the invoice to move it to the lower grid.
- If necessary, select a different courier by:
- Clicking the Courier column.
- Pressing F4.
- Selecting the required courier.
- Review the shipment weight.
If the calculated weight needs to be changed:
- Enter the correct value in the Actual Weight column.
- Click OK.
Assign the Shipment to FedEx
- 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.