API Accounts
The account actions let an approved reseller set up Microkeeper accounts for their customers. create_account creates an account and returns its business key. The other actions set up the account's bank accounts, ABNs and pay cycles, and choose which payroll officers can see each pay cycle.
| Who it's for | Resellers approved by Microkeeper |
|---|---|
| Actions | create_account, add_bank_details, upsert_abn_v2, upsert_pay_cycle_v2, upsert_access_user_pay_cycle, get_abn_pay_cycle |
| Business key access | create_account: none. The others: Account, Read/Write, or Read Only for get_abn_pay_cycle |
This guide covers how to:
- Create and update an account.
- Add a bank account.
- Add and update ABNs.
- Add and update pay cycles.
- Choose who can see each pay cycle.
- Get the ABNs and pay cycles.
Before you start, make your keys and test your connection: see Microkeeper API.
Become a reseller
Resellers bill their customers for Microkeeper and set up their accounts. To become one, contact Microkeeper: there's a vetting process, and Microkeeper turns on reseller access for your developer key. When you set up an account, your sign-up must link to Microkeeper's Terms of Use and Privacy Policy, with a box the customer ticks to agree.
Create and update an account with create_account
Send create_account with your developer key and your own account's business key. Microkeeper checks your developer key has reseller access.
Example
{
"business_id": "cust-20419",
"bus_name": "Harbour Lane Cafe Pty Ltd",
"trading": "Harbour Lane Cafe",
"abn": "51824753556",
"email": "accounts@harbourlanecafe.com.au",
"firstname": "Priya",
"lastname": "Nair",
"phoneno": "0355501234",
"address": "12 Harbour Lane",
"city": "Geelong",
"state": "VIC",
"postcode": "3220",
"starting_day": "monday",
"noemployees": 12,
"active": 1
}How accounts are matched
business_id is your ID for the customer. The first time you send it, an account is created. After that, sending it again updates that account, so a retry never makes a second account. Keep each customer's business_id unique and unchanging.
Fields
| Field | Required | What it is |
|---|---|---|
business_id | Yes | Your ID for the customer, up to 64 characters |
bus_name | Yes | The business name. The account's username is made from it |
abn | Yes | The business's ABN. It must be a valid ABN |
email | Yes | The business's email address. Verify it before you send it |
starting_day | Yes, to use the account through the API | The day the business's pay week starts: monday to sunday. It sets up the account's pay weeks. If you don't know it, send monday |
trading | No | The trading name, if it's different |
firstname, lastname | No | The business's main contact |
phoneno, mobile | No | Landline and mobile numbers |
address, address2, city, state, postcode | No | The head office address. state is VIC, NSW, ACT, QLD, SA, WA, TAS, NT, or OTH outside Australia |
country | No | A 2-letter country code. Defaults to AU |
noemployees | No | The number of staff, from 1 to 20000 |
branch | No | The STP branch number. Defaults to 001 |
super_freq | No | How often the business pays super: pay each pay run, mth monthly, qtr quarterly |
accounting | No | The accounting software: xero, myob or comp (Companion). Leave it out if you don't know |
active | No | On an update: 1 active, 2 suspended, such as for unpaid bills, 0 inactive. New accounts start inactive until the business first logs in |
LID_hours, ROID_hours, job_hours, date_hours | No | 1 to break payslip hours down by Location, Role, Job or date. Location is on by default; the others are off |
An update sets every field above except business_id, starting_day, noemployees, mobile, branch and accounting, which are set when the account is created. Send every field on each update, including active: a field you leave out goes back to its default, and an account sent without active is made active.
Response
{"success":"1","authenticated":"1","message":"Registration Successful","data":{"username":"harbour_lane_ca","mk_biz_key":"tt50SukqohfGwcwlyyxtPWOF390UXdBv","business_id":"cust-20419","update":0}}| Field | What it is |
|---|---|
username | The account's username, made from the business name. It never changes, and helps Microkeeper's support team find the account |
mk_biz_key | The account's business key, with Read/Write access to every module. It's sent only when the account is created: store it securely straight away |
business_id | The business_id you sent. Check it matches |
update | 0 if the account was created, 1 if it was updated |
Use the account's mk_biz_key, with your developer key, for every other action on that account. If a key is lost or exposed, the business revokes it and makes a new one in Settings: see Microkeeper API.
Errors
This dev key is not set as a reseller: contact Microkeeper to become a reseller.A mandatory field is missing: business_id, abn, bus_name, emailThe ABN (12345678901) failed validationEmail address invalid,Number of employees invalidAllow values for active at 0, 1, 2
Show the message to your customer so they can fix it. Several problems can be reported in one message.
Test your set-up
- Send the same
business_idtwice: the second response has the sameusernameandupdate1. - Send a business name with symbols, such as
O'Brien & Sons (Aust.) Pty Ltd, and check the JSON arrives intact. Some symbols are removed from the username. - Call
hello_worldwith the new account's key.
Add a bank account with add_bank_details
Add the business's bank account, for paying wages and super. The business still verifies its main bank account in Microkeeper before paying super.
{"bank_title":"HARBOUR LANE CAFE","bank_BSB":"062-000","bank_account_no":"12345678","bank_nickname":"Wages","bank_code":"CBA","bank_note":"Wages"}| Field | Required | What it is |
|---|---|---|
bank_title | Yes | The account name. Characters bank files can't use are removed |
bank_BSB | Yes | The BSB, as 062-000 or 062000. It must be on the official BSB list |
bank_account_no | Yes | The account number |
bank_nickname | Yes | A name for the account in Microkeeper, unique in the business |
bank_code | Recommended | The bank's 3-letter code, such as CBA. Without it, the bank file may be refused. See below |
bank_APCA | No | The 6-digit APCA number, if the bank gave you one |
bank_note | No | The description on staff bank statements, up to 12 characters. Defaults to Wages |
A BSB and account number already in Microkeeper updates that bank account; otherwise it's added. On an update, optional fields you leave out go back to their defaults.
Response
{"success":"1","authenticated":"1","message":"Bank Details successful","data":{"BDID":"362","update":0}}BDID is the bank account's ID. Use it as the bank account for an ABN or pay cycle. update is 1 if an existing account was updated.
Errors
bank_title missing or blank,bank_BSB missing,bank_account_no missing or blank,bank_nickname missing or blankBSB not found: check the BSB against the bank's details.Bank Nickname must be unique
Add and update ABNs with upsert_abn_v2
Each ABN pays one or more pay cycles, and reports its pay runs to the ATO through STP. Match ABNs by your own ID, abn_third_ID, or by Microkeeper's ABNID from get_abn_pay_cycle.
{"abn_third_ID":"cust-20419-abn-1","abn":"51824753556","abn_name":"Harbour Lane Cafe Pty Ltd","abn_trading":"Harbour Lane Cafe","abn_branch":"001","abn_address1":"12 Harbour Lane","abn_city":"Geelong","abn_state":"VIC","abn_postcode":"3220","abn_email":"accounts@harbourlanecafe.com.au","abn_phone":"0355501234","abn_accounting":"xero","abn_BDID":362}| Field | Required | What it is |
|---|---|---|
abn_third_ID or ABNID | One of them | Your ID for the ABN, or Microkeeper's. A new abn_third_ID adds an ABN |
abn | Yes | The 11-digit ABN |
abn_name | No | The ABN's registered name, up to 50 characters |
abn_trading | No | The trading name, up to 50 characters |
abn_branch | No | The STP branch number. Defaults to 001 |
abn_address1, abn_address2, abn_city, abn_state, abn_postcode, abn_country | No | The ABN's address, for STP and super. Country defaults to Australia |
abn_email, abn_phone | No | Contact details, for STP and super |
abn_accounting | No | The accounting software: xero, myob, qb (QuickBooks), reck (Reckon), ms (Business Central), comp (Companion), excel, or false for other |
abn_BDID | No | The bank account super is paid from: its BDID |
payg_aba_ref | No | The ATO's payment reference for PAYG withholding |
agent_ABN, agent_number, agent_is_TAN | No | For STP through a tax or BAS agent: the agent's ABN, their number, and 1 if it's a TAN or 0 if it's a RAN |
hide | No | 1 to hide the ABN |
Send every field on each update: fields you leave out go back to their defaults. An ABN's number is set when it's added. To pay from a different ABN, add it as a new ABN and move the pay cycles to it.
Response
{"success":"1","authenticated":"1","message":"ABN added"}The message is ABN added or ABN updated. Get the new ABN's ABNID from get_abn_pay_cycle, or keep matching by your abn_third_ID.
Errors
abn missing,ABNID or abn_third_ID missingThe ABN (51824753557) failed validationBank Account not found: check theabn_BDID.
Add and update pay cycles with upsert_pay_cycle_v2
A pay cycle is a group of staff paid together, such as Weekly or Monthly, under one ABN. Match pay cycles by your own ID, pc_third_ID, or by Microkeeper's PCID. Add new pay cycles with a pc_third_ID.
{
"abn_third_ID": "cust-20419-abn-1",
"pc_third_ID": "cust-20419-weekly",
"title": "Weekly",
"wip": 1,
"start_day": "monday",
"arrears": 3,
"BDID": 362,
"access": 1,
"access_euser_ary": ["priya_nair"],
"euser_ary": ["noah_reid", "amelia_brown"],
"hide": 0
}| Field | Required | What it is |
|---|---|---|
pc_third_ID or PCID | One of them | Your ID for the pay cycle, or Microkeeper's |
abn_third_ID or ABNID | One of them | The ABN that pays the pay cycle. Add it first |
title | Yes | The pay cycle's name, up to 24 characters, unique in the business |
wip | Yes | How often staff are paid: 1 weekly, 2 fortnightly, 24 semi-monthly, 12 monthly |
start_day | Yes | The day the pay week starts, monday to sunday. Monthly and semi-monthly pay cycles use monday |
arrears | No | Days after the period ends that staff are paid, from -14 to 20. Defaults to 0 |
BDID | No | The bank account wages are paid from |
super_BDID | No | The bank account super is paid from. 0 (the default) uses the ABN's |
access | No | 0 (the default): every payroll officer can see the pay cycle. 1: only the officers you list. See below |
access_euser_ary, access_EID_list or access_EmployeeID_list | With access 1 | A list of the payroll officers who can see the pay cycle, by username, EID or EmployeeID. It replaces the list |
euser_ary, EID_list or EmployeeID_list | No | A list of the staff paid in the pay cycle, by username, EID or EmployeeID. It replaces the pay cycle's staff, and moves them out of their other pay cycles |
hide | No | 1 to hide the pay cycle |
Send every field on each update: arrears, the bank accounts, access and hide go back to 0 if you leave them out. Leave out the staff list if your software doesn't manage who's in the pay cycle. To move one employee to a pay cycle, send PCID_third_ID on the employee: see API Employee.
Response
{"data":{"access_user_list":["priya_nair"],"user_list":["noah_reid","amelia_brown"],"PCID":"8","update":0},"success":"1","authenticated":"1","message":"Pay Cycle successful"}PCID is the pay cycle's ID, and update is 1 if it was updated. access_user_list and user_list list the officers and staff Microkeeper found: compare them with what you sent, as usernames it can't find are left out.
Errors
ABNID or abn_third_ID missing,PCID or pc_third_ID missing,title missing,wip missing,start_day missingAllowed values for wip at 1, 2, 12, 24Allowed values for start_day are: monday, tuesday, wednesday, thursday, friday, saturday, sundayif access is set to 1, access_euser_ary, access_EID_list or access_EmployeeID_list must be presentABN not found: add the ABN first.Pay Cycle Title already presentWage Bank Account not found,Super Bank Account not found
Choose who can see each pay cycle with upsert_access_user_pay_cycle
Set the pay cycles each payroll officer can see. Send each officer with their full list: it replaces what they had. Officers you don't send are left as they are.
{
"access_euser_ary": {
"priya_nair": { "third_ID": ["cust-20419-weekly", "cust-20419-monthly"] },
"sam_lee": { "PCID": ["8"] },
"old_manager": "revoke"
}
}- Key the officers by username in
access_euser_ary, by EID inaccess_EID_list, or by EmployeeID inaccess_EmployeeID_list. - List pay cycles by your
third_IDor byPCID. - Send
"revoke"to remove an officer from every pay cycle. - Each pay cycle you grant is set to show only to its listed officers.
Every officer must be in Microkeeper: if one isn't found, nothing changes.
Response
{"success":"1","authenticated":"1","message":"Pay Cycle User Access Successful"}Errors
Either access_euser_ary, access_EID_list or access_EmployeeID_list must be presentEmployee access count does not match: an officer isn't in Microkeeper. Check each username.Pay Cycle third_ID (cust-20419-weekly) not found,Pay Cycle PCID (8) not found
Get the ABNs and pay cycles with get_abn_pay_cycle
Send {}. Every ABN is returned, with its pay cycles:
{
"success": "1",
"authenticated": "1",
"message": "ABN and Pay Cycle config",
"data": {
"abn_ary": [
{
"ABNID": 194,
"third_ID": "cust-20419-abn-1",
"ABN": "51824753556",
"abn_name": "Harbour Lane Cafe Pty Ltd",
"abn_trading": "Harbour Lane Cafe",
"abn_branch": "001",
"abn_address1": "12 Harbour Lane",
"abn_address2": "",
"abn_city": "Geelong",
"abn_state": "VIC",
"abn_postcode": "3220",
"abn_country": "Australia",
"BDID": 362,
"abn_email": "accounts@harbourlanecafe.com.au",
"abn_phone": "0355501234",
"abn_accounting": "xero",
"payg_aba_ref": "",
"agent_ABN": "0",
"agent_is_TAN": 0,
"agent_number": "0",
"hide": 0,
"default_super_fund": { "SFID": 8, "USI": "STA0100AU" },
"pay_cycle_ary": [
{
"PCID": 4192,
"third_ID": "cust-20419-weekly",
"title": "Weekly",
"wip": 1,
"start_day": "monday",
"arrears": 3,
"ABNID": 194,
"BDID": 362,
"super_BDID": 0,
"access": 1,
"GID": 59462,
"hide": 0,
"access_euser_ary": ["priya_nair"]
}
]
}
]
}
}The fields match the ones you send, plus:
default_super_fund: the ABN's default super fund, or[]if none is set.GID: the Group of staff in the pay cycle. Use it to find an employee's pay cycle from theirgroupsinget_employees.access_euser_ary: the payroll officers who can see the pay cycle.
Errors
No ABN found,No Pay Cycles found: the account has no ABNs or pay cycles yet.