API Documentation

Suffix to alla paths are: /api

PaXML

Autentisering sker med ett token som är unikt för varje företag och erhålles på begäran av supporten.

Tidtransaktioner

/tidtransaktioner/<token> [POST] - Postar XML enligt PaXML i request body

Löntransaktioner

/lontransaktioner/<token> [POST] - Postar XML enligt PaXML i request body

Native API

Header attribute with name "token" and valid token value need to be supplied in the request.

Organization

/organization [GET] - Returns an array of organizations

/organization/<orgid> [GET] - Returns single organization

/organization [POST] - Add new organization

/organization/<orgid> [POST] - Updates existing organization

{ 
    "orgid": "22",
    "name": "Testföretag", 
    "orgno": "5523455678",
    "address": "Storgatan 1",
    "zipcode": "12345", 
    "bank_account": "170125121233",
    "promikbook" : {
    	"api_key": "ABCDEFG",
    	"username": "username",
    	"password": "password"
    }
}

User

/user/<personid> [GET] - Returns single user

/organization/<orgid>/users [GET] - Returns an array of users in given organization

/user [POST] - Add new user

/user/<personid> [POST] - Updates existing user

{ 
    "personid": "23",    
    "email": "test@gmail.com",
    "firstname": "Kalle",
    "surname": "Anka",
    "password": "abc123",
    "orgids": ["22","146"]  
}

Employee

/employee/<orgid>/<empid> [GET] - Returns single employee

/organization/<orgid>/employees [GET] - Returns an array of employees in given organization

/employee/<orgid> [POST] - Add new employee

/employee/<orgid>/<empid> [POST] - Updates existing employee

{ 
    "empid" : "23",
    "firstname": "Kalle",
    "lastname": "Anka",
    "postaddress": "Storgatan 1",
    "postalcode": "12345",
    "email": "test@gmail.com",
    "clearingno": "1701",
    "account": "123456789",
    "period": "30",
    "salary": "25000",
    "taxtable": "32",
    "taxexemption": { "percentage": "20", "amount": "1000" }
}

Transaction

/transaction/<orgid> [POST] - Adds (array of) payroll transactions

{ 
    "transid": "1",
    "empid": "23",    
    "payrollcode": "1132",
    "datefrom": "2015-06-16",
    "dateto": "2015-06-16",
    "counts": "5",
    "unitprice": "23",
    "dimensions": [{"dimid":1, "value":"8780"}, {"dimid":2, "value":"NIS"}]
}
To clear previous transactions for current period, the first item in the array should be a clear record.
{ "clear":"1"}

Returns array of transaction ids

Payslip rows

/row/<orgid>/<empid> [GET] - Returns (array of) payslip rows for given organization and employee

{ 
    "rowid": 3,
    "payrollcode": "1132",
    "datefrom": "2015-06-16",
    "dateto": "2015-06-16",
    "counts": "5",
    "unitprice": "23",
    "extent": "100",
    "transid": 2
}

Accounting

/accounting/<orgid> [POST] - Updates (array of) accounting for payslip rows

[
    { 
        "empid": 23,
        "transid": 3,
        "dimensions": [
        	{"dimid": "1", "value":"8780"},
        	{"dimid": "2", "value":"XA"}
        ],
        "percent": "50"
    },
    { 
        "empid": 23,
        "transid": 3,
        "dimensions": [
        	{"dimid": "1", "value":"8780"},
        	{"dimid": "2", "value":"XA"}
        ],
        "percent": "50"
    }
]

Period

/period/<orgid>/<periodid> [GET] - Returns information about a period

/period/<orgid> [POST] - Adds new period

{ 
    "from": "2016-01-01",    
    "to": "2016-01-31",
    "paydate": "2016-01-25",
    "confirmed": true
}

Arbetsgivardeklaration

/arbetsgivardeklaration/<orgid>/<periodid> [GET] - Returns arbetsgivardeklaration for given organization and period

{ 
    "ruta50" : "100000",
    "ruta51" : "20000",
    "ruta55" : "60000",
    "ruta56" : "18852",
    "ruta57" : "0",
    "ruta58" : "0",
    "ruta59" : "60000",
    "ruta60" : "9600",
    "ruta61" : "0",
    "ruta62" : "0",
    "ruta78" : "28452",
    "ruta81" : "0",
    "ruta82" : "120000",
    "ruta82" : "30000"
}

Payments

/payments/<orgid>/<periodid> [GET] - Returns payments for given organization and period

[
    {"empid": 23, "bank_account": "1234566", "amount": "25000" },
    {"empid": 24, "bank_account": "1234567", , "amount": "26000" }
]

Verifications

/verifications/<orgid>/<periodid> [GET] - Returns verifications for given organization and period

[
       	{
        	 "date": "2016-01-25", 
        	 "text": "Löneutbetalning",
        	 "parts" : [ 
        	             { "account" : "1930", "amount": -25000 },
        	             { "account" : "7210", "amount": 20000 },
        	             { "account" : "2710, "amount": 5000 }
        	           ]
        },
       	{
        	 "date": "2016-02-12", 
        	 "text": "Skattinbetalning",
        	 "parts" : [ 
        	             { "account" : "1930", "amount": -5000 },
        	             { "account" : "2710", "amount": 5000 }
        	           ]
        }
]

Dimension

/dimension/<orgid> [GET] - Returns accounting dimensions

[
	{ 
    	"dimid": "1",    
    	"name": "Kostnadsställe"
  	},
	{ 
    	"dimid": "2",    
    	"name": "Projekt"
  	}
]

Schedule

/schedule/<orgid> [POST] - Adds (array of) worktime shifts

{ 
   	"empid": "23",    
   	"date":"2016-07-02",
   	"starttime": "2016-07-02 08:00",
   	"endtime":"2016-07-02 17:00",
   	"breaks": [{"starttime":"2016-07-02 12:00", "length":"60"}]
}

Error handling

In case of error all services will return an error structure according to the pattern below.

			{
			    "errno": "1001"
			    "errstr": "Invalid zipcode"
			}