JSON-RPC 2.0

The main interface to our API is JSON-RPC 2.0 over HTTP or WebSocket.

Under Clients, you find JSON-RPC-2.0-client libraries in various languages. Since JSON-RPC is a very simple protocol, the basic client is easy to implement in any language. With JSON-RPC over HTTP, you POST a simple JSON object and get a JSON object in return.

JSON-RPC over HTTP

The URL is https://admin.abicart.se/backend/jsonrpc/v1/ but the API is also accessible over HTTP (unencrypted) and on your own shop domain as well, on /backend/jsonrpc/v1/.

https://admin.abicart.se/backend/jsonrpc/v1/ (main URL)
http://admin.abicart.se/backend/jsonrpc/v1/
http://yourshop.example.com/backend/jsonrpc/v1/

To get an object-oriented approach, we use the notation Class.method and all instance methods have the instance's unique identifier as its first parameter.

Example

A request to the get method on an Order with the unique identifier 1234 could look like this:

API Console
{
  "jsonrpc": "2.0",
  "method":  "Order.get",
  "id":      1,
  "params":  [
    "1234",
    { "totalcost": true }
  ],
}
Response
{
  "jsonrpc": "2.0",
  "id":      1,
  "result":  {
    "totalcost": {
      "incVat":   100,
      "exVat":    80,
      "vat":      20,
      "vatRate":  0.25,
      "currency": "SEK"
    }
  }
}

Context parameters

All requests are made in a context. The API will take context parameters from both GET parameters and cookies. So the URL...

HTTP
https://admin.abicart.se/backend/jsonrpc/v1/?webshop=22222&language=sv

...will set the context

HTTP
webshop:  22222
language: sv

Available context parameters

Parameter Description
webshop The webshop ID. This identifies which webshop we are working with and is required for articles, articlegroups, orders, customers, sessions and everything else that belongs to a certain webshop. Only some of the system-wide API methods do not require a webshop in the context.
language A two-letter ISO 639-1 code. Sets the wanted language for API metadata. If no language is provided in the query string then try to default it using the following heuristic: If the webshop has a default language set, use that as the contexts language. Otherwise default to english.
auth An admin token. The token is used to identify an admin and can be acquired from Auth.getToken
session A session token. The token is used to identify a current buyer and can be acquired from Session.getToken

SSL on admin.abicart.se

Everything available on http://admin.abicart.se can be accessed through SSL at https://admin.abicart.se as well. This allows you to use all the resources through SSL on a secure page and avoid warnings.

The API will always deliver absolute URLs with the HTTP schema, where the format dictates URI.

Example

The image URL for an Article.

HTTP
http://admin.abicart.se/shop/22222/art22/h5484/12565484-origpic-4e3233.jpg