ShipStream exposes all of its API endpoints via HTTP using the JSONRPC protocol. This page explains the general method of authenticating and calling methods. Each method is documented in detail in the additional sections in the sidebar.
See Find Your URL for information on finding the correct URL to use for your ShipStream instance.

Request Format

All requests must be POST requests with the request parameters given as a JSON-encoded string in the POST body.
jsonrpc
string
required
The JSONRPC protocol version number. Must be “2.0”.
id
string
required
A unique identifier for the request that will be included in the response.
method
string
required
The remote procedure to call. This should always be either login or call.
params
array
required
An array of request parameters specific to the remote procedure being called (see below for details).

Response Format

The response will be a JSON-encoded string with the following properties:
jsonrpc
string
The JSONRPC protocol version number (“2.0”).
id
string
The unique identifier that matches the id given in the request.
error
object
If there is an error, this will be an object with keys code and message. See “Error Codes” for a list of general error codes.
result
any
If an error did not occur this will contain the appropriate response data, otherwise this will be empty.

Error Codes

codemessagemeaning
-32700Parse errorInvalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
-32600Invalid RequestThe JSON sent is not a valid Request object.
-32601Method not foundThe method does not exist / is not available.
-32602Invalid paramsInvalid method parameter(s).
-32603Internal errorInternal JSON-RPC error.
The error codes are easier to read if you first multiply by -1 and then subtract 32000. From this point forward, all error codes mentioned will have this formula already applied to them, but due to the requirement of hte JSONRPC protocol, they will be reported via the API without the formula applied.

Calling Methods

call(session_id, method, arguments) The ‘call’ method requires proper authentication and is used to call all other API endpoints. These endpoints are detailed in the additional pages in the left sidebar.

Parameters

session_id
string
required
The session ID obtained from calling login() or null if using HTTP Basic Auth. See Authentication.
endpoint
string
required
The API endpoint to call. This always takes the form of {resource}.{action}. E.g. order.info
arguments
array
The arguments to the API endpoint. If there are no additional arguments, this parameter may be omitted.

Return Value

The response may be any valid JSON type according to the endpoint which was called.

Error Codes

codemessage
2Access denied.
3Invalid api path.
4Resource path is not callable.
5Session expired. Try to relogin.
?Other error codes may be used depending on which method was called.