Skip to main content
RapidDev - Software Development Agency
retool-integrationsREST API Resource

How to Integrate Retool with UPS API

Connect Retool to the UPS API using a REST API Resource with OAuth 2.0 client credentials authentication. Use the UPS Tracking, Rating, and Shipping APIs to build shipment management panels that track packages, calculate shipping rates, and manage order fulfillment — all without navigating the UPS web portal.

What you'll learn

  • How to register a UPS developer application and obtain OAuth credentials
  • How to configure Retool's Custom Auth for UPS OAuth 2.0 client credentials flow
  • How to query the UPS Tracking API to track packages by tracking number
  • How to use the UPS Rating API to calculate shipping costs from Retool
  • How to build an order fulfillment dashboard with real-time UPS shipment status
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate11 min read25 minutesOtherLast updated April 2026RapidDev Engineering Team
TL;DR

Connect Retool to the UPS API using a REST API Resource with OAuth 2.0 client credentials authentication. Use the UPS Tracking, Rating, and Shipping APIs to build shipment management panels that track packages, calculate shipping rates, and manage order fulfillment — all without navigating the UPS web portal.

Quick facts about this guide
FactValue
ToolUPS API
CategoryOther
MethodREST API Resource
DifficultyIntermediate
Time required25 minutes
Last updatedApril 2026

Build a UPS Shipment Management Panel in Retool

E-commerce operations teams spend significant time checking UPS shipment statuses across multiple orders, manually looking up tracking numbers, and calculating shipping costs for quotes. Retool solves this by pulling UPS data directly into an operations dashboard alongside order data from your database or e-commerce platform.

UPS transitioned its API suite to OAuth 2.0 in 2023, deprecating the older username/password authentication method. The modern UPS API uses standard client credentials flow — your application credentials are exchanged for an access token, and that token authenticates subsequent API calls. Tokens expire after approximately one hour, and Retool's Custom Auth system handles refresh automatically.

The most-used UPS API endpoints for Retool integrations are: Tracking v1 for package status and delivery updates, Rating v1 for shipping cost calculations before printing labels, Shipping v2403 for creating shipments and generating labels, and Address Validation for verifying customer addresses before shipping.

Integration method

REST API Resource

UPS's modern API uses OAuth 2.0 with the client credentials flow. You register an application in UPS's developer portal, obtain a client ID and secret, exchange them for an access token, and include the token in API requests. Retool's Custom Auth handles token refresh automatically. All requests are proxied server-side through Retool.

Prerequisites

  • A UPS account registered at developer.ups.com with a UPS application created
  • UPS OAuth 2.0 Client ID and Client Secret from the Developer Portal
  • A UPS account number (required for shipping label creation and some rate queries)
  • A Retool account with permission to create Resources and configure Custom Auth

Step-by-step guide

1

Register a UPS developer application and get OAuth credentials

Navigate to developer.ups.com and sign in with your UPS account credentials. Click 'Add Apps' or navigate to 'My Apps' and create a new application. Give the app a name like 'Retool Integration'. Select the API products you need: Tracking, Rating, and Shipping are the most common for operations dashboards. The application creation generates a Client ID and Client Secret. Copy both values — the Client Secret will only be shown once or can be regenerated if lost, but treat it as a permanent secret. In your Retool configuration variables (Settings → Configuration Variables), create three entries: UPS_CLIENT_ID with your client ID, UPS_CLIENT_SECRET with the client secret (mark as secret), and UPS_ACCOUNT_NUMBER with your UPS account number (needed for rating and shipping queries with your account's negotiated rates). Note that UPS's developer environment and production environment use the same credentials but different base URLs.

Pro tip: UPS provides a sandbox/testing environment. For testing, use the base URL https://wwwcie.ups.com instead of https://onlinetools.ups.com. Test credentials work in the sandbox with test tracking numbers provided in UPS's API documentation.

Expected result: You have UPS Client ID, Client Secret, and Account Number stored in Retool configuration variables.

2

Configure Retool REST API Resource with UPS OAuth

Create a REST API Resource in Retool for the UPS API. Set the Base URL to 'https://onlinetools.ups.com' (production) or 'https://wwwcie.ups.com' (testing). Under Authentication, select 'Custom Auth'. Configure the token endpoint call: POST to 'https://onlinetools.ups.com/security/v1/oauth/token' with Content-Type 'application/x-www-form-urlencoded' and body containing grant_type=client_credentials, client_id={{ retoolContext.configVars.UPS_CLIENT_ID }}, and client_secret={{ retoolContext.configVars.UPS_CLIENT_SECRET }}. Store the returned access_token in a variable. Set the Authorization header for all resource requests to 'Bearer {{ ups_access_token }}'. Also add a default 'Content-Type' header with value 'application/json' and a 'transId' header with a unique transaction ID (can use a timestamp: {{ Date.now().toString() }}) and 'transactionSrc' header with a descriptive value like 'retool-ops-dashboard'. The transaction headers are optional but recommended for UPS's logging.

resource-auth-config.js
1// UPS OAuth token request configuration:
2// POST https://onlinetools.ups.com/security/v1/oauth/token
3// Content-Type: application/x-www-form-urlencoded
4// Body:
5// grant_type=client_credentials
6// client_id={{ retoolContext.configVars.UPS_CLIENT_ID }}
7// client_secret={{ retoolContext.configVars.UPS_CLIENT_SECRET }}
8
9// Store: access_token from response
10// Token expires in: response.expires_in seconds (typically 14400 = 4 hours)
11
12// Resource headers:
13// Authorization: Bearer {{ ups_access_token }}
14// Content-Type: application/json
15// transId: {{ Date.now().toString() }}
16// transactionSrc: retool-ops-dashboard

Pro tip: UPS OAuth tokens expire after 4 hours (14400 seconds). Configure your Custom Auth refresh to trigger on 401 responses. The token endpoint also returns expires_in — you can store this value and proactively refresh before expiration.

Expected result: The UPS REST API Resource is saved with Custom Auth configured. A test query to /api/addressvalidation/v1/1 returns a response (even if with an error about missing request body, confirming auth works).

3

Query the UPS Tracking API

Create a query for tracking packages. Use GET method with path '/api/track/v1/details/{{ trackingInput.value }}'. The path parameter is the UPS tracking number. Add a query parameter 'locale' set to 'en_US' and 'returnSignature' set to 'false'. The response contains a 'trackResponse' object with a 'shipment' array. Each shipment has 'currentStatus' (the latest status), 'deliveryDate', and 'activity' array with full scan history. Add a transformer to extract the current status, last activity, and estimated delivery. Bind a TextInput component for the tracking number input and a Button to trigger the query. Display the tracking result in a well-formatted Container component showing the current status, delivery estimate, and activity timeline.

tracking_transformer.js
1// GET /api/track/v1/details/{{ trackingInput.value }}
2// Query parameters: locale=en_US, returnSignature=false
3
4// Transformer: extract tracking summary
5const shipment = data?.trackResponse?.shipment?.[0];
6if (!shipment) return { error: 'No tracking data found' };
7
8const activities = shipment.activity || [];
9const latestActivity = activities[0] || {};
10
11return {
12 tracking_number: shipment.trackingNumber,
13 status: shipment.currentStatus?.description || 'Unknown',
14 status_code: shipment.currentStatus?.code || '',
15 estimated_delivery: shipment.deliveryDate?.[0]?.date || 'Not available',
16 last_location: latestActivity.location?.address
17 ? `${latestActivity.location.address.city}, ${latestActivity.location.address.stateProvince}`
18 : 'Unknown',
19 last_activity: latestActivity.description || '',
20 last_updated: latestActivity.date
21 ? `${latestActivity.date} ${latestActivity.time || ''}`
22 : 'Unknown',
23 activity_history: activities.slice(0, 10).map(a => ({
24 date: `${a.date} ${a.time || ''}`.trim(),
25 description: a.description || '',
26 location: a.location?.address
27 ? `${a.location.address.city || ''}, ${a.location.address.stateProvince || ''}`.trim()
28 : ''
29 }))
30};

Pro tip: UPS tracking numbers have different formats for different service types (1Z for UPS accounts, T for UPS Mail Innovations). The Tracking API handles all UPS tracking number formats automatically.

Expected result: Entering a valid UPS tracking number and clicking the tracking button returns current shipment status, estimated delivery date, and activity history.

4

Build a shipping rate calculator

Create a POST query using the UPS Rating API to calculate shipping rates. Use path '/api/rating/v2403/Rate' and set the method to POST. The request body is a JSON object with a RateRequest wrapper containing shipper information (your UPS account number), ship-from and ship-to addresses, and package details (weight, dimensions, packaging type). The response returns rates for the requested service type, or use service code '03' (UPS Ground) and '01' (Next Day Air) for comparison. Add form components to your Retool app for origin/destination zip codes, weight, and dimensions. Wire the form submit button to run the rating query and display results in a Table component showing service type, rate, and transit days.

rating_request.json
1// POST /api/rating/v2403/Rate
2// Request body:
3{
4 "RateRequest": {
5 "Request": {
6 "RequestOption": "Shop"
7 },
8 "Shipment": {
9 "Shipper": {
10 "ShipperNumber": "{{ retoolContext.configVars.UPS_ACCOUNT_NUMBER }}",
11 "Address": {
12 "PostalCode": "{{ originZip.value }}",
13 "CountryCode": "US"
14 }
15 },
16 "ShipTo": {
17 "Address": {
18 "PostalCode": "{{ destZip.value }}",
19 "CountryCode": "US",
20 "ResidentialAddressIndicator": ""
21 }
22 },
23 "ShipFrom": {
24 "Address": {
25 "PostalCode": "{{ originZip.value }}",
26 "CountryCode": "US"
27 }
28 },
29 "Service": { "Code": "03" },
30 "Package": {
31 "PackagingType": { "Code": "02" },
32 "PackageWeight": {
33 "UnitOfMeasurement": { "Code": "LBS" },
34 "Weight": "{{ weight.value }}"
35 }
36 }
37 }
38 }
39}

Pro tip: Use RequestOption: 'Shop' in the rate request to get rates for all available UPS services in one response, rather than making separate requests for Ground, 2-Day, and Next Day Air.

Expected result: Entering origin/destination zip codes and package weight displays a table of UPS shipping rates across all available service levels with transit time estimates.

5

Build a multi-shipment status monitoring table

For order fulfillment dashboards, you need to track multiple shipments simultaneously rather than one at a time. Create a query that reads tracking numbers from your orders database (using a separate PostgreSQL or REST API resource), then uses a Retool Workflow to batch query UPS tracking status for each shipment and store results back into a tracking_status table. Alternatively, for smaller volumes (under 20 active shipments), use Retool's query chaining: a JavaScript query loops through tracking numbers, calling the UPS tracking query for each, and aggregates results into an array. Display the results in a Table with conditional row highlighting — green for delivered, yellow for in transit, red for exception. For complex fulfillment automation connecting UPS with your order management system and notification workflows, RapidDev's team can architect the complete solution.

batch_tracking.js
1// JavaScript query: batch track multiple shipments
2// Reads tracking numbers from database query 'getOrders.data'
3const orders = getOrders.data || [];
4const trackingNumbers = orders
5 .filter(o => o.tracking_number && o.tracking_number.trim())
6 .map(o => o.tracking_number.trim());
7
8// Return array for display while workflow fetches live data
9// (Use Retool Workflows for actual batch UPS API calls)
10return trackingNumbers.map(tn => ({
11 tracking_number: tn,
12 status: 'Pending refresh',
13 last_updated: new Date().toLocaleDateString()
14}));

Pro tip: UPS does not have a batch tracking endpoint — each tracking number requires a separate API call. For large shipment volumes, use Retool Workflows with UPS webhooks instead of polling, so UPS pushes status updates to you rather than requiring you to query.

Expected result: The shipment monitoring table displays all active orders with their tracking numbers and last-known UPS status, with color coding for at-risk or delayed shipments.

Common use cases

Build a multi-order shipment tracking dashboard

Display all recent orders from your database alongside real-time UPS tracking status. Query tracking numbers from your database and batch them against the UPS Tracking API to show current package status, estimated delivery date, and last scan location. Highlight delayed or exception shipments requiring customer communication.

Retool Prompt

Build a Retool fulfillment dashboard that reads tracking numbers from a PostgreSQL orders table, queries UPS Tracking API for each, and shows a unified view of order status, shipment status, estimated delivery, and current package location.

Copy this prompt to try it in Retool

Create a shipping rate calculator for operations teams

Build a Retool tool where operations staff can enter a package weight, dimensions, origin zip, and destination zip to get UPS shipping rates across all service levels (Ground, 2-Day Air, Next Day Air). Display rates in a comparison table to help select the most cost-effective service for each shipment.

Retool Prompt

Create a Retool shipping rate calculator with form fields for origin zip, destination zip, weight, and dimensions. On submit, call UPS Rating API and show a table comparing rates for all UPS service types with transit days and price.

Copy this prompt to try it in Retool

Build an exception and delay monitoring panel

Create a Retool app that runs on a schedule to check all in-transit shipments for delivery exceptions, delays, or weather holds. Surface these in a prioritized list for customer service teams to proactively communicate with affected customers before they contact support.

Retool Prompt

Build a Retool exceptions panel connected to UPS Tracking that shows all shipments with status 'Exception' or delivery date past today's date, sorted by days delayed, with customer email addresses for outreach.

Copy this prompt to try it in Retool

Troubleshooting

OAuth token request returns 'invalid_client' error

Cause: The Client ID or Client Secret does not match the application registered in UPS Developer Portal, or the application is in a different environment (testing vs production). Also possible: the application was not activated or approved after creation.

Solution: Log into developer.ups.com and verify the application status is 'Active'. Copy the Client ID and Secret directly from the portal rather than from notes. Ensure you are using the matching base URLs: wwwcie.ups.com for test credentials, onlinetools.ups.com for production credentials.

Tracking API returns 'No tracking information found' for a valid tracking number

Cause: The tracking number may be too new (UPS takes 1-2 hours to enter tracking data after label creation), may have expired from UPS records (retained for ~120 days), or the test environment does not have data for that tracking number.

Solution: For testing, use the UPS-provided sample tracking numbers in the API documentation which have pre-populated test data. For production, verify the tracking number was created more than 2 hours ago. Check that you are querying the correct environment (production vs testing).

Rating API returns empty rates or 'Service not available for origin/destination'

Cause: The service type requested may not be available for the origin/destination pair, or the account number is missing or invalid. UPS Ground is not available for all international destinations.

Solution: Use RequestOption: 'Shop' to get all available services instead of specifying a single service code. Verify your UPS account number is correctly configured — account number is required for negotiated rates. For international shipments, include CountryCode fields in both origin and destination addresses.

Best practices

  • Store UPS Client ID and Client Secret in Retool configuration variables as secrets — never include them in request bodies or URLs
  • Use UPS's test environment (wwwcie.ups.com) with test credentials during development to avoid creating real shipments or incurring charges
  • Cache tracking query results for 15-30 minutes — package tracking data does not change more frequently than that in normal circumstances, and caching reduces API calls
  • Include transaction IDs in UPS API requests (transId header) to help UPS support diagnose issues when you contact them about specific API calls
  • Build graceful error handling for tracking queries — UPS tracking data may be temporarily unavailable for just-created shipments, and transformers should handle missing data without JavaScript errors
  • For high-volume shipment monitoring, set up UPS Quantum View webhooks to push status updates to a Retool Workflow endpoint rather than polling individual tracking numbers

Alternatives

Frequently asked questions

Do I need a UPS account to use the UPS API?

You need a UPS.com user account to register as a developer and obtain API credentials. A UPS shipper account number is additionally required for rating with negotiated rates and for creating shipping labels. Basic tracking functionality only requires the developer credentials, not a shipper account number.

Can I create UPS shipping labels from Retool?

Yes. Use the UPS Shipping API (POST /api/shipments/v2403/ship) to create shipments and generate labels. The response includes a base64-encoded label image (GIF or PDF) that you can display in a Retool Image component or trigger as a download. Shipping label creation requires your UPS account number and a valid ship-from address registered with UPS.

How long does UPS OAuth access token last?

UPS OAuth access tokens expire after 4 hours (14,400 seconds as indicated by the expires_in field). Retool's Custom Auth refresh handles this automatically when configured to refresh on 401 responses. Unlike some providers, UPS does not provide a refresh token — you must re-authenticate with client credentials each time the token expires.

Can I track USPS or FedEx packages using the UPS API?

No. The UPS Tracking API only tracks packages shipped via UPS services. For multi-carrier tracking in a single Retool app, you need separate resources for each carrier's API (UPS, FedEx, USPS) or use a multi-carrier aggregator like ShipStation or AfterShip which tracks packages across all carriers through a single API.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Integrations are where projects stall

We wire Retool integrations like this one every week — auth, webhooks, edge cases included. Fixed-price builds from $13K, delivered in 6–10 weeks.

Talk to an integration engineer

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.