You can list your available clients with the following URL:

                GET https://api.smallinvoice.com/client/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/client/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 Client Objects

Example content of data variable:

    {
        "error":false,
        "page":1,
        "pages":1,
        "count":1,
        "items":[
            {
                "id":16,
                "type":1,
                "gender":0,
                "number":1000,
                "name":"Jane Doe",
                "addition":"",
                "vat_id":"",
                "language":"de",
                "phone":"",
                "fax":"",
                "email":"",
                "website":"",
                "notes":"",
                "main_contact_id":0,
                "main_address_id":11,
                "street":"Address",
                "streetno":"",
                "code":123,
                "city":"Atlantis",
                "country":"EG",
                "addresses":[
                    {
                        "id":11,
                        "street":"Address",
                        "streetno":"",
                        "street2":"",
                        "code":123,
                        "city":"Atlantis",
                        "country":"EG"
                    }
                ],
                "contacts":[
                ],
                "assigns":[
                    {
                        "id":3,
                        "employee":"John Doe",
                        "comment":"My husband",
                        "hours":3,
                        "year":2013,
                        "month":2,
                        "day":27,
                        "billed":0
                    }
                ]
            }
        ]
    }
    

You can get your client with the following URL:

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

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the client


Example: Making a request for client with id 5

                GET https://api.smallinvoice.com/client/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 Client

Example content of data variable:

    {
        "error":false,
        "item":{
            "id":16,
            "type":1,
            "gender":0,
            "number":1000,
            "name":"John Doe",
            "addition":"",
            "vat_id":"",
            "language":"de",
            "phone":"",
            "fax":"",
            "email":"",
            "website":"",
            "notes":"",
            "main_contact_id":0,
            "main_address_id":11,
            "street":"Address",
            "streetno":"",
            "street2":"",
            "code":123,
            "city":"Atlantis",
            "country":"EG",
            "addresses":[
                {
                    "id":11,
                    "street":"Address",
                    "streetno":"",
                    "street2":"",
                    "code":123,
                    "city":"Atlantis",
                    "country":"EG"
                }
            ],
            "contacts":[
                {
                    "id":1,
                    "surname":"Doe",
                    "name":"John",
                    "email":"john.doe@gmail.com",
                    "phone":"",
                    "gender":1
                }
            ],
            "assigns":[
                {
                    "id":3,
                    "employee":"Jane Doe",
                    "comment":"My wife",
                    "hours":3,
                    "year":2013,
                    "month":2,
                    "day":27,
                    "billed":0
                }
            ]
        }
    }
    

You can add a new client with the following URL:

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

Body parameters

NameTypeRequiredDefaultNotes
typeintyesSee Client Types
genderintyesGender of client, applicable with type 1 only. See Client Genders
numberintnonext higher numberYour client number
namestringyesClient name
additionstringnoAdditional name line
vat_idstringnoClient vat number
languagestringyesTwo-letter language code
phonestringnoPhone
faxstringnoFax
emailstringnoEmail
websitestringnoWebsite
notesstringnoNotes about client
addressescollectionyesCollection of Address Objects
contactscollectionnoCollection of Contact Objects


Example: Creating a new client

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

Example content of data variable:
{
    "type":1,
    "gender":0,
    "number":1000,
    "name":"John Doe",
    "addition":"",
    "vat_id":"",
    "language":"de",
    "phone":"",
    "fax":"",
    "email":"",
    "website":"",
    "notes":"",
    "addresses":[
        {
            "street":"Address",
            "streetno":"",
            "code":123,
            "city":"Atlantis",
            "country":"EG"
        }
    ]
}

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 Client Object that was created

Example response:

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

You can edit an client with the following URL:

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

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the client

Body parameters

NameTypeNotes
typeintSee Client Types
genderintGender of client, applicable with type 1 only. See Client Genders
numberintYour client number
namestringClient name
additionstringAdditional name line
vat_idstringClient vat number
languagestringTwo-letter language code
phonestringPhone
faxstringFax
emailstringEmail
websitestringWebsite
notesstringNotes about client
addressescollectionCollection of Address Objects
contactscollectionCollection of Contact Objects


Example: Editing an client with id 5

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

Example content of data variable:
{
    "type":1,
    "gender":0,
    "number":1000,
    "name":"Jane Doe",
    "addition":"",
    "vat_id":"",
    "language":"de",
    "phone":"",
    "fax":"",
    "email":"",
    "website":"",
    "notes":"",
    "addresses":[
        {
            "street":"Address",
            "streetno":"",
            "code":123,
            "city":"Atlantis",
            "country":"EG"
        }
    ]
}

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 client with the following URL:

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

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the client


Example: Making a request for deleting client with id 5

                POST https://api.smallinvoice.com/client/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
    }