^Login

Creating Microkeeper Account via API


This guide will explain how to create a Microkeeper account via the API.


This is only for Resellers of Microkeeper that have been whitelisted.



Complete a Hello World API call


Before starting this tutorial make sure you have completed the Hello World tutorial.




Creating and updating a Microkeeper accounts via API


Reseller Access

Step 1

In this scenario the reselling is doing the billing of Microkeeper and they are provisioning the Microkeeper account.

The reseller must include links to our Terms of use and Privacy Policy as part of the account provisioning process, with a checkbox sign process included.

They will need to store the returned mk_biz_key if they wish to utilise other API endpoints.

There is a vetting process to becoming a reseller.


Required Variables

Step 2

Set the mk_action variable and mk_data variable:

Variable nameValue - Minimum requirement
mk_action

create_account

mk_data

{"business_id":"abc123","bus_name":"Business name Pty Ltd","email":"test@gmail.com","abn":"95149280320"}


Since there is no Microkeeper account yet, the mk_biz_key must be set to that of the developer.

The API will check that the integrator has reseller rights with Microkeeper, if not an error will be returned.


mk_data Payload

Step 3


Field NameRequiredDescriptionFormatExampleNotes
business_idYesThis is your ID, it must be unique to each account in your databaseAlphanumeric and some special character up to 32 characters wjf2Ns4kj6e78a9s90dhfkhAksIf not present in Microkeeper this is used to create the account
If present in Microkeeper this is used to update the account
bus_nameYesBusiness NameAlphanumericABC Engineering Pty LtdThis is used to generate the username
emailYesEmail AddressEmail formattest@gmail.comEmail address must be verified before passing
abnYesAustralian Business NumberABN validation51 824 753 556If ABN is invalid API call will fail and error message returned
phonenoNoFor all non mobile numbersNumeric1800 000 111
mobileNoMobile phone numbersNumeric starting with 040411 222 333
noemployeesNoNumber of employeesInteger10Helpful for our sales and support staff to recommend modules
branchNoSTP Business branch codeInt with 2 leading 0s001
activeNoMake the account active (1)0 = Inactive
1 = Active
2 = Suspended
1The first time the account is create this value is set to 0 once the user logs in for the first time it changes to 1
This field can be used to suspended an account due to: billing issues or inactivity
super_freqNoHow often the Business processes superpay = Each Payrun
mth = Monthly
qtr = Quarterly
qtr
accountingNo

Possible options
xero
myob
comp (Companion Software)

max 4 char lowercasexeroIf unknown leave blank or exclude

If known but not listed as an option, you can still pass through in the allowed format
starting_day
NoStarting day of the payrun weeklowercase day of the week
monday,tuesday,etc
mondayUsed to create the primary pay cycle

Eg if monday pay cycles will be monday to sunday

No impact on monthly pay cycles, if unknown set to monday
trading
NoTrading name if different from Business NameAlphanumeric
ABC Engineering
firstname
NoPrimary Contact of BusinessStringJohn
lastname
NoPrimary Contact of Business
String
Smith
address
NoAddress of HQ - Line 1Alphanumeric
Unit 10
address2
NoAddress of HQ - Line 2
Alphanumeric
1 Main St

city
NoAddress suburbAlphanumeric
Belmont

state
No
Australian StateVIC, ACT, NSW, NT, QLD, SA, TAS, WA, OTH
VICIf outside of Australia set the value to OTH
postcode
No
Australia Post CodeInt to 4 chars3216

country
No
Country2 char country code, ISO formatAUhttps://www.iban.com/country-codes



API Response

Step 4

If successful Microkeeper will response with the following fields in the data object:

Field NameDescriptionFormatExample
usernameMicrokeeper will generate this username from the bus_name you provide, it will be unique for all Microkeeper accounts.
We use this internally to help with support.
lowercase and underscoreabc_engineering
mk_biz_keyThis is used to access the data within the account going forwards32 digit keytt50SukqohfGwcwlyyxtPWOF390UXdBv
business_idThe business_id that was passed in, this should be compared to the original ID to make sure they match
If they do not match and the same business_id is used again, we could end up with duplicates.
Alphanumeric and some special character up to 32 charactersabc123
update0 = New account created
1 = Existing account updated
Boolean1


Example

JSON response:

{"success":1,"authenticated":1,"message":"Registration Successful","data":{"username":"abc_engineering","mk_biz_key":"tt50SukqohfGwcwlyyxtPWOF390UXdBv","business_id":"abc123","update":1}}


Same response as an array:

Array
(
    [success] => 1
    [authenticated] => 1
    [message] => Registration Successful
    [data] => Array
        (
            [username] => abc_engineering
            [mk_biz_key] => tt50SukqohfGwcwlyyxtPWOF390UXdBv
            [business_id] => abc123
           [update] => 1
        )
)



Things to Test

Step 5

  1. Make sure if the same business_id is passed multiples times only one account is created.
    The username returned should always be the same and update should be set to 0 on the first API call and 1 for each API call after that.

  2. If success is set to 0 then message is an error message and best practice would be to return this to the user.
    Example "ABN is not valid"

  3. Test a business name with special characters to make sure they are encoded correctly and not breaking the JSON.
    Microkeeper will sanitise this data, so it's likely some characters will be removed, but still pass validation.
    Example ABC ~!@#$%^&*()_+`1{{}|[]\:",./?>< PTY LTD

  4. If compromised a mk_biz_key will need to be replaced, so it should be possible to run the provisioning process again.




Adding a Bank account Via API

When provisioning an account you can add the business bank account.

This step is optional, bank accounts can also be managed in Microkeeper.

The account holder will still need to go through a verification process for the primary bank account before paying super.


Required Variables

Step 1

Set the mk_action variable and mk_data variable:

Variable nameValue - Minimum requirement
mk_action

add_bank_details

mk_data

{"bank_title":"Business ABC","bank_BSB":"063504","bank_account_no":"111222333"}


mk_data Payload

Step 3

Field NameRequiredDescriptionFormat, OptionsExample
bank_titleYesBank account TitleAlphanumeric, some special characters will be removed if incompatible with the ABA file standardsBusiness ABC
bank_BSBYesBank account BSBxxx-xxx or xxxxxx
Leading 0s are adding if missing
Must be a valid BSB number
63504 or 063504 or 063-504
bank_account_noYesBank account NumberNumeric12345679
Optional



bank_nicknameNoNickname AlphanumericPrimary
GIDNoGroup ID@ID
Default @all
We do not recommend including this
@all
bank_codeNoCode from the Bank3 char upper case
Recommend else ABA file will fail
Full list below
ANZ
bank_APCANoNumber provided by the bank6 digit number, default to 000000 as not required by many banks000000
bank_noteNoNote that will appear on the bank statementString, default is "Wages" 12 Char maxWages


List of all BSBs

http://bsb.apca.com.au/

This list of BSB is maintained, it's recommended to update your application on a periodic basis.

Example monthly for high volume or annually for low volume.


bank_code list


ANZ has some inconsistency between ANZ products, so workarounds need to be in place when generating the ABA file, AN2 and AN3 are converted to ANZ when the ABA file is created


bank_codeBank Name
AMPAMP Bank
ANZANZ - Business
AN2ANZ - Transactive
AN3ANZ - Transactive Global
ARAArab Bank Australia
MPBAuswide Bank
BAUBank Australia
BALBank of America
BOCBank of China Australia
BCYBank of Cyprus Australia
BOMBank of Melbourne
BOQBank of Queensland
BSABankSA
BWABankWest
BBLBendigo Bank
BYBBeyond Bank Australia
CTICitibank
CBACommonwealth Bank of Australia
CUACredit Union Aust Ltd
SGEG and C Mutual Bank
GBSGreater Building Society
HBAHSBC Bank Australia
IMBIllawarra Mutual Building Society
CUSIndue Ltd
INGING Bank
MBLMacquarie Bank
MEBMembers Equity Bank
CRUMyState Bank
NABNational Australia Bank
PIBRabobank Australia Limited
QTMRACQ Bank
RBAReserve Bank of Australia
STGSt George Bank
SCUSummerland Credit Union
METSuncorp-Metway
MSLTyro Payments Limited
UOBUnited Overseas Bank
WB2Westpac - Balance Line
WBCWestpac - No Balance Line

 

Responses

{ "success":"1", "authenticated":"1", "message":"Bank account added" }

If a bank account is already present with the same details, the response success will still be true.

{ "success":"1", "authenticated":"1", "message":"This bank account is already present" }

Failed response

{ "success":"0", "authenticated":"1", "message":"BSB not found" }