Carrier Authentication
To prevent abuse most shipping carriers require that you send a developer API key with each request. Since RocketShipIt connects from your servers directly to the shipping carrier, RocketShipIt requires these API credentials for each carrier you wish to connect to.
In 2024 most of the shipping carriers migrated to oauth based authentication which requires that you generate a temporary token every few hours to interact with their APIs. You can generate this token with the RocketShipIt Authenticate
call. You can then use the token returned as key
in subsequent requests. Ex: UPS REST oauth Authenticate Example
Please refer to the chart below and supply these parameters for each request.
Parameters
Code | Description | Required By |
---|---|---|
key | Carrier API key | UPS-REST, UPS, FedEx, FedEx-REST, Asendia, USPS-REST |
username | Carrier API Username | UPS, USPS, Stamps, DHL, Canada, Purolator, GSO, Asendia |
password | Carrier API Password | UPS, USPS, FedEx, Stamps, DHL, Canada, Purolator, GSO, OnTrac, Asendia |
account_number | Carrier shipping account number | UPS, FedEx, DHL, Canada, OnTrac, Asendia |
meter_number | Carrier shipping meter number | FedEx, Asendia |
{
"carrier": "GSO",
"action": "track",
"params": {
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
...
}
}
Note: For UPS and FedEx RocketShipIt supports both their legacy XML/SOAP API and their newer JSON API. As of 6/3/2023 users should be using the newer APIs (UPS-REST/FedEx-REST). Authentication for these APIs has changed. See: UPS Authentication / FedEx Authentication The older APIs will stop working in 2024.
Obtaining API Keys
To use RocketShipIt you will need to sign up for a developer account with each shipping carrier you intend to use (except Stamps.com). Once you have signed up you will be given a developer key which you will use in each RocketShipIt request.
UPS
Start by registering for a UPS developer's account. UPS historically has two major APIs, XML/SOAP and REST/oauth. As of 6/3/2023 you should be using UPS-REST
as the RocketShipIt carrier instead of UPS
which points to the legacy XML/SOAP API.
Once you have an account you need to create an app and request/add services like rating, tracking, labels, etc to your app. You will then be given a client_id
and client_secret
which you will use in the Authenticate call to get a key
which you will use for subsequent API calls.
FedEx
To use the FedEx services you will register for a FedEx developer's account.
Once you have an account with FedEx you will need to login to the Developer Resource Center and create an app and request/add services like rating, tracking, labels, etc to your app. You will then be given a client_id
and client_secret
which you will use in the Authenticate call to get a key
which you will use for subsequent API calls.
Production label access
FedEx is a little behind other carriers, they're the only shipping carrier that still requires that you certify your API use before making production shippable labels.
Fortunately, this process is easy. You simply need to send FedEx some sample API request/responses along with a label. You can get this info from RocketShipIt by adding "debug": true,
to your requests.
We've even made a tool to automatically generate FedEx Test case labels to help with the process.
USPS
USPS services are separated into two different carriers, USPS and Stamps.com. USPS is usually used for interacting with Rates and Tracking only as it cannot produce postage paid labels. A Stamps.com account is required if you wish to produce labels that have postage. If you want to create a USPS label with a tracking number but without postage you can use USPS. We usually recommend using Stamps.com for all API requests if you need postage paid labels.
If you wish to use only the USPS rates and tracking services you don't need a Stamps.com account simply register for a USPS developer's account.
If you are using Stamps.com with RocketShipIt you do not need a Stamps.com developer account. You will use your production Stamps.com username and password to connect.
DHL
You can signup for the DHL XML-PI API at https://xmlportal.dhl.com/login.
If you run into any trouble please email xmlrequests@dhl.com and tell him that RocketShipIt sent you.
OnTrac
You can sign up for their API at: https://www.ontrac.com/onlineShipAPI.asp.
Purolator
You can sign up for their API at: https://eship.purolator.com/site/en/default.aspx
Authentication Failed Errors
"errors": [
{
"code": "1000",
"description": "Authentication Failed",
"type": "ERROR"
}
],
This error simply means that the carrier credentials you are using are invalid.
Make sure you are using the correct credentials for the environment you are using. FedEx for example has separate credentials for test/production mode. The RocketShipIt test
parameter toggles which endpoint RocketShipIt sends requests to. FedEx may also invalidate previously generated credentials when you create a new pair. So, if you generate a new pair you need to update your app to use the new set of credentials. In addition, FedEx requires additional authorization to use their label generation and address validation APIs. Your credentials may not grant access to these services. If you suspect this, try your credentials to fetch rates or track a package.
You can also verify that RocketShipIt is sending the correct credentials by inspecting the request send to the carrier by looking at the debug info.