Carrier’s official API
USPS API: integration guide
The United States Postal Service runs a REST/JSON API platform at apis.usps.com, documented on the USPS Developer Portal. It covers address validation, domestic and international prices, labels, tracking, carrier pickup, delivery standards, post office and drop-off locations, and SCAN forms. It replaces the legacy XML Web Tools APIs, which USPS retired on January 25, 2026; the Web Tools page now warns that the old platform may be degraded or interrupted at any time. The APIs are used by ecommerce sites, shipping platforms, 3PLs and anyone building USPS shipping into their own software.
This guide covers USPS’s own API (apis.usps.com). Credentials come from USPS, not from FreightAPIs, and we are not affiliated with them.
Want one API key for carrier terminals, NMFC and ports instead? USPS location API · FreightAPIs API docs →
At a glance
| Carrier | USPS (United States Postal Service) |
|---|---|
| Type | National postal carrier (parcel & mail) |
| Interface | REST/JSON (most APIs also accept XML) |
| Authentication | OAuth 2.0 (client credentials) bearer token |
| Capabilities | Authentication, Address validation, Domestic & international prices, Shipping options & delivery standards, Labels, Payment authorization, Tracking & proof of delivery, Carrier pickup, Locations, SCAN forms & containers |
Getting access
- Sign in to, or create, a USPS Business Account through the USPS Customer Onboarding Portal (COP). The portal configures the account for the USPS APIs.
- In the COP Business Portal, open "My Apps", create an app and copy its Consumer Key and Consumer Secret. These are the OAuth client_id and client_secret.
- Every new app gets a default product: OAuth, Addresses, Domestic Prices, International Prices, Locations, Service Standards, Service Standards Files, Shipping Options, UserInfo and Tracking.
- Other APIs, and higher quotas, are requested through a USPS API service request on the Email Us page. The Labels APIs need extra approval: you must be enrolled in USPS Ship for outbound and return labels and have an Enterprise Payment Account.
- Web Tools user IDs do not work on the new platform. Migrating users must onboard again and use the USPS mapping spreadsheets to map each Web Tools API to its replacement.
- Calls are limited by an hourly quota per API product, and exceeding it returns HTTP 429.
Authentication
OAuth 2.0 (client credentials) bearer token.
- POST to /oauth2/v3/token with `grant_type=client_credentials`, `client_id` (Consumer Key) and `client_secret` (Consumer Secret). The body can be JSON or form-encoded.
- The response returns `access_token`, `token_type` (Bearer), `issued_at` (epoch milliseconds), `expires_in` and `scope`. The documented example shows expires_in of 28,799 seconds, about 8 hours. Request a new token before it expires.
- Send `Authorization: Bearer <token>` on every API call. Each API checks the token, its expiry and its scope, so a token only works for the API products your app has been granted.
- Refresh-token and authorization-code grants also exist (for resource-owner access), and POST /oauth2/v3/revoke invalidates a token.
- Label purchases need a second token: POST /payments/v3/payment-authorization returns a payment authorization token (valid eight hours) that you send in the `X-Payment-Authorization-Token` header. The PAYER and LABEL_OWNER roles are required.
Environments
| Production | https://apis.usps.com |
|---|---|
| Testing Environment for Mailers (TEM) | https://apis-tem.usps.com |
Endpoints
Authentication
Issue and revoke OAuth 2.0 tokens for your app.
| POST | /oauth2/v3/token | Exchange client credentials (or a refresh token or auth code) for an access token. |
| POST | /oauth2/v3/revoke | Invalidate a token. |
Address validation
Standardizes an address to USPS format, looks up the city and state for a ZIP Code, or finds the ZIP Code for an address.
| GET | /addresses/v3/address | Return the standardized address for the input address. |
| GET | /addresses/v3/city-state | Return the city and state for a ZIP Code. |
| GET | /addresses/v3/zipcode | Return the ZIP Code for an address. |
Domestic & international prices
Price searches by rate ingredients. total-rates returns every eligible price including extra-service fees in one call, while base-rates prices one specific product. Separate endpoints cover extra services and First-Class letters, and the International Prices API mirrors the same set for outbound international mail.
| POST | /prices/v3/total-rates/search | List eligible prices, including extra-service fees, for a package. |
| POST | /prices/v3/base-rates/search | Get the base price for one mail class and rate indicator. |
| POST | /prices/v3/base-rates-list/search | Search eligible products for the given rate ingredients. |
| POST | /prices/v3/extra-service-rates/search | Search extra-service prices for a package. |
| POST | /prices/v3/letter-rates/search | Price First-Class Mail letters, flats and cards. |
| POST | /international-prices/v3/total-rates/search | List eligible international prices including extra services. |
| POST | /international-prices/v3/base-rates/search | Get an international base price. |
Shipping options & delivery standards
Shipping Options returns the available products for a package with price and expected delivery together. Service Standards returns delivery-day estimates between two ZIP Codes, including cutoff times and acceptance locations.
| POST | /shipments/v3/options/search | Return shipping options with pricing and delivery estimates. |
| GET | /service-standards/v3/estimates | Estimate delivery dates between two ZIP Codes. |
| GET | /service-standards/v3/standards | Return the published service standard for a lane. |
Labels
Creates domestic and international labels with Intelligent Mail package barcodes, prices the shipment, validates addresses and submits the shipping services file for you. Labels can be returned as PDF, image or ZPL, and you can also cancel or refund, edit, reprint and create return labels. Requires extra approval and a payment authorization token.
| POST | /labels/v3/label | Create a domestic shipping label. |
| POST | /labels/v3/return-label | Create a domestic return label. |
| PATCH | /labels/v3/label/{trackingNumber} | Edit label attributes. |
| DELETE | /labels/v3/label/{trackingNumber} | Cancel a label or request a refund by tracking number. |
| POST | /labels/v3/label-reprint/{trackingNumber} | Reprint a domestic label. |
| POST | /international-labels/v3/international-label | Create an international label with customs data. |
| DELETE | /international-labels/v3/international-label/{trackingNumber} | Cancel or refund an international label. |
Payment authorization
Creates the eight-hour payment token that label calls require, naming who pays, whose rates apply and who owns the label.
| POST | /payments/v3/payment-authorization | Create a payment authorization token for label purchases. |
| GET | /payments/v3/payment-account/{account-number} | Check a payment account. |
Tracking & proof of delivery
Tracking v3r2 takes a batch of up to 35 tracking numbers in one POST and returns status, expected delivery and events for each. You can also register email notifications and request a proof-of-delivery record by email for items with signature or Return Receipt (Electronic) service. A separate Subscriptions - Tracking API pushes events to your endpoint.
| POST | /tracking/v3r2/tracking | Get tracking status and events for 1 to 35 tracking numbers. |
| POST | /tracking/v3r2/tracking/{trackingNumber}/notifications | Register email notifications for a package. |
| POST | /tracking/v3r2/tracking/{trackingNumber}/proof-of-delivery | Request a proof-of-delivery record by email. |
| POST | /subscriptions-tracking/v3r2/subscriptions | Subscribe to pushed tracking events. |
Carrier pickup
Checks whether an address is eligible for free carrier pickup, then schedules, reads, changes or cancels the pickup. Pickups are available Monday to Saturday for Priority Mail Express, Priority Mail, USPS Ground Advantage, international services and returns.
| GET | /pickup/v3/carrier-pickup/eligibility | Check that an address is eligible for pickup. |
| POST | /pickup/v3/carrier-pickup | Schedule a pickup. |
| GET | /pickup/v3/carrier-pickup/{confirmationNumber} | Get a scheduled pickup. |
| PUT | /pickup/v3/carrier-pickup/{confirmationNumber} | Change a scheduled pickup. |
| DELETE | /pickup/v3/carrier-pickup/{confirmationNumber} | Cancel a scheduled pickup. |
Locations
Finds post offices, parcel lockers and drop-off (destination entry) locations near an address or coordinates, with service filters.
| GET | /locations/v3/post-office-locations | Search post offices by address, ZIP Code or coordinates. |
| GET | /locations/v3/parcel-locker-locations | Search USPS parcel lockers. |
| GET | /locations/v3/dropoff-locations | Find a valid entry location for destination-entry parcels. |
SCAN forms & containers
Creates a SCAN form (a manifest of labels for acceptance scanning) and manages container labels and container manifests for bulk drop-offs.
| POST | /scan-forms/v3/scan-form | Create a SCAN form for a set of packages. |
| POST | /containers/v3/containers | Create a container label. |
| POST | /containers/v3/containers/manifest | Close a container. |
Example request
TEM uses your production credentials; only the host changes (apis-tem.usps.com instead of apis.usps.com). Labels created in TEM are watermarked and not charged.
Integration notes
- Testing happens in TEM with your production account and keys. There is no separate sandbox signup, so you must finish onboarding before you can test.
- Weights are in pounds and dimensions in inches. Prices use the greater of actual and dimensional weight, and a mailingDate can be at most 7 days ahead.
- The single mailClass field on price requests is deprecated in favour of the mailClasses list, and priceType NSA is deprecated in favour of CONTRACT. If you send an accountNumber, it overrides the requested priceType.
- Use Tracking v3r2 for new work. USPS says the legacy Tracking 3.0 and Subscriptions - Tracking 3.0 APIs retire on July 31, 2027, and v3r2 can show slightly different events and wording than USPS.com.
- A label call needs two tokens: the OAuth bearer token and a payment authorization token in X-Payment-Authorization-Token. The payment token lasts eight hours, so cache it alongside the OAuth token.
- Send an X-Idempotency-Key when creating labels. It protects against double purchases on retries, and you can later cancel or reprint a label with the same key.
- Carrier pickups for the same day must be booked before 2:00 AM Central time; after that, schedule for a later date (up to a year ahead).
- HTTP 429 means you hit your hourly quota. Ask for a quota increase through a USPS API service request rather than retrying aggressively.
FAQ
Are the USPS Web Tools APIs still available?
USPS retired the Web Tools API platform on January 25, 2026 and warns that it may be degraded or interrupted at any time. Migrate to the REST APIs at apis.usps.com; Web Tools credentials do not carry over.
How do I get a USPS API key?
Create a USPS Business Account through the Customer Onboarding Portal, add an app under My Apps, and copy its Consumer Key and Consumer Secret. Exchange them for an OAuth token at /oauth2/v3/token.
How long does a USPS OAuth token last?
The documented example shows expires_in of 28,799 seconds, about 8 hours. Read expires_in from each token response and refresh before it lapses.
Is there a USPS API sandbox?
Yes. The Testing Environment for Mailers (TEM) at apis-tem.usps.com uses your production credentials. Labels created there are watermarked and not charged.
Can I create USPS shipping labels with the API?
Yes, but the Labels APIs are not in the default product. You need extra approval, USPS Ship enrollment and an Enterprise Payment Account, plus a payment authorization token on each label request.
On FreightAPIs
Official resources
- USPS Developer Portal: developers.usps.com/
- Getting started with USPS APIs: developers.usps.com/getting-started
- USPS API catalog: developers.usps.com/apis
- Web Tools retirement and migration: www.usps.com/business/web-tools-apis/
- USPS API examples on GitHub: github.com/USPS/api-examples
Written from USPS’s published API documentation and last checked 2026-10-09. FreightAPIs is not affiliated with USPS; endpoints and access rules can change, so confirm details in the carrier’s own documentation before going live.
Other carrier API guides
ABF Freight · Estes Express Lines · Saia LTL Freight · TForce Freight · Old Dominion Freight Line · XPO (LTL) · AAA Cooper Transportation · AIT Worldwide Logistics