General Usage

While Shipsi’s suite of API’s span a large range of services a few basic aspects apply to all of our products.

With a knowledge of the base rules which govern our REST API you will be able to easily set up requests and interact with Shipsi as needed.

Not a developer? Not a problem. Check out Shipsi’s self-serve delivery portal to utilize shipping rates, deliveries, locations, and analytics or view more products.

Get up and running with Shipsi

For detailed help on getting started we recommend:

Learn about how to authenticate your request to Shipsi.

Learn more about your request to Shipsi and Shipsi’s response.

Learn how to track the status of your actions with Shipsi webhooks.

Control shipping experiences with the Shipsi API

From finding the fastest shipping option, comparing the best rates across providers, or managing your store hours, Shipsi’s REST API can make your life easier.

Set up your delivery locations with the REST API

Create a delivery through the REST API

Shipsi’s REST API’s

Shipsi’s APIs (Application Programming Interface) power its technology for ecommerce delivery. Behind these APIs is a software layer integrating and aggregating driver networks in 850+ cities.

From getting shipping rates to viewing checkout analytics to scheduling deliveries, Shipsi has an entire suite of APIs. Shipsi API reference documentation can be found throughout our product documentation. You can use this page to browse the various APIs or jump right in to Shipping Rates or Create Delivery.

What is a REST API?

An API is an application programming interface - or more simply, a set of rules which allow programs talk to each other, exposing permissible data and functionality across the internet in a format which is consistent.

REST is an acronym for Representational State Transfer. This is an architectural pattern that explains how distributed systems can expose a consistent interface. When the term ‘REST API’ is used it is typically referencing an API accessed via HTTP protocol at a defined set of URLs.

These URLs hold different resources - such as information or content at that location, which is returned in either JSON, HTML, images, or audio files. Often, resources have multiple methods that can be performed over HTTP, like GET, POST, PUT and DELETE.

Shipsi offers many different REST APIs for finding shipping rates, creating deliveries, checking analytics, managing locations, and much more. With the Shipsi technology offering, each product has a separate API, but you can work with each in a similar manner, whether over HTTP or using Shipsi’s guides for different programming languages.

Explore the API’s

Shipsi, with our Create Delivery API can create instant or scheduled deliveries to deliver packages to customers seamlessly. You’ll need to register with Shipsi to get started.

Explore Shipsi’s other API’s

Shipsi has a host of other REST APIs which can help you manage and control your entire shipping process from checkout to drop-off. With many powerful features built in to the API you can customize the process to fit your flow with Compare Rates, View Analytics, Add Locations, or check order status requests.

Authentication

The Shipsi API uses API keys to authenticate requests. You can view your API key in your account settings within your self-serve portal.

Your API keys have the full Shipsi capabilities so make sure you keep it secure! Do not share your API key in public areas such as GitHub, client-side code, or other compromising locations.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Making an HTTPS request to Shipsi

There are a lot of ways you can make an HTTPS request to the Shipsi API. A request can be raw over HTTPS in your code (such as using a module in NodeJS) or API tools like Postman.

Credentials

All requests to Shipsi's REST API need to be authenticated. Shipsi supports authenticating using HTTPS basic auth, which use the an API key that uniquely identifies a user as authorized.

API Key

Shipsi uses API keys to authenticate API requests. You can view your API key in your self-serve portal.

API requests without authentication will fail.

HTTPS Methods

Shipsi uses POST, PUT, and GET HTTPS method on differing resources. Here's how those method is used for Shipsi's most common resource: Create Delivery resource.

Creating Resources with the POST Method

You can create a resource using the HTTP POST method on a resource URI. You can view the parameters for any post request in the documentation for a resource. Here's a POST request which will create and send a delivery driver via the Shipsi API.

Edit a Resource with the GET Method

You’ve scheduled the delivery! You can see in the output a platform_reference_id. You can use that platform_reference_id to edit the delivery information prior to dispatch.

Retrieving Resources with the PUT Method

While you can get event alerts via webhook there may be times you want to check the status of a delivery directly. You can use the same platform_order_id to make an HTTPS GET request to the List Deliveries resource.

Errors

Shipsi uses conventional HTTP response codes to indicate the success or failure of an API request. Generally it can be known: Codes within the 2xx range mean success. Codes within the 4xx range mean failure due to the information given (such as, a required parameter was omitted, an address was invalid, the scheduled time is in the past.). Codes within the 5xx range mean their is an error on our end.

Because many 4xx errors can be handled programmatically we do our best to provide a code which explains the reported error.

HTTP STATUS CODE SUMMARY

200 - OK

Success

400 - Bad Request

Failure, likely due to missing parameter

401 - Unauthorized

Invalid API Key

402 - Request Failed

Valid parameters, failed request

403 - Forbidden

Insufficient permissions for the request

404- Not Found

Resource does not exist

409 - Conflict

Conflict with another request

429 - Too Many Requests

Too many requests at once, try exponential backoff

500, 502, 503, 504 - Server Errors

Something is wrong on our end

REST API: Shipsi’s response
JSON

Shipsi returns resource representations as JSON.

Exceptions

Shipsi returns exceptions in the HTTPS response body when something goes wrong. An exception has up to four properties:

Property
Description

Status

HTTPS status code for the exception

Description

Further description of the issue

Code

Error code to find the exception

MoreInfo

URL for Shipsi Documentation referencing the error

If the exception is received with status code 400 (Bad request), the 'Code' and 'MoreInfo' properties are often useful for finding what

Examples

Example 1

Here is a simple 404:

Example 2

An invalid POST to the Create Delivery resource without a 'Address_1' parameter would return:

Expanding Responses

Some objects allow the request for more information shown as an expanded response using the expand request parameter. On all API requests this parameter is available, but only applies to that request alone. Responses can be expanded once or multiple times in nested fashion.

To expand a response you must use the applicable related object ID within the response properties given. A good example of this is the Compare Rates API request will return quote IDs. Those quote ID objects can be expanded inline with the expand request parameter. Within this documentation we note objects which can be expanded with the expand request parameter.

You can expand recursively by specifying nested fields after a dot (.). For example, requesting location_id.location_package on shipping rate will expand the location_id property into a full Location object, and will then expand the location_package property on that location into a full Package object.

This parameter can be used on any endpoint that returns expandable fields. Using multiple deep expansions on requests can be slow.

Expansions have a maximum depth of three levels.

Idempotent Responses

The Shipsi API supports built in idempotency. Many requests can be retried with the same parameters repeatedly and not cause any negative result.

Requests to endpoints which action events that carry a cost or associated live event are idempotent by default. All of these requests must be unique or will fail.

Request results only save if an endpoint starts executing. If request parameters failed validation, or the request conflicted with another that was executing concurrently, no idempotent result is saved because no API endpoint began execution. These requests can always be retried.

Versioning

When changes are made to the API which are not compatible with previous versions Shipsi releases a new dated API. changes are made to the API, a new, dated version is released. The current version is 2020-10-01.

Check our changelog to keep up to date on any of these changes to our API.

Webhooks

Shipsi’s REST API for HTTPS requests from your application to Shipsi works well for purposes such as quoting a delivery cost or dispatching a driver, but what happens when we receive data which you also may need? When Shipsi processes data which is resulting from the outcomes of your requests you can get this data too. An example of this would be after you created a delivery a driver is dispatched. You need to know when this driver has reached certain points to trigger or plan actions on your side - you can get this data via webhooks.

What is a webhook?

As certain events occur, Shipsi has access to this data in real time - these events are different for each Shipsi product. We can send these to you via HTTPS requests. These requests are called webhooks. Generally, your application would get an HTTP callback because the event is useful or should probably be handled by your application.

A perfect example is after a customer gets a package delivered you may want to send them a survey to understand their experience. This can easily be handled if you have data on when the package was delivered. A webhook can be sent to your application which alerts you of that event. Now you can have a function which detects the completed delivery alert and sends an email survey accordingly.

The majority of the time webhooks are used when your systems don’t maintain an open connection to Shipsi - so Shipsi makes an independent HTTPS request to your server.

I don’t know what to do with incoming webhooks?

Shipsi webhooks are informational. No response from your application is required, aside from a standard HTTP status code of 200 (OK).

Configuring Webhooks

You can set your webhook URL via the self-serve portal to be notified about events that happen in real time for various resources

Shipsi Products

Now that you understand what rules and architecture apply to all of Shipsi’s products you can dive right in and find a solution which fits your needs!

Stuck?

No problem! Get help now from our support team to get you up and running.