Authentication overview

UPS provides a set of APIs designed to integrate its shipping and logistics services directly into business applications. Secure access to these APIs is managed through an authentication process that verifies the identity of the requesting application or user. This process ensures that only authorized entities can perform actions like generating shipping labels, tracking packages, or calculating rates, thereby protecting both the user's account and the integrity of UPS's systems. The authentication model is built around credentials tied to a registered UPS business account, which are then used to authorize API requests.

The UPS Developer Kit serves as the central hub for accessing documentation, registering applications, and managing credentials. Developers are typically required to register for an account and obtain specific keys to begin integration. This structured approach to access control aligns with common industry practices for protecting sensitive API endpoints, similar to how other platforms manage their developer access, for example, the Google Cloud API key authentication process.

Supported authentication methods

UPS primarily utilizes a credential-based authentication method for its APIs, combining multiple identifiers to establish a secure connection. This approach helps to verify the legitimacy of each API request.

Method When to Use Security Level
License Key, User ID, Password For all API interactions requiring account-specific access, such as shipping, tracking, and rating. High. Requires a combination of unique identifiers and a secret password, providing multi-factor credential security.
OAuth 2.0 (for specific services) Certain newer or specialized UPS APIs may adopt OAuth 2.0 for delegated authorization, particularly for third-party integrations. Refer to specific API documentation. High. Provides token-based authorization without exposing user credentials directly to client applications. For general information on such flows, consult the OAuth 2.0 specification.

The core authentication mechanism for most UPS APIs involves sending a unique License Key, a registered User ID, and the associated Password with each API request. These credentials are typically included in the request headers or body, depending on the specific API and protocol (SOAP or RESTful). This method ensures that only applications with valid, registered credentials can access and manipulate data related to a UPS account.

Getting your credentials

Accessing the UPS APIs requires obtaining specific credentials from the UPS Developer Kit. The process generally involves the following steps:

  1. Register for a UPS.com account: If you do not already have one, you will need to create a UPS.com account. This account will be linked to your API credentials.
  2. Enroll in the UPS Developer Kit: Navigate to the UPS Developer Kit website. Here, you will find options to register for API access. This typically involves agreeing to terms and conditions.
  3. Request an Access Key (License Key): Within the Developer Kit, you will initiate a request for a License Key. This key is a unique identifier for your application or integration.
  4. Create a User ID and Password: For many UPS APIs, you will also need to establish a specific User ID and Password that will be used in conjunction with your License Key for authentication purposes. This might be distinct from your main UPS.com login credentials.
  5. Test in the Development Environment: UPS typically provides a development or sandbox environment where you can test your API integrations using your new credentials without affecting live production data. Utilize this environment to thoroughly test authentication and API functionality.
  6. Request Production Access: Once your integration is fully tested and verified in the development environment, you will generally need to request production access. This often involves a review process by UPS to ensure compliance with their guidelines.

It is important to follow the detailed instructions provided on the UPS Developer Kit documentation, as the exact steps and requirements may vary slightly depending on the specific APIs you intend to use.

Authenticated request example

While the exact structure varies between SOAP and RESTful APIs provided by UPS, a common pattern for authentication involves sending a security header or body element containing the License Key, User ID, and Password. Here is a conceptual example for a RESTful API request to the UPS Tracking API, assuming a JSON payload and authentication details in custom headers, which is a common approach for secure API interactions.

Example: Authenticated Tracking API Request (Conceptual)

POST /track/v1/details HTTP/1.1
Host: onlinetools.ups.com
Content-Type: application/json
AccessLicenseNumber: YOUR_LICENSE_KEY
Username: YOUR_USER_ID
Password: YOUR_PASSWORD

{
  "TrackRequest": {
    "Request": {
      "TransactionReference": {
        "CustomerContext": "CustomerProvidedTrackingID"
      }
    },
    "TrackingNumber": "1Z999AA10123456784"
  }
}

In this conceptual example:

  • AccessLicenseNumber: Replaced with the License Key obtained from the UPS Developer Kit.
  • Username: Replaced with the User ID you created for API access.
  • Password: Replaced with the password associated with your API User ID.
  • The request body contains the specific data required for the tracking request, such as the TrackingNumber.

For precise implementation details, including header names and payload structures, developers should consult the specific API documentation available on the UPS Developer Kit, such as the UPS Track API JSON specification.

Security best practices

Adhering to security best practices is crucial when integrating with the UPS APIs to protect sensitive shipping information and prevent unauthorized access to your account. The following recommendations align with general API security guidelines:

  • Keep Credentials Confidential: Your UPS License Key, User ID, and Password are akin to sensitive account login details. Never hardcode them directly into client-side code (e.g., JavaScript in a browser) or expose them publicly. Store them securely in environment variables, a secrets management service, or a secure configuration file on your server.
  • Use HTTPS/TLS for All API Communication: Always ensure that all communication with UPS API endpoints occurs over HTTPS (TLS). This encrypts data in transit, protecting your credentials and sensitive shipping data from eavesdropping. All modern UPS APIs mandate HTTPS, but it is important to verify your client library or application is configured correctly. This aligns with standard practices for securing web contexts.
  • Implement Least Privilege: If UPS offers different credential types or scopes, use the least privileged credentials necessary for your application's function. For instance, if an API only needs to track packages, avoid using credentials that grant full shipping and billing access.
  • Rotate Credentials Regularly: Periodically change your API User ID password and, if supported by UPS, your License Key. Regular rotation minimizes the impact of a compromised credential, should one occur.
  • Error Handling and Logging: Implement robust error handling to prevent sensitive information (like credentials) from being exposed in error messages. Log API requests and responses securely for auditing and debugging, but ensure credentials are redacted from logs.
  • Input Validation: Validate all input data sent to UPS APIs to prevent injection attacks and ensure data integrity. Malicious input could potentially be used to exploit vulnerabilities or cause unexpected behavior.
  • Monitor API Usage: Regularly monitor your API usage for any unusual patterns or spikes that could indicate unauthorized activity or a compromised key.
  • Secure Your Server Environment: The server or application where your UPS API credentials are stored and used must be secured. This includes keeping operating systems and libraries updated, using firewalls, and restricting access to authorized personnel only.
  • Review UPS Documentation Updates: Stay informed about any security updates, new features, or changes to authentication protocols announced by UPS in their Developer Kit documentation.