POST client credentials (client_id, client_secret) to https://onlinetools.ups.com/security/v1/oauth/token with grant_type=client_credentials to receive a bearer token
Cache the token with its expires_in value and refresh proactively before expiry
Build a Rating request JSON body with shipment origin, destination, package weight/dimensions, and desired service code
POST to https://onlinetools.ups.com/api/rating/v1/Shop (or /Rate for a single service) with Authorization: Bearer <TOKEN>
Parse the RatedShipment array from the response, extracting TotalCharges for each service option
For sandbox testing, replace the base URL with https://wwwcie.ups.com/api/rating/v1/Shop
Known gotchas
UPS retired all SOAP/XML API access in June 2024; any legacy WebTools or Access Key-based integration will receive auth errors and must be migrated to OAuth 2.0
The token endpoint returns HTTP 401 if client credentials were created under a different UPS account than the shipper number used in the rating request — ensure credentials and account numbers match
Residential surcharges are not included in Shop responses unless you pass the ResidentialAddressIndicator flag; omitting it causes rate underestimates for last-mile deliveries
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp