Goto APIs

VATs API

General:

Basics:

Base-URL: https://capi.lagerkoll.com/v1/vats/
Parameters in the url should all be encoded and all data sent should be UTF-8

MAX number of requests per minute is set to 200.
When the limit is hit an error with code 429 is returned, with the header "Retry-After" containing the number of seconds you have to wait for your next request.

Headers:

There are 2 ways to be authenticated when using this API. in both ways you add headers to the request.
1) Use an API-key together with store-id. This would be used when communicating machine to machine and no real person is involved. The API-key is available from where you activated the API. The store-id is also available in the same place.
2) Use a user_id and user_token together with a store-id. You get these values from the login-request. The values are connected to a person and are gained when an actual login to the system has been made.
store: <<STORE>>
user_id: <<USER_ID>>
user_token: <<USER_TOKEN>>
api_key: <<API_KEY>>
Accept: application/json
Content-Type: application/json

Errors:

Code Description
900001 Credentials don't match
900101 Common error
900429 Too many requests
901901 Error when getting VATs
901902 Error when creating a VAT
901903 Error when updating a VAT
901904 Error when deleting a VAT
{
  "errorCode" : 900101,
  "errorMessage" : "Something went wrong on the server",
  "errorField" : null,
  "errorData" : null
}

VATs API:

VATs

Get VATs

GETUrl:
Headers:
Accept: application/json or application/xml
Get a list of VATs

Valid parameters:

Parameter Description Default value Allowed values
since 0

Body:
Successfull response:

{ "vats": [{ "isDefault": true, "code": "code", "vat": 7109.5825623776, "description": "description", "id": 6437, "account": 3128 }], "since": 2358 }

Get VAT codes

GETUrl: /codes
Headers:
Accept: application/json or application/xml
Get a list of VAT codes
Body:
Successfull response:

{"vatCodes": [{ "description": "description", "vatValue": 412.1923445433218, "vatCode": "vatCode" }]}

Add VAT

POSTUrl:
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Add a new VAT

Valid parameters:

Parameter Description Default value Allowed values
filter 0 NONE(0), STOCK(1), SERVICE(2)

Body:

{}
Successfull response:

{ "vats": [{ "isDefault": true, "code": "code", "vat": 2925.42069709413, "description": "description", "id": 2718, "account": 5244 }], "since": 903 }

Update VAT

PUTUrl: /{id}
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Update an existing VAT
Body:

{ "isDefault": false, "code": "code", "vat": 3262.706204650215, "description": "description", "id": 5243, "account": 9582 }
Successfull response:

{ "isDefault": false, "code": "code", "vat": 5436.2610929342045, "description": "description", "id": 6266, "account": 9275 }

Delete VAT

DELETEUrl: /{id}
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Delete existing VAT
Body:
Successfull response:

Classes:

VAT

Field Type Description Default Mandatory Accepted values Example values Access
id long R
vat double VAT value in percentage R
account int sales account R
code String vat code R
description String description of vat R
isDefault Boolean default vat R

VATCode

Field Type Description Default Mandatory Accepted values Example values Access
vatCode String R
vatValue double R
description String R

VATCodesResponse

Field Type Description Default Mandatory Accepted values Example values Access
vatCodes List R

VATsResponse

Field Type Description Default Mandatory Accepted values Example values Access
since long R
vats List R