Obtain a UPS OAuth 2.0 Bearer token and have your UPS shipper account number ready.
POST /api/shipments/v1/ship with a JSON body containing 'ShipmentRequest' with 'Request', 'Shipment' (including 'Shipper', 'ShipTo', 'ShipFrom', 'Service' with 'Code', 'Package' array with 'PackagingType', 'Dimensions', 'PackageWeight'), and 'LabelSpecification' (with 'LabelImageFormat' such as 'GIF' or 'PDF').
The response 'ShipmentResponse.ShipmentResults' contains 'PackageResults' array; each package has 'ShippingLabel.GraphicImage' as a Base64-encoded label and 'TrackingNumber'.
Decode the Base64 'GraphicImage' and write it to a file with the appropriate extension matching your requested format to produce the printable label.
Store 'ShipmentResults.ShipmentIdentificationNumber' as your shipment-level identifier and each package's 'TrackingNumber' for tracking purposes.
Known gotchas
The UPS Shipping API requires both a valid OAuth token and the shipper's UPS account number in the request body; the token alone is insufficient.
Label image format must match what your printer supports; GIF is the legacy format, PDF or ZPL (for thermal printers) are preferred for production use.
Address fields have strict character limits and must not contain special characters; UPS may return validation errors that are distinct from carrier rejection errors.
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