RocketShipIt

RocketShipIt

  • Docs
  • API Examples

›Guides

Guides

  • Getting Started
  • API Explorer
  • Errors
  • Self-Hosting
  • Cloud API
  • Rating
  • Tracking
  • Shipping Labels
  • Address Validation
  • Batch Requests
  • ETD / Paperless Customs
  • Thermal Printing
  • Add a logo to the shipping label
  • Add Reference Values to Labels
  • Return Labels
  • Scale Integrations
  • Laravel
  • FedEx Ground Collect
  • UPS Mail Innovations
  • Saturday Delivery
  • Find Locations
  • FedEx Test Environment
  • Switching UPS / FedEx REST
  • Authenticating Multiple UPS Accounts with UPS REST API
  • Authenticating with REST oauth APIs
  • Customizing RocketShipIt Requests

References

  • Requirements
  • Supported Shipping Carriers
  • Carrier Authentication
  • API Examples
  • Request/Response Format
  • Parameters
  • Carrier Errors
  • Command Line Options
  • Label Transformations
  • Supported Address Validation Countries
  • DHL Addons (Special Service Codes)
  • Rate Details
  • GetSubscription
  • Accessorial / Surcharge Codes
  • Shipping Carrier APIs
  • FedEx SmartPost
  • Carrier Parameters
  • UPS API Parameters
  • FedEx API Parameters
  • API REST Migration Deadlines

Troubleshooting

  • What if I run into trouble?
  • FAQs
  • Inaccurate Rates?

Authenticating with REST oauth APIs

In 2023 most of the shipping carriers released new APIs (UPS-REST, FedEx-REST, USPS-REST) that authenticate with oauth expiring tokens. You can no longer pass static credentials to make API requests. You need to generate a token that is good for ~1-8 hours and use that token for API requests. Unfortunately, this means you need to temporarily store the token.

You can generate this token using the RocketShipIt Authenticate call.

Examples:

  • https://docs.rocketshipit.com/2-0/examples/#ups-rest-authenticate
  • https://docs.rocketshipit.com/2-0/examples/#fedex-rest-authenticate
  • https://docs.rocketshipit.com/2-0/examples/#usps-rest-authenticate

Example response:

{
  "data": {
    "access_token": "eyJraWQiOiI2NGM0YjYyM...",
    "errors": null,
    "expires_at": 1717194275247, // unix timestamp in milliseconds
    "expires_in": 14399, // seconds
    "issued_at": 1717179876247, // unix timestamp in milliseconds 
    "scope": "",
    "token_type": "Bearer"
  
  },
  "meta": {
    "code": 200,
    "error_message": ""
  }
}
  • expires_in is seconds left until expiration. Ex: 14,000 / 60 / 60 = ~4 hours.
  • issued_at is a Unix epoch timestamp but in milliseconds instead of seconds
  • access_token this is the key you will use in subsequent requests.

If you need help converting milliseconds to a time object see: https://currentmillis.com/

Example next request:

{
  "carrier": "UPS-REST",
  "action": "Track",
  "params": {
    "key": "eyJraWQiOiI2NGM0YjYyM...",
    "tracking_number": "1Z12345E0205271688",
      "test": true
  }
}

For low volume and quick testing you can have RocketShipIt request a key on each request (not recommended for production):

{
  "carrier": "UPS-REST",
  "action": "Track",
  "params": {
    "client_id": "specify this while omitting key",
    "client_secret": "and RocketShipIt will make the Authenticate call for you and fill out the key param",
    "tracking_number": "1Z12345E0205271688",
      "test": true
  }
}

Enable each service in our Oauth application

Shipping carriers also require you to request each individual service/action within the API. Make sure you enable all of these you intend to use:

FedEx Oauth

← Authenticating Multiple UPS Accounts with UPS REST APICustomizing RocketShipIt Requests →
  • Enable each service in our Oauth application
RocketShipIt
Docs
Getting StartedAPI Reference
RocketShipIt
SupportMy Account
Copyright © 2025 RocketShipIt LLC