Skip to main content
Once your platform completes the OAuth flow for a user, you hold a Bearer access_token for that user’s Shippo account. This guide walks through testing that connection end to end: exchange the Bearer token for a JWT, confirm which user you are acting as, put USPS into test mode, and buy a test label. Every request on this page runs against the live api.goshippo.com host. Nothing here charges the connected account, provided you follow the test-rate check in Create a test rate.

Before you begin

You need:
  • OAuth credentials for your platform (client_id and client_secret). See OAuth to request them.
  • A completed OAuth flow for a test user, which gives you that user’s Bearer access_token.
  • A Shippo account you are comfortable testing against. Use a dedicated test account rather than a production one — see Sandbox testing.
Use a dedicated test accountA Shippo OAuth access_token grants full API access to the account that authorized it and never expires. Do not run this walkthrough against an account you use for production shipping.

Exchange the Bearer token for a JWT

Call embedded/authz with the user’s Bearer token to mint a JWT. The scope field is required.
Mint a JWT request
Mint a JWT response
token is the JWT. expiresIn is a unix timestamp marking when it expires — tokens are valid for 12 hours. Send the JWT on every subsequent request as Authorization: JWT <JWT_TOKEN>.
noteJWT is the only accepted prefix for this token. Authorization: Bearer <JWT_TOKEN> and Authorization: ShippoToken <JWT_TOKEN> both return 401.
For the full set of ways to mint a JWT, including white label and eCommerce integrations, see Authentication using JWT.

Confirm which user you are acting as

Before you create anything, confirm the JWT resolves to the OAuth user you expect. This is the fastest way to catch a token that belongs to the wrong connected account.
Check the account request
Check the account response
The JWT also carries the user’s identity in its own claims. The payload is base64url-encoded JSON, so you can decode it without a Shippo API call — useful for asserting in your test suite that you connected the right account:
Decoded JWT payload
Decode, do not trustDecoding a JWT payload does not verify its signature. Read these claims for debugging and test assertions only, never as an authorization decision in your own application.

Put USPS into test mode

Shippo provisions a test USPS carrier account alongside the live one. List the connected account’s carrier accounts and find the USPS entry with "test": true.
List carrier accounts request
List carrier accounts response
Activate the test account with a PUT. You must include test in the body alongside active — omitting it returns 400 {"test": ["This field is required."]}.
Activate test mode request
Activate test mode response

Create a test rate

Create a shipment exactly as you would in production. The JWT authenticates the request on behalf of the OAuth user.
Create shipment request
Test mode returns live rates tooActivating the test carrier account does not switch the account into test mode wholesale. The shipment returns rates from every active carrier account, live and test together — often the same service at the same price, distinguishable only by the rate’s test field.Before you purchase, select your rate by "test": true and by the carrier_account of your test account. Purchasing a rate with "test": false buys a real label and charges the connected account.
Create shipment response (rates excerpt)
Both entries are USPS Ground Advantage at the same price. Only the second one is a test rate.

Create a test transaction

Purchase the test rate to produce a test label. Guard the selection in code rather than pasting a rate ID by hand:
Select and purchase a test rate
Create transaction response
Confirm "test": true on the response. A test transaction returns a real, downloadable label PDF and a tracking number, but is not a real shipment and is not billed.

Clean up

Test rates keep appearing in every rate response for the connected account until you deactivate the test carrier account. When you finish testing, turn it back off:
Deactivate test mode request

Troubleshooting

Last modified on September 21, 2026