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.

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.

Complete a Hello World API call

Step 2

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

Required Variables

Step 3

Set the mk_action variable and mk_data variable:

Variable nameValue - Minimum requirement



{"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 4

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 this is used to create the account
If present this is used to update the account
bus_nameYesBusiness NameAlphanumericABN 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
NoSTP Business branch codeInt with 2 leading 0s001

API Response

Step 5

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


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:

    [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 6

  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.