Create a FedEx shipment and purchase a shipping label using the FedEx Ship REST API
domain: developer.fedex.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Register an app on the FedEx Developer Portal to obtain a client_id and client_secret, then POST to https://apis.fedex.com/oauth/token to get a bearer token
Build a shipment request JSON with shipper and recipient contact/address objects, package weight and dimensions, serviceType (e.g. FEDEX_GROUND), and labelSpecification with labelStockType and imageType
POST the request body to https://apis.fedex.com/ship/v1/shipments
Extract the label image from the response (base64-encoded under pieceResponses[].packageDocuments[].encodedLabel) and decode it to a PDF or PNG for printing
Store the masterTrackingNumber from the response for downstream tracking calls
Void the shipment if needed by DELETE to https://apis.fedex.com/ship/v1/shipments/cancel with the trackingNumber
Known gotchas
FedEx Web Services (SOAP) was retired; only the REST API at apis.fedex.com is supported — do not use the old wsdl.fedex.com endpoints
The labelSpecification.labelStockType must match the physical printer stock; mismatches produce blank or malformed labels that fail scanning at FedEx facilities
International shipments require a commodities array with HS codes, declared values, and country of manufacture; omitting these causes the shipment to be rejected at customs clearance
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?