Reckon One API v2

API change history

This is version 2 of the Reckon One API.

Gets a ledger account.

Get a particular ledger account.

GET /5af6572c-9771-4b86-995d-3374d3bc683c/ledgeraccounts/c3b904ef-c44e-405d-8359-51f1f7068d76


Get just the required fields, e.g. id and name. Find out more about selecting.

GET /5af6572c-9771-4b86-995d-3374d3bc683c/ledgeraccounts/c3b904ef-c44e-405d-8359-51f1f7068d76?select=id,name

Try it

Request

Request URL

Request parameters

  • string

    Format - guid. The book's id.

  • string

    Format - guid. The ledger account's id.

Request headers

  • string
    Subscription key which provides access to this API. Found in your Profile.

Request body

Responses

200 OK

The requested ledger account.

Representations

{
  "id": "671d6728-110b-43b3-867d-d3cdd6ff6843",
  "name": "Account name",
  "description": "Account description",
  "fullName": "Parent account name:Account name",
  "isDebit": true,
  "parentLedgerAccount": {
    "id": "d4012795-b884-47a9-a6bb-eb4bb7d2B374",
    "name": "Parent account name"
  },
  "sortOrder": 14,
  "status": "Active",
  "defaultTaxRate": {
    "id": "4fd92639-7b2b-473e-9f66-38880edaD933",
    "name": "GST"
  },
  "accountType": "Income",
  "systemAccount": true,
  "accountCode": "4-0000",
  "exportCode": "230",
  "bankAccount": {
    "closedAsOfDate": "2022-01-13T12:00:00Z",
    "dateOpened": "2019-01-01T12:00:00Z",
    "lockoffDate": "2020-06-30T12:00:00Z",
    "bankBranchNumber": "123456",
    "bankAccountName": "John Smith",
    "bankAccountNumber": "987654",
    "openingBalance": 1456.43,
    "isCash": false,
    "financialInstitution": {
      "id": "7323d45f-6432-4990-8129-bfd0f91eeeb4",
      "name": "Westpac Banking Corporation"
    },
    "includeBalancingTransaction": false,
    "payerIdentifier": "125876"
  },
  "creditAccount": {
    "closedAsOfDate": "2022-01-13T12:00:00Z",
    "dateOpened": "2019-01-01T12:00:00Z",
    "lockoffDate": "2019-01-01T12:00:00Z",
    "openingBalance": 1456.43
  },
  "balance": 83712.15,
  "lastModifiedDateTime": "2019-09-27T10:20:46Z",
  "externalClient": {
    "id": "2296ba1d-c0c4-44d2-bf12-9681098a9afa",
    "tenancyId": "1293848",
    "resourceId": "134"
  }
}
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The account's unique id.",
      "format": "guid",
      "example": "671d6728-110b-43b3-867d-d3cdd6ff6843"
    },
    "name": {
      "type": "string",
      "description": "The name of the account.",
      "example": "Account name"
    },
    "description": {
      "type": "string",
      "description": "The description of the account.",
      "example": "Account description"
    },
    "fullName": {
      "type": "string",
      "description": "The full name of the account.",
      "example": "Parent account name:Account name"
    },
    "isDebit": {
      "type": "boolean",
      "description": "Whether amounts in this account are usually debits.",
      "example": true
    },
    "parentLedgerAccount": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "The unique id.",
              "format": "guid",
              "nullable": true
            },
            "name": {
              "type": "string",
              "description": "The unique name.",
              "nullable": true
            }
          },
          "additionalProperties": false,
          "description": "Reference to a ledger account."
        }
      ],
      "description": "The parent ledger account if there is one.",
      "nullable": true,
      "example": {
        "id": "d4012795-b884-47a9-a6bb-eb4bb7d2B374",
        "name": "Parent account name"
      }
    },
    "sortOrder": {
      "type": "integer",
      "description": "The order in which the user would like to sort the account relative to other accounts.",
      "format": "int32",
      "example": 14
    },
    "status": {
      "oneOf": [
        {
          "enum": [
            "Active",
            "Inactive"
          ],
          "type": "string",
          "description": "The status of a ledger account.",
          "x-enumNames": [
            "Active",
            "Inactive"
          ]
        }
      ],
      "description": "The account status.",
      "example": "Active"
    },
    "defaultTaxRate": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "The unique id.",
              "format": "guid",
              "nullable": true
            },
            "name": {
              "type": "string",
              "description": "The unique name.",
              "nullable": true
            }
          },
          "additionalProperties": false,
          "description": "Reference to a tax rate."
        }
      ],
      "description": "The default tax rate for the account.",
      "nullable": true,
      "example": {
        "id": "4fd92639-7b2b-473e-9f66-38880edaD933",
        "name": "GST"
      }
    },
    "accountType": {
      "oneOf": [
        {
          "enum": [
            "Income",
            "Expense",
            "CurrentAsset_Other",
            "CurrentLiability_Other",
            "Equity",
            "Income_Other",
            "Expense_Other",
            "Expense_CostOfGoodsSold",
            "CurrentAsset_Bank",
            "CurrentAsset_AccountsReceivable",
            "NonCurrentAsset_Fixed",
            "NonCurrentAsset_Other",
            "CurrentLiability_CreditCard",
            "CurrentLiability_AccountsPayable",
            "NonCurrentLiability"
          ],
          "type": "string",
          "description": "The ledger account type.",
          "x-enumNames": [
            "Income",
            "Expense",
            "CurrentAsset_Other",
            "CurrentLiability_Other",
            "Equity",
            "Income_Other",
            "Expense_Other",
            "Expense_CostOfGoodsSold",
            "CurrentAsset_Bank",
            "CurrentAsset_AccountsReceivable",
            "NonCurrentAsset_Fixed",
            "NonCurrentAsset_Other",
            "CurrentLiability_CreditCard",
            "CurrentLiability_AccountsPayable",
            "NonCurrentLiability"
          ]
        }
      ],
      "description": "The account type.",
      "example": "Income"
    },
    "systemAccount": {
      "type": "boolean",
      "description": "Whether account is categorised as System or not.",
      "example": true
    },
    "accountCode": {
      "type": "string",
      "description": "The account code.",
      "nullable": true,
      "example": "4-0000"
    },
    "exportCode": {
      "type": "string",
      "description": "The export code for the account.",
      "nullable": true,
      "example": "230"
    },
    "bankAccount": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "closedAsOfDate": {
              "type": "string",
              "description": "When the account was closed.",
              "format": "date-time",
              "nullable": true,
              "example": "2022-01-13T12:00:00Z"
            },
            "dateOpened": {
              "type": "string",
              "description": "When the account was opened.",
              "format": "date-time",
              "nullable": true,
              "example": "2019-01-01T12:00:00Z"
            },
            "lockoffDate": {
              "type": "string",
              "description": "The date when transactions are locked.\nTransactions dated on or before this date cannot be amended.",
              "format": "date-time",
              "nullable": true,
              "example": "2020-06-30T12:00:00Z"
            },
            "bankBranchNumber": {
              "type": "string",
              "description": "The branch number (BSB or Sort Code).",
              "nullable": true,
              "example": "123456"
            },
            "bankAccountName": {
              "type": "string",
              "description": "The name of the account holder.",
              "nullable": true,
              "example": "John Smith"
            },
            "bankAccountNumber": {
              "type": "string",
              "description": "The account number.",
              "nullable": true,
              "example": "987654"
            },
            "openingBalance": {
              "type": "number",
              "description": "The opening balance, if there is one.",
              "format": "decimal",
              "nullable": true,
              "example": 1456.43
            },
            "isCash": {
              "type": "boolean",
              "description": "Whether the account is cash.",
              "example": false
            },
            "financialInstitution": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The unique id.",
                      "format": "guid",
                      "nullable": true
                    },
                    "name": {
                      "type": "string",
                      "description": "The unique name.",
                      "nullable": true
                    }
                  },
                  "additionalProperties": false,
                  "description": "Reference to a financial institution."
                }
              ],
              "description": "Details of the financial institution.",
              "nullable": true,
              "example": {
                "id": "7323d45f-6432-4990-8129-bfd0f91eeeb4",
                "name": "Westpac Banking Corporation"
              }
            },
            "includeBalancingTransaction": {
              "type": "boolean",
              "description": "Whether to include a balancing transaction.",
              "example": false
            },
            "payerIdentifier": {
              "type": "string",
              "description": "The APCA number to identify the payer.",
              "nullable": true,
              "example": "125876"
            }
          },
          "additionalProperties": false,
          "description": "Details of a bank account."
        }
      ],
      "description": "The bank account details when the `accountType` is `CurrentAsset_Bank`.",
      "nullable": true
    },
    "creditAccount": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "closedAsOfDate": {
              "type": "string",
              "description": "When the account was closed.",
              "format": "date-time",
              "nullable": true,
              "example": "2022-01-13T12:00:00Z"
            },
            "dateOpened": {
              "type": "string",
              "description": "When the account was opened.",
              "format": "date-time",
              "nullable": true,
              "example": "2019-01-01T12:00:00Z"
            },
            "lockoffDate": {
              "type": "string",
              "description": "The date when transactions are locked.\nTransactions dated on or before this date cannot be amended.",
              "format": "date-time",
              "nullable": true,
              "example": "2019-01-01T12:00:00Z"
            },
            "openingBalance": {
              "type": "number",
              "description": "The opening balance, if there is one.",
              "format": "decimal",
              "nullable": true,
              "example": 1456.43
            }
          },
          "additionalProperties": false,
          "description": "Details of a credit account."
        }
      ],
      "description": "The credit account details when the `accountType` is `CurrentLiability_CreditCard`.",
      "nullable": true
    },
    "balance": {
      "type": "number",
      "description": "The account's balance as of now.",
      "format": "decimal",
      "nullable": true,
      "example": 83712.15
    },
    "lastModifiedDateTime": {
      "type": "string",
      "description": "The date and time when the account was last modified.",
      "format": "date-time",
      "example": "2019-09-27T10:20:46Z"
    },
    "externalClient": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "The external client application's id.",
              "format": "guid",
              "example": "2296ba1d-c0c4-44d2-bf12-9681098a9afa"
            },
            "tenancyId": {
              "type": "string",
              "description": "The external book/file/tenancy/etc's id.",
              "nullable": true,
              "example": "1293848"
            },
            "resourceId": {
              "type": "string",
              "description": "The external resource's id.",
              "nullable": true,
              "example": "134"
            }
          },
          "additionalProperties": false,
          "description": "Details of an external client's resource."
        }
      ],
      "description": "Details of any external client resource.",
      "nullable": true
    }
  },
  "additionalProperties": false,
  "description": "Details of a ledger account."
}

401 Unauthorized

The authentication token is missing, expired or invalid.

Representations

{
  "message": "Authorization has been denied for this request.",
  "code": 401
}
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "The description of the error.",
      "nullable": true,
      "example": "Authorization has been denied for this request."
    },
    "code": {
      "type": "integer",
      "description": "The HTTP status code of the error.",
      "format": "int32",
      "example": 401
    }
  },
  "additionalProperties": false,
  "description": "Response sent when a 401 Unauthorized error occurs."
}

403 Forbidden

The user does not have permission to retrieve the ledger account.

Representations

{
  "message": "User does not have permission to access this resource.",
  "code": 403
}
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "The description of the error.",
      "nullable": true,
      "example": "User does not have permission to access this resource."
    },
    "code": {
      "type": "integer",
      "description": "The HTTP status code of the error.",
      "format": "int32",
      "example": 403
    }
  },
  "additionalProperties": false,
  "description": "Response sent when a 403 Forbidden error occurs."
}

404 Not Found

The specified book or ledger account does not exist.

Representations

{
  "message": "Resource not found.",
  "code": 404
}
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "The description of the error.",
      "nullable": true,
      "example": "Resource not found."
    },
    "code": {
      "type": "integer",
      "description": "The HTTP status code of the error.",
      "format": "int32",
      "example": 404
    }
  },
  "additionalProperties": false,
  "description": "Response sent when a 404 Forbidden error occurs."
}

Code samples

@ECHO OFF

curl -v -X GET "https://api.reckon.com/r1/v2/{bookId}/ledgeraccounts/{accountId}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            var uri = "https://api.reckon.com/r1/v2/{bookId}/ledgeraccounts/{accountId}?" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://api.reckon.com/r1/v2/{bookId}/ledgeraccounts/{accountId}");


            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}

<!DOCTYPE html>
<html>
<head>
    <title>JSSample</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>

<script type="text/javascript">
    $(function() {
        var params = {
            // Request parameters
        };
      
        $.ajax({
            url: "https://api.reckon.com/r1/v2/{bookId}/ledgeraccounts/{accountId}?" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
    });
</script>
</body>
</html>
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://api.reckon.com/r1/v2/{bookId}/ledgeraccounts/{accountId}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://api.reckon.com/r1/v2/{bookId}/ledgeraccounts/{accountId}');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
})

try:
    conn = httplib.HTTPSConnection('api.reckon.com')
    conn.request("GET", "/r1/v2/{bookId}/ledgeraccounts/{accountId}?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
})

try:
    conn = http.client.HTTPSConnection('api.reckon.com')
    conn.request("GET", "/r1/v2/{bookId}/ledgeraccounts/{accountId}?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://api.reckon.com/r1/v2/{bookId}/ledgeraccounts/{accountId}')

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body