Skip to main content
HomeBlogGuidesHow to Get UPS API Access and Make Your First Request

How to Get UPS API Access and Make Your First Request

17TRACK

To get UPS API access, create or sign in to a UPS account, open the UPS Developer Portal, create an application, and add the API your application needs. The portal provides the credentials and documentation for making requests. For a first test, obtain an OAuth access token with your client ID and client secret, then use that token to call a UPS API endpoint in the test environment.

How to Get UPS API Access and Make Your First

The steps below use shipment tracking as an example. If you need to create labels, calculate rates, or perform another task, select the corresponding API in the portal and follow its documentation instead. API access, account permissions, request fields, and available test data can differ by product.

Before you create an application

Decide what your software must do with UPS data. This choice determines which API to add to your application and what information you will need to supply in a request. A tracking integration typically starts with a UPS tracking number. A shipping integration has a different purpose and requires shipment details; obtaining a tracking token does not, by itself, prepare an application to create shipments.

Have a UPS account you can use to sign in to the Developer Portal. If you are building an integration for an employer or client, establish who owns the UPS account and application before generating credentials. That owner should be able to manage access, approve the intended use, and retain control if the developer who sets up the integration leaves the project.

Choose a safe place to store credentials before copying them from the portal. A client secret belongs on a server or in an appropriate secrets manager, not in a public repository, browser script, or mobile app package. You will also need a tool that can send HTTP requests, such as a terminal with curl. No full application is required for the initial test.

Get access in the UPS Developer Portal

  1. Sign in and find the API catalog. Start at the UPS Developer Portal. Review the API catalog for the product that matches your task. Read its authentication, request, and response documentation rather than assuming that settings for one UPS API apply to every other API.
  2. Create an application. Follow the portal’s application setup flow and select the APIs your application will use. If the portal asks for an account or additional information, provide the details associated with the intended integration. Complete any access steps shown for that product.
  3. Record the credentials securely. Identify the application’s client ID and client secret. Keep them separate from source code and share them only with people and systems that need them. If a secret is exposed, use the portal’s available credential-management process to replace it.
  4. Check the environment and product documentation. UPS distinguishes testing from production use. Confirm the base URL, authorization method, endpoint path, required headers, and sample requests in the documentation displayed for your selected API. Do not treat a successful test-environment call as proof that production access or account setup is complete.

Portal labels and approval steps may change. The practical checkpoint is whether you can see an application with credentials and documentation for the API you intend to call. If you cannot, resolve that access issue in the portal before debugging request code.

Make the first request: obtain an OAuth token

UPS APIs use OAuth access tokens for authenticated requests. For a server-to-server client-credentials flow, your application first sends its client ID and client secret to a token endpoint. The response contains an access token that your application sends with subsequent API requests. Check your selected API’s documentation to confirm that this is the appropriate flow for your use case; an integration acting on behalf of another account may require a different authorization setup.

The following curl example requests a token from the UPS test environment. Replace the placeholders locally. Basic authentication combines the client ID and client secret; curl -u constructs that header for this request.

curl --request POST \
  --url 'https://wwwcie.ups.com/security/v1/oauth/token' \
  --user 'YOUR_CLIENT_ID:YOUR_CLIENT_SECRET' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data 'grant_type=client_credentials'

Inspect the HTTP status and response body. On success, locate the access_token and its expiration information in the response. Do not paste a live token into a ticket, chat, or public log. If the request fails, check the client ID and secret, the environment, the selected authorization flow, and whether the application has been set up for the intended API. Recheck the portal documentation if the endpoint or authentication instructions shown there differ from this example.

Getting a token is an authentication test, not an end-to-end API test. It tells you that the token request worked under those conditions. It does not establish that a particular tracking number will return a shipment, that your application can use every UPS product, or that production requests are enabled.

Use the token to test a tracking request

If you added the UPS Tracking API, you can use its tracking-details endpoint as the next test. The inquiry number belongs in the URL path. In the example below, replace both placeholders. Verify the endpoint and any required or recommended headers against the current Tracking API reference in your Developer Portal before running it.

curl --request GET \
  --url 'https://wwwcie.ups.com/api/track/v1/details/YOUR_TRACKING_NUMBER' \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'Accept: application/json' \
  --header 'transId: first-tracking-test' \
  --header 'transactionSrc: my-test-app'

Use a tracking number or test case appropriate for the environment and your authorized use. Do not assume that an arbitrary live tracking number will produce a useful result in a test environment. If the portal provides product-specific examples or test data, follow those instructions. Never publish someone else’s tracking number or shipment response as a demonstration.

A successful HTTP response needs interpretation. Check that the response corresponds to the inquiry number you sent and examine the returned shipment and status fields as documented. A valid request can still return a business-level result that is not the shipment history you expected. Conversely, an authentication or validation error may occur before UPS attempts to find a shipment.

Diagnose a failed first call

Work from the request outward. Changing several settings at once makes it harder to find the cause.

  • The token request fails: Confirm that you are using the credentials for the application you created, that they have not been copied with extra characters, and that you are calling the token endpoint for the environment being tested. Confirm that the request sends form-encoded grant_type=client_credentials and the authentication method specified by UPS.
  • The API reports an authorization problem: Check that the access token has not expired, that the Authorization header uses the Bearer scheme, and that the application includes the API you are calling. Review any account or product access requirements shown in the portal.
  • The API reports a malformed request: Compare the URL path, HTTP method, headers, and parameter format with the reference for that exact endpoint. Avoid copying a request for a different UPS product and changing only its URL.
  • The response contains no expected shipment: Verify the inquiry number, its format, the test data available in the selected environment, and what the API documentation says about the result. A missing tracking record is not automatically a credential failure.
  • The request works locally but not in your application: Compare the outgoing HTTP requests, including the environment and headers. Check whether your application is using an expired token or an old secret. Remove credentials and personal shipment details from any logs you retain for troubleshooting.

Keep the HTTP status, a sanitized response body, and a request identifier when troubleshooting. If you need UPS support, these details are more useful than a description such as “the API does not work.” Do not include the client secret or an unredacted access token in a support message.

Move from a test call to a maintainable integration

After your first successful request, make token handling part of the application rather than manually copying tokens into commands. Store credentials securely, request tokens on the server, and renew them according to their reported expiration. Handle unsuccessful HTTP responses explicitly; do not treat every response body as tracking data. If you retry a request, use a controlled policy that takes the operation and the API’s documented error guidance into account. A shipment-creation request, for example, deserves more caution than a read-only lookup because repeating a write operation can have different consequences.

Keep test and production configuration separate. That includes credentials, base URLs, test numbers, and any account identifiers your selected API requires. Before using production, confirm that the application and UPS account have the access needed for that API, run an authorized production check, and verify how your system handles empty results and errors. Add monitoring that distinguishes token failures from API validation problems and shipment-level results.

Choose the narrowest integration that solves your actual problem. If your application only needs UPS tracking, begin with the Tracking API and its documented fields. If it later needs shipping or rates, review those products independently rather than extending the tracking request beyond its purpose. This keeps the first release easier to test and makes access issues easier to isolate.

FAQ

Do I need a UPS account to use the API?

You need access to the UPS Developer Portal to create and manage an application. The account or approval requirements for a particular API can vary, so check that product’s setup instructions in the portal. If you are integrating on behalf of a business, clarify which UPS account should own the application before creating credentials.

Is a client ID the same as an access token?

No. The client ID identifies your application, and the client secret is a credential associated with it. In the client-credentials flow, you use them to request a time-limited OAuth access token. The token is what you send in the Authorization: Bearer header on the subsequent API call.

Can I use test credentials against a production URL?

Do not assume credentials or access are interchangeable between environments. Use the environment, credentials, and base URL specified for your application in the UPS Developer Portal. Validate production access separately before deploying an integration.

Why did token generation succeed but my tracking request fail?

Token generation and tracking are separate steps. Check whether your application includes the Tracking API, whether the token is valid, whether the endpoint and headers match its documentation, and whether the inquiry number is suitable for the environment. The response status and body should help distinguish an access problem from a request or shipment-result problem.

Should I put the client secret in a website or mobile app?

No. A secret embedded in client-side code can be extracted by users. Keep the credential in a controlled server-side environment and have your website or app communicate with your server for operations that require it.

Sources