API

General Information

StoresAce provides a powerful and flexible Web APIs methods, to easily communicate with external applications.

If you have your own Software or just pretend to integrate your existing applications with the StoresAce BackOffice, you can use all the API features to synchronize all informations. It allows you to upload and retrieve all the contents you need.
For example, with StoresAce API you can get all information about Products and Prices and send back all sales transactions details made on each Point of Sale. At any time, you can retrieve what new products are ready to send to stores, or what prices need to be changed.

All the features are available through REST Web Services in JSON format. This means that, for any available entity feature, you can View, Retrieve, Create or Update any existing field. A Web Browsable API is also available to navigate over all features.

If you wish to build your own Middleware Communication System using StoresAce API and become an official StoresAce partner, please visit our Partners Page or contact us directly for more informations.

Authentication

All calls to Web API methods are made through secure authentication system.
You need to pass an Username and Password to validate each conection. Each environment has it's own API user and password. You can retrieve this information directly on your environment:

Depending on the programing language you might be using, you will need to configure the specific URL you want to call, passing the correct username and password to it. Bellow is an example API Request on Products List Method, using the command line HTTPie client for JSON support:

http -a:GET https://123456789.storesace.com/dimas/api/items/

API Methods List

All methods are displayed on StoresAce Web Browsable API.
This means you can view all available features, and navigate through them using your normal Web Browser. Simple access the API main root link, on your environment, to check all available methods:

https://ENVIRONMENT.storesace.com/dimas/api/

This link will present the StoresAce API Root Page, listing all available methods to communicate with external applications. If you need some new specific method not listed on your environment, please contact our support team.

Each method details and content are accessible by it's own endpoint url listed in this Root Page. Simple click on each method link url to access all instance records with all fields and properties. You will be also able to navigate on all records list, and make GET or POST events on specific records to retrieve or update some particular content.

Access Types


GET

The GET method is used to view and retrieve individual or large records list.
You can access via Web Browser navigation, or by API method call using the GET request type. Bellow is a list of some arguments that can be passed to each method:

ArgumentDescription
formatDisplay Format Type (Default: Web HTML Browsable).
Pass json to return content in JSON format.
page_sizeNumber of results to be returned into each page.
Note that some API methods limits the minimum and maximum count of records.
pagePagination index to display the records list.
Full result sets are split into individual pages of data, based on page_size.
storeStore code to filter only results available on a specific store.
Example: Retrieve only Products available to sell on Store with code 1.
synccounterFilter objects that were created or updated after last synchronization.
The synccounter object is a long integer value that matchs current date and time.
To avoid retrieving and updating always entire record set, save your last returned synccounter and easily retrieve only changes made after last synchronization.

The result will be returned in JSON format using the following syntax:

{
  "count"://total full list records count
  "next"://next page method link
  "previous"://previous page method link
  "results": [//START of result array list
    {//record 1
      "fieldnameA"://fieldvalue
      "fieldnameB"://fieldvalue
      ...
    },
    {//record 2
      "fieldnameA"://fieldvalue
      "fieldnameB"://fieldvalue
      ...
    },
    ...
    {//record n (defined by page_size argument)
      "fieldnameA"://fieldvalue
      "fieldnameB"://fieldvalue
      ...
    },
  ]//END of result array list
}

POST

The POST request type is used to create or update existing records.
All the API methods are prepared to update records if exists, or create when they are not found. It can also create and update multiple records in a single request, passing to the JSON format an array list of elements, just like the GET request type returns an array for all records.
The Web Browsable API has a built-in POST request feature using JSON format, like bellow:

In case the post was successfully saved, it will ouput a valid message status:

{
    "status": "1"
}

If the information posted has some validation errors, it will ouput all errors found in each fields:

{
    "InvoiceDate": [
         "This field may not be null."
    ],
    "StoreId": [
         "This field may not be null."
    ]
}