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.The JSONRPC protocol version number. Must be “2.0”.
A unique identifier for the request that will be included in the response.
The remote procedure to call. This should always be either
login
or call
.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:The JSONRPC protocol version number (“2.0”).
The unique identifier that matches the id given in the request.
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.If an error did not occur this will contain the appropriate response data, otherwise this will be empty.
Error Codes
code | message | meaning |
---|---|---|
-32700 | Parse error | Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text. |
-32600 | Invalid Request | The JSON sent is not a valid Request object. |
-32601 | Method not found | The method does not exist / is not available. |
-32602 | Invalid params | Invalid method parameter(s). |
-32603 | Internal error | Internal 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
The session ID obtained from calling
login()
or null
if using HTTP Basic Auth. See Authentication.The API endpoint to call. This always takes the form of
{resource}.{action}
. E.g. order.info
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
code | message |
---|---|
2 | Access denied. |
3 | Invalid api path. |
4 | Resource path is not callable. |
5 | Session expired. Try to relogin. |
? | Other error codes may be used depending on which method was called. |