Catalog
You can list your available catalog with the following URL:
GET https://api.smallinvoice.com/catalog/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/catalog/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 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
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
id | int | yes | The Id of the catalog |
Example: Making a request for catalog with id 5
GET https://api.smallinvoice.com/catalog/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 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
Name | Type | Required | Default | Notes |
---|---|---|---|---|
type | int | yes | See Catalog Types | |
number | string | no | next higher number | Catalog number |
unit | int | yes | See Catalog Units | |
name | string | yes | Name of catalog entry | |
description | string | no | Description of catalog entry | |
category | string | no | Category of catalog entry | |
vat | float | yes | VAT amount | |
cost_per_unit | float | yes | Cost per one unit | |
cost_vat_included | int | no | 0 | If VAT is included in cost |
notes | string | no | Internal 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
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 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
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
id | int | yes | The Id of the catalog |
Body parameters
Name | Type | Notes |
---|---|---|
type | int | See Catalog Types |
number | string | Catalog number |
unit | int | See Catalog Units |
name | string | Name of catalog entry |
description | string | Description of catalog entry |
category | string | Category of catalog entry |
vat | float | VAT amount |
cost_per_unit | float | Cost per one unit |
cost_vat_included | int | If VAT is included in cost |
notes | string | Internal 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
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 catalog with the following URL:
POST https://api.smallinvoice.com/catalog/delete/
URL Parameters
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
id | int | yes | The Id of the catalog |
Example: Making a request for deleting catalog with id 5
POST https://api.smallinvoice.com/catalog/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 }