Work with UPS Authentication (WRKUPSAUTH)

Your UPS Toolkit for i installation will need to be configured to access the UPS APIs. This requires you to provide UPS API credentials, known as your Client ID and Client Secret. The Client ID and Client Secret are provided to you by UPS.

NOTE: The Client ID and Client Secret are different from your username and password used to access the UPS website, and different from the UPS access key which UPS APIs previously used for authentication.

You will assign your Client ID and Client Secret a name, and optionally a description. The name can be anything you want, but it must match the value you set for the USERID fields in request tables prior to calling UPS APIs.

You will also need to configure whether your API requests will be performed against the UPS “Customer Integration Environment” endpoints (used for testing and development), or the UPS “Production” endpoints, which use live UPS data, and any shipments created will incur charges. Which endpoint to use can be configured on a per API basis.

To begin configuration, ensure your UPSTI library is in your library list, and run the WRKUPSAUTH command. You should see a screen similar to the below image:

Work with UPS Authentication (WRKUPSAUTH)

Next, press F6 to Create a new application, which will present you with the following screen:

Work with UPS Authentication (WRKUPSAUTH)

To create an application, you need to provide a name, the Client ID, and the Client Secret. You can optionally provide a description.

You should also review which environment you wish to use for each API. An environment must be set to *CIE to use the UPS Customer Integration Environment, or *PROD to use the UPS Production environment. By default, Address Validation, Rating, Time in Transit, and Tracking are set to *PROD as these APIs only retrieve information from UPS. The other APIs are set to *CIE by default as they will initiate actions and may cause you to incur charges if the API is called using the UPS Production environment.

Work with UPS Authentication (WRKUPSAUTH)

Once you have finished your configuration, press Enter, and when prompted to confirm, type Y. You should be returned to the list view and see your newly created record.

Work with UPS Authentication (WRKUPSAUTH)

Aside from creating a new record, you can use the provided options to Edit, Copy, Delete, Display, or Rename. For example, using option 5 to Display the record we just created will show the following screen:

Work with UPS Authentication (WRKUPSAUTH)

This screen shows the status of what are referred to as your CIE Token and Production Token. These tokens are retrieved from UPS using your Client ID and Client Secret, and are used to authenticate you to the UPS APIs. These tokens automatically expire after a period of time set by UPS. UPSTI will handle requesting and renewing these tokens (if needed) each time you call one of the UPS APIs.