API Key

How to get your API Key?

Before you started with using our REST API services, you will need to obatin your API key under your own user account.

  1. Login to your AfterShip account (Sign up free)
  2. Visit Apps > API and click add
  3. ClickGenerate API Key

API end point

Once you've registered your API it's easy to start requesting data from AfterShip.

All endpoints are only accessible via https and are located at api.aftership.com.

https://api.aftership.com/v3

Header

All API call must include this header in order to auth the useage of AfterShip API.

Replace your API_API_KEY with your own key.
aftership-api-key: YOUR_API_KEY

Body

All the request and response are in JSON string.


Limit

Be nice. If you're sending too many requests too quickly, we'll send back a 429 error code (TooManyRequestsError).

You are limited to 10 reqs/sec (36,000 reqs/hr) per API KEY. Practically, this means you should (when possible) authenticate users so that limits are well outside the reach of a given user.


The Envelope

Every response is contained by an envelope. That is, each response has a predictable set of keys with which you can expect to interact:


META

The meta key is used to communicate extra information about the response to the developer. If all goes well, you'll only ever see a code key with value 200. However, sometimes things go wrong, and in that case you might see a response like:


DATA

The data key is the meat of the response. It may be a list of results, but either way this is where you'll find the data you requested.

Here is the example for a GET /couriers