You can list your available catalog with the following URL:

                GET https://api.smallinvoice.com/catalog/list/
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
limitintno0Limit the amount of results
pageintno1When limiting the results, specifies page
sortstringnonamename
number
Sorts the list by the available values
sorttypestringnodescasc
desc
Defines the way of sorting


Example: Making a request with 100 Results, getting second page, and sorting by date ascending

        GET https://api.smallinvoice.com/catalog/list/limit/100/page/2/sort/date/sorttype/asc/
    

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.
pageintCurrent page that was passed in on the request
pagesintTotal number of pages available
countintTotal number of objects available
itemscollectionCollection of Catalog Objects

Example content of data variable:

    {
        "error":false,
        "page":1,
        "pages":1,
        "count":2,
        "items":[
            {
                "id":1011,
                "type":2,
                "number":101,
                "unit":7,
                "name":"Product X",
                "description":"Repairing car",
                "category":"Secret",
                "vat":8,
                "cost_per_unit":0,
                "cost_vat_included":0
            },
            {
                "id":1010,
                "type":1,
                "number":100,
                "unit":1,
                "name":"Service Y",
                "description":"Cleaning house",
                "category":"Secret",
                "vat":8,
                "cost_per_unit":0,
                "cost_vat_included":0
            }
        ]
    }
    

You can get your catalog with the following URL:

                GET https://api.smallinvoice.com/catalog/get/
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the catalog


Example: Making a request for catalog with id 5

                GET https://api.smallinvoice.com/catalog/get/id/5
            

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.
itemobjectObject of Catalog

Example content of data variable:

    {
        "error":false,
        "item":{
            "id":1011,
            "type":2,
            "number":101,
            "unit":7,
            "name":"Product X",
            "description":"Repairing car",
            "category":"Secret",
            "vat":8,
            "cost_per_unit":0,
            "cost_vat_included":0
        }
    }
    

You can add a new catalog with the following URL:

                POST https://api.smallinvoice.com/catalog/add
            

Body parameters

NameTypeRequiredDefaultNotes
typeintyesSee Catalog Types
numberstringnonext higher numberCatalog number
unitintyesSee Catalog Units
namestringyesName of catalog entry
descriptionstringnoDescription of catalog entry
categorystringnoCategory of catalog entry
vatfloatyesVAT amount
cost_per_unitfloatyesCost per one unit
cost_vat_includedintno0If VAT is included in cost
notesstringnoInternal notes not visible to client


Example: Creating a new catalog

                POST https://api.smallinvoice.com/catalog/add/
            

Example content of data variable:
{
    "type":2,
    "number":101,
    "unit":7,
    "name":"Product X",
    "description":"Repairing car",
    "category":"Secret",
    "vat":8,
    "cost_per_unit":0,
    "cost_vat_included":0
}

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.
idintThe Id of the Catalog Object that was created

Example response:

    {
        "error":false,
        "id": 43
    }
    

You can edit an catalog with the following URL:

                POST https://api.smallinvoice.com/catalog/edit
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the catalog

Body parameters

NameTypeNotes
typeintSee Catalog Types
numberstringCatalog number
unitintSee Catalog Units
namestringName of catalog entry
descriptionstringDescription of catalog entry
categorystringCategory of catalog entry
vatfloatVAT amount
cost_per_unitfloatCost per one unit
cost_vat_includedintIf VAT is included in cost
notesstringInternal notes not visible to client


Example: Editing an catalog with id 5

                POST https://api.smallinvoice.com/catalog/edit/id/5
            

Example content of data variable:
{
    "type":2,
    "number":101,
    "unit":7,
    "name":"Product Y",
    "description":"Cleaning house",
    "category":"Secret",
    "vat":8,
    "cost_per_unit":0,
    "cost_vat_included":0
}

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.

Example response:

    {
        "error":false
    }
    

You can delete an catalog with the following URL:

                POST https://api.smallinvoice.com/catalog/delete/
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the catalog


Example: Making a request for deleting catalog with id 5

                POST https://api.smallinvoice.com/catalog/delete/id/5
            

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.

Example response:

    {
        "error":false
    }