Clients
You can list your available clients with the following URL:
GET https://api.smallinvoice.com/client/list/
URL Parameters
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
limit | int | no | 0 | Limit the amount of results | |
page | int | no | 1 | When limiting the results, specifies page | |
sort | string | no | name | name number | Sorts the list by the available values |
sorttype | string | no | desc | asc 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
Name | Type | Notes |
---|---|---|
error | boolean | Is true if an error occured |
errorcode | int | Code of the error. Only returned if error is true. |
errormessage | string | Informational message about the error. Only returned if error is true. |
page | int | Current page that was passed in on the request |
pages | int | Total number of pages available |
count | int | Total number of objects available |
items | collection | Collection 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
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
id | int | yes | The Id of the client |
Example: Making a request for client with id 5
GET https://api.smallinvoice.com/client/get/id/5
Response
Name | Type | Notes |
---|---|---|
error | boolean | Is true if an error occured |
errorcode | int | Code of the error. Only returned if error is true. |
errormessage | string | Informational message about the error. Only returned if error is true. |
item | object | Object 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
Name | Type | Required | Default | Notes |
---|---|---|---|---|
type | int | yes | See Client Types | |
gender | int | yes | Gender of client, applicable with type 1 only. See Client Genders | |
number | int | no | next higher number | Your client number |
name | string | yes | Client name | |
addition | string | no | Additional name line | |
vat_id | string | no | Client vat number | |
language | string | yes | Two-letter language code | |
phone | string | no | Phone | |
fax | string | no | Fax | |
string | no | |||
website | string | no | Website | |
notes | string | no | Notes about client | |
addresses | collection | yes | Collection of Address Objects | |
contacts | collection | no | Collection 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
Name | Type | Notes |
---|---|---|
error | boolean | Is true if an error occured |
errorcode | int | Code of the error. Only returned if error is true. |
errormessage | string | Informational message about the error. Only returned if error is true. |
id | int | The 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
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
id | int | yes | The Id of the client |
Body parameters
Name | Type | Notes |
---|---|---|
type | int | See Client Types |
gender | int | Gender of client, applicable with type 1 only. See Client Genders |
number | int | Your client number |
name | string | Client name |
addition | string | Additional name line |
vat_id | string | Client vat number |
language | string | Two-letter language code |
phone | string | Phone |
fax | string | Fax |
string | ||
website | string | Website |
notes | string | Notes about client |
addresses | collection | Collection of Address Objects |
contacts | collection | Collection 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
Name | Type | Notes |
---|---|---|
error | boolean | Is true if an error occured |
errorcode | int | Code of the error. Only returned if error is true. |
errormessage | string | Informational 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
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
id | int | yes | The Id of the client |
Example: Making a request for deleting client with id 5
POST https://api.smallinvoice.com/client/delete/id/5
Response
Name | Type | Notes |
---|---|---|
error | boolean | Is true if an error occured |
errorcode | int | Code of the error. Only returned if error is true. |
errormessage | string | Informational message about the error. Only returned if error is true. |
Example response:
{ "error":false }