Overview
This guide describes how to configure a USPS Ship carrier account for a direct USPS account with negotiated rates (NSA). Note: this does not apply to Connect eCommerce (CeC) accounts.
Prerequisites
USPS must configure the NSA rates within an Enterprise Payment Account (EPA). Please verify that this has been completed with a USPS representative. The following is also required:
- USPS Business Customer Gateway (BCG) login
- Enterprise Payment Account (EPA)
- Customer Registration ID (CRID)
- Mailer ID (MID)
- Manifest MID
- Returns MID
- NSA Contract Number
Create a Carrier Account via OAuth
USPS Ship carrier accounts must be created using the OAuth registration endpoint.
curl -X POST https://api.easypost.com/v2/carrier_accounts/register_oauth \
-u <api-key>: \
-H 'Content-Type: application/json' \
-d '{
"carrier_account_oauth_registrations": {
"type": "UspsShipAccount",
"description": "",
"reference": "",
"payment_mode": "aggregation"
}
}'The response includes a partner_oauth_url, which directs to the EasyPost Partner OAuth Portal to complete account authorization.
The flow redirects to the USPS Sign-In Page to authenticate or create a USPS account.
Update the Carrier Account with Credentials
After OAuth is complete, update the carrier account using the carrier_account_id returned in the previous step.
curl -X PATCH https://api.easypost.com/v2/carrier_accounts/<carrier_account_id> \
-u <api-key>: \
-H 'Content-Type: application/json' \
-d '{
"carrier_account": {
"description": "My USPS Ship Account",
"credentials": {
"account_number": "<Merchant Rate Card EPS #>",
"customer_registration_id": "<CRID>",
"mailer_id": "<MID>",
"returns_mailer_id": "<Returns MID>",
"manifest_id": "<Master/Manifest MID>",
}
}
}'Add a USPS Ship Wallet Account (Dashboard)
For detailed instructions on creating and authorizing a USPS Ship Wallet account from the EasyPost Dashboard, see Add a USPS Ship Wallet Account from the Dashboard.
Onboard Child or UTM Users (Optional)
Some implementations use Child or UTM users to segment volume for reporting while maintaining a single USPS rate configuration.
Child user accounts inherit access to the parent USPS Ship account configuration. This enables centralized rate usage while allowing multiple users or systems to generate shipments independently.
This pattern uses a UspsShipPlatformAccount to allow multiple users to create shipments without individually authenticating a USPS account.
Create Child User Accounts
- Contact EasyPost to obtain a
shipper_idfor the parent account. - Create a
UspsShipPlatformAccountusing the Child or UTM user’s contact information andshipper_id.
curl -X POST https://api.easypost.com/v2/carrier_accounts \
-u <child-or-utm-user-api-key>: \
-H 'Content-Type: application/json' \
-d '{
"carrier_account": {
"type": "UspsShipPlatformAccount",
"payment_mode": "aggregation",
"description": "",
"reference": "<my-reference>",
"credentials": {
"company_name": "<Company Name>",
"address_street": "<Street>",
"address_city": "<City>",
"address_state": "<State>",
"address_zip": "<ZIP>",
"phone": "<Phone>",
"email": "<Email>",
"shipper_id": "<platform_shipper_id>"
}
}
}'Once created, the Child or UTM users have access to the parent USPS Ship account configuration. Authentication is inherited from the parent USPS Ship account.