General usage

Calling the API

All calls must contain the token

The type of call defines what kind of action you wish to excute, GET, PUT, POST, etc. more details can be found under the individual endpoint descriptions.

Note. All propertiy names are case-sensitive.

Date and number formats

Date: dd/MM/yyyy

DateTime: dd/MM/yyyy H:mm:ss

Decimal: decimals uses . as seperator

Get

Calls to Get endpoints are used to retrieve data from the server, Get calls must specify a query and a list of properties as well as the API token generated in Warehouze

Query symbols include:

  • >
  • <
  • =
  • :
Examples: "Number=130", "Date>01/12/1950" or "Id:[1,2]".

page and pagesize defaults to 0 and 20 respectively.

Insert

Calls to Insert endpoints are used to create new data objects on the server. Insert calls will require one or more properties to be set, these are defined by the relevant endpoint.

Put

Calls to Put endpoints are used to modify existing objects on the server. A Put call will require one or more identifiers, these are defined by the endpoints.

Delete

Calls to Delete endpoints are used to delete existing objects on the server. A Delete call will require one or more identifiers, these are defined by the relevant endpoint.

Sample Get call
        var request = {
            Token: "Insert your token here",
            Query: [
                "Number=130",
                "WarehouseNumber=1",
                "page=0",
                "pagesize=1"
            ],
            Properties: [
                        "Id",
                        "StockQty",
            ],
        };
        $.ajax({
            url: "https://api.warehouze.io/Product",
            data: request,
            dataType: 'text',
            type: "GET",
            traditional: true,
            success: function (data) {
                console.log(data);
            },
            error: function (data, xHr) {
                console.log(data);
                console.log(xHr);
            }
        });
            
Sample Post call
        var request = {
            Token: "Insert your token here",
            Query: [
                 JSON.stringify([{ Number: '1', GroupId: 123456 }, { Number: '2', GroupId: 123456 }])
            ],
        };
        $.ajax({
            url: "https://api.warehouze.io/Product",
            data: request,
            dataType: 'text',
            type: "POST",
            success: function (data) {
                console.log(data);
            },
            error: function (data, xHr) {
                console.log(data);
                console.log(xHr);
            }
        });
            
Sample Put call
        var request = {
            Token: "Insert your token here",
            Query: [
                 JSON.stringify([{ Id: 1, Name: 'Product 1' }, { Id: 2, Name: 'Product 2' }])
            ],
        };
        $.ajax({
            url: "https://api.warehouze.io/Product",
            data: request,
            dataType: 'text',
            type: "PUT",
            success: function (data) {
                console.log(data);
            },
            error: function (data, xHr) {
                console.log(data);
                console.log(xHr);
            }
        });