Fedex web services sample code java

Screenshot of ship api page

Screenshot of create shipment page

Sign up or log in

Log in with your fedex.com user ID and password to begin integrating with FedEx APIs and webhooks.

If you do not have a user ID yet, you can sign up for free.

Create or join an organization.

Either create an organization, if one does not yet exist for your company, or join your company’s existing organization.

To create an organization:

If you create an organization, you will automatically be listed as the Admin of that organization.

To create your own organization, Click on Create Organization in the left-hand navigation.

Provide organization information

screenshot of Create your organization page

To join an organization:

You can join an already existing organization by completing the following steps:

Add a shipping account.

screenshot of Add Shipping Account page

screenshot of Execute EULA page

Step 5: Add a billing account

An admin can add a billing account to their organization and assign it to projects. To begin, navigate to the Billing tab on the Manage Organization page. From there, you can open a new billing account on fedex.com and add the billing account to your organization on the FedEx developer Portal by completing the following steps:

1. Open a new billing account

2. Add billing account to your organization

create billing account

3. Assign billing account to a project

Step 6: Add users to your organization

An admin can invite users to their organization and assign them to roles and projects. To begin, click the Add Users button from the Users tab of the Manage Organization page. From there, you can add users by completing the following steps (those marked with an * are optional):

1. Enter users email addresses

2. Select user roles

3. Assign users to a project

Add shipping account

An admin will always have access to all projects, but a contributor or viewer must be assigned to a project (unless a contributor creates a project, in which case they will be automatically assigned to that project).

Whether a user has accepted an invite yet or not, you can quickly update their projects or roles straight from the the Manage organization page, under the Users tab.

Add shipping account 2

  1. Create a project to get credentials
  2. Integrate APIs & test your implementation
  3. Move your project to production
  4. Complete your certification

Create a project to get credentials.

On the My projects page, go to the API tab.

An admin or contributor for your organization can create an API project by clicking on the Create a API Project button.

Before getting started, you will first need to let us know why you need to access FedEx APIs. A modal will appear and present you with dropdown options. You should select the option that best identifies your business needs for integrating with FedEx APIs.

If you identify as a shipper, you can begin to create your project. This is a three step process:

Select the API(s) you want to include in your project. Based on the API(s) you select, you may need to make some additional selections.

If you select Track API, you will also need to:

create API project

Enter some project specifics, including name and shipping location.

step2

Review your project details, then accept the terms and conditions.

step3

Integrate APIs & test your implementation

On the Project overview page, retrieve your test credentials — API key, secret key, and shipping
account(s) — from the Test key tab. Next, you can.

API project overview

Move your project to production

Click the Production key tab. You can now start to move your project to production by
completing the following steps.

Within the Configure project step:

production key tab

Within the Get project keys step:

production key step2

You will now be brought back to the Project overview page. Here you can add more accounts associated with your project.

On the Project overview page:

This will bring you to the API key page where you can add any additional accounts you want to associate with your production key for this project.

API project overview after steps

Complete your certification

  1. Some APIs require shipping label certification for use in our production environment. Complete the certification process for any APIs in your project with this requirement.

API Certification

  1. After all APIs have been certified and enabled, update your API requests by replacing the test URIs, keys and shipping accounts with the production URIs, keys and shipping account.
  2. Retest your implementation in the production environment using sample data.
  3. Enjoy the benefits of your new integration!

Prerequisites to create a webhook project

  1. Learn about pricing
  2. Complete billing and shipping account set up
  3. Create a valid (call back) URL in your destination application/platform
  4. Generate security token
  5. Test webhook URL
  6. Validate destination (call back) URL

Create a webhook project

Prerequisites to create a
webhook project

Learn about pricing

Subscribers are charged a monthly fee based on the count of track numbers. please refer to Shipment Visibility Webhook overview page to learn more about pricing.

Complete billing and shipping account set up

See the Create Organization Getting Started Guide for your organization admin to complete the billing and shipping account set up. See the Create Organization getting started guide for step-by-step instructions.

step_2_img_1

step_2_img_2

Create a valid (call back) URL in your destination application/platform

Create a valid (call back) URL in your destination application/platform to receive authentication codes/messages and Shipping Visibility Webhook payload notifications from FedEx.

URL requirements:

• Only HTTPS protocol is allowed • Your URL will be blocked if it meets any of the following conditions: • Includes RFC1918 IP space • Includes fedex.com or any of its subdomains • Includes IP addresses in the URL ( including localhost, 127.0.0.1)

Generate security token

This security token can be used as a secret key to authenticate and validate information transmitted between your organization and FedEx.

Security token requirements:

• A minimum length of 25 characters and a maximum length of 100 characters • 1 upper case character • 1 lower case character • 1 numeric character

Security token

Test webhook URL

Testing your URL is an optional step that you may find helpful.

Testing can help you get a better idea about whether the URL you created in step 1 is valid. It allows FedEx to identify your URL and build a connection with your URL to send data. Testing can also provide you with sample test data that can help you check and confirm whether you are able to process tracking data provided in your application. Testing does not, however, authenticate your URL.

Visit our webhook documentation to learn how to test your webhook URL.

Create a webhook project

Create a webhook project to receive configured payload notifications

On the My Projects page, go to the Webhooks tab.

An admin for your organization, you can create a webhook project by clicking on the Create a Webhook project button.

You can begin to create your project by completing the following steps:

screenshot of create a webhook page

  1. Identify your business needs

img9

  1. Confirm billing account and select features

feature selection

  1. Configure project details
FIELD NAME DESCRIPTION

Webhook project name

This is a non-empty, unique webhook project name
and should not be repeated in any other webhook
project.
• The webhook project name is auto-populated
with a suggested name, which can be edited as
needed.

Destination (call back) URL

This is the URL where you will receive the tracking
event data/payload.
• You should provide a working and valid
destination (call back) URL.
• The destination (call back) URL provided must be
in the standardized syntactical format (secure
https URL, don’t include fedex.com or its sub
domains in the URL).
• You can repeat the destination (call back) URL in
multiple webhooks.

This is used as shared secret to authenticate and
validate the Shipment Visibility Webhook response.
• Token value must be a minimum length of
25 characters and maximum of 100 characters.
• At least 1 uppercase, 1 lowercase, and 1 numeric
character are required.
• You can repeat this security token in
multiple webhooks.
• The security token will be used to create a hash-
based
message authentication Code (HMAC) signature
for response validation.

Payload language (country)

Select the preferred language for your tracking data
translations from the drop-down list.

Select the type of response in which the tracking
data needs to be received.
• Detailed tracking response: response type
consists of secured tracking data with entire
history of events
• Event-specific tracking response: response
type consists of secured tracking data with only
the most recent event information

Provide an email address to receive email
notifications when there are changes made to your
webhook project (e.g., created, edited, canceled).


Email language (country)

Select the preferred language in which you would
like to receive webhook email notifications from
FedEx.

These are the supported languages for email
notifications:
• English (United States)
• Spanish (United States)

create webhook step2

• Review your configured project details.
• Read and accept the Developer Portal License Agreement, and acknowledge that you do not
intend to distribute your application.
• Once you click the Create button:

1. If your create request was successfully validated and processed, you will be brought to a confirmation screen.
• If validation is unsuccessful or fails, there will be an error message.
2. Your Shipment Visibility Webhook project will then have a system generated webhook ID and be shown to have an “Active” status.

Accept_terms_img

Still have questions? We’ve got answers

What is a webhook and what are the benefits? Created with Sketch.

A webhook is an HTTPS-based callback function that allows lightweight, event-driven communication between 2 applications. In this case, your application and FedEx. Using webhooks allows you to receive near real-time updates about the events you want to know about. Learn more about the benefits of FedEx webhooks.

readmore_img

Read more

Which shipments are supported through FedEx Shipment Visibility Webhook? Created with Sketch.

FedEx Ground, FedEx Ground Economy, FedEx Express and FedEx Freight (9-digit account number only) shipment tracking updates are supported through FedEx Shipment Visibility Webhook.

readmore_img

Read more

What events are available for subscription via FedEx Shipment Visibility Webhook? Created with Sketch.

The Shipment Visibility Webhook enables real-time push of in-transit shipment tracking events, ranging from ‘Label Creation’ to ‘Delivered’, including Picture Proof of Delivery.

readmore_img

Read more

  1. FedEx creates Compatible provider organization.
  2. Accept invite.
  3. Invite users to your organization.
  4. Select APIs you need for your solution.
  5. FedEx creates project(s).
  6. Integrate APIs into your application and certify to the Compatible Program.
  7. FedEx moves project(s) into production.
  8. Generate Production Secret Key.

FedEx creates Compatible provider organization

Accept invite

Invite users to your organization.

Manage org

Select APIs you need for your solution.

API Catalog

Address validation API

Address validation API-intro

FedEx creates project(s).

Once the PIW has been approved, FedEx will create your project(s). Each version of each of your solutions will have a separate project within the FedEx Developer Portal. If a user is not an Admin of the organization, they would need to be invited to view each project.

This is also when the FedEx Compatible team along with the FedEx CTC and certification teams will organize a technical demonstration for the APIs with your team. The FedEx team will discuss the new features and functionality available with the version of APIs you are adopting. The team will be able to address technical questions regarding APIs, API testing and all processes that need to be completed to start the process of ‘certification*’ for APIs.

* Certification – The process defined by the FedEx Compatible Program to satisfy Program Compliance requirements. Compatible Program Certification is required to ensure that all Compatible Providers implement, market and distribute FedEx technology to shippers (customers) as defined by FedEx technology & service standards.

Integrate APIs into your application and certify to the Compatible Program.

  1. You will now have access to your Test API Key and Test Secret Key to start running transactions. Retrieve them from the Test Key tab of the Project Overview page.

API project overview

  1. In order to create customer keys, you will need to use the Credential Registration API, which is a private API only found in the API section of each of your projects.
  2. Once you’ve created a few customer keys, go ahead and request an OAuth access token to be used with every API transaction. The session for the token is valid only for an hour, so you will need to programmatically code your application to refresh the token before the session expires. Refer to the API Authorization docs for more details. When viewing sample code, make sure “Reseller” is chosen from samples dropdown.

API Authorization

  1. Select docs for the APIs on your Test Keys page and read the business context to best understand how to use the selected API. Review example requests for the endpoint that match your desired integration.
  2. Implement your calls to these endpoints as described in the example requests, configuring them to use your test credentials.
  3. Verify that the received API call responses are matching those shown in the documentation.
  4. Completely test your implementation within the FedEx test environment using test credentials and the FedEx test URIs.
  5. After fully testing your solutions, certify each solution in Salesforce. FedEx will fully review everything submitted and update you once your certification is approved.