Obtain a UPS OAuth 2.0 access token by POSTing to the UPS OAuth token endpoint with your client ID and secret using the client credentials grant; store the returned 'access_token' and its expiry (verify endpoint, grant type, and token TTL in current UPS developer docs).
POST to the UPS Shipping REST API shipment endpoint (verify current path in docs) with a request payload containing 'ShipmentRequest' with 'Shipment' object including 'Shipper', 'ShipTo', 'ShipFrom', 'Service' (with a 'Code' for the service level, e.g., '03' for UPS Ground; verify codes in current docs), 'Package' array with 'PackagingType', 'Dimensions', and 'PackageWeight'.
Include 'LabelSpecification' in the request with 'LabelImageFormat' ('GIF', 'PDF', 'ZPL', etc.) to specify label output format.
Parse the response 'ShipmentResponse.ShipmentResults'; extract 'ShipmentIdentificationNumber' (master tracking), 'PackageResults' for per-package tracking numbers, and 'PackageResults.ShippingLabel.GraphicImage' (base64-encoded label data).
Decode the base64 label image and write it to a file for printing.
Store tracking numbers and associate them with your order records for downstream tracking.
Known gotchas
UPS deprecated API key authentication in 2024 in favor of OAuth 2.0; integrations still using API keys must migrate to the OAuth client credentials flow — verify the current sunset status in UPS developer docs.
UPS service codes differ by country and shipment type (domestic, international, freight); always look up the correct service code for your use case in the current UPS developer documentation.
The UPS Shipping REST API request structure uses PascalCase field names; this differs from camelCase conventions used by some other carrier APIs — validate your payload structure carefully against current docs.
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