Retrieve Ledger Accounts
GET
https://api.mpay.com.au/ledger/v1/allAccounts
Query Parameters
- includeClosedstringExampleDescriptionDefaultfalsePattern^(true|false)$
Responses
200
- ledgerAllAccountsResponse_V1
- ledgerAccountsledgerAllAccountsItem[]Description
- ledgerAccountNumberstringExampleDescriptionDefault200000001Pattern^[0-9]{6,12}$
- ledgerUniqueReferencestringExampleDescriptionDefaultCUST-000123Pattern^.{1,50}$
- descriptionstringExampleDescriptionDefaultPrimary settlement ledger for Acme Pty LtdPattern^.{0,255}$
- namestringExampleDescriptionDefaultAcme Pty LtdPattern^.{1,140}$
- isClosedstringExampleDescriptionDefaultfalsePattern^(true|false)$
- createdDateTimestringExampleDescriptionDefault2026-07-23T13:55:59Pattern^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?$
- closedDateTimestringExampleDescriptionDefault2026-07-23T13:55:59Pattern^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?$
- durationMsstringExampleDescriptionDefault42Pattern^[0-9]+$
- statusstringExampleDescriptionDefaultOkPattern^.{1,50}$
- statusDescriptionstringExampleDescriptionDefaultOperation completed successfullyPattern^.{1,255}$
400
- errorResponse_V1
- statusstringExampleDescriptionDefaultErrorPattern^.{1,50}$
- statusDescriptionstringExampleDescriptionDefaultInvalid ledger account number.Pattern^.{1,255}$
- errorCodestringExampleDescriptionDefault400Pattern^[0-9]{3,5}$
- errorMessagestringExampleDescriptionDefaultThe supplied ledger account number could not be found.Pattern^.{1,255}$
- durationMsstringExampleDescriptionDefault42Pattern^[0-9]+$
401
- errorResponse_V1
- statusstringExampleDescriptionDefaultErrorPattern^.{1,50}$
- statusDescriptionstringExampleDescriptionDefaultInvalid ledger account number.Pattern^.{1,255}$
- errorCodestringExampleDescriptionDefault400Pattern^[0-9]{3,5}$
- errorMessagestringExampleDescriptionDefaultThe supplied ledger account number could not be found.Pattern^.{1,255}$
- durationMsstringExampleDescriptionDefault42Pattern^[0-9]+$
500
- errorResponse_V1
- statusstringExampleDescriptionDefaultErrorPattern^.{1,50}$
- statusDescriptionstringExampleDescriptionDefaultInvalid ledger account number.Pattern^.{1,255}$
- errorCodestringExampleDescriptionDefault400Pattern^[0-9]{3,5}$
- errorMessagestringExampleDescriptionDefaultThe supplied ledger account number could not be found.Pattern^.{1,255}$
- durationMsstringExampleDescriptionDefault42Pattern^[0-9]+$
curl
curl --request GET \
--url 'https://api.mpay.com.au/ledger/v1/allAccounts?includeClosed=false' \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.mpay.com.au/ledger/v1/allAccounts?includeClosed=false", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.mpay.com.au/ledger/v1/allAccounts?includeClosed=false")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.mpay.com.au/ledger/v1/allAccounts?includeClosed=false"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// Successful response.
{
"ledgerAccounts": [
{
"ledgerAccountNumber": "200000001",
"ledgerUniqueReference": "CUST-000123",
"description": "Primary settlement ledger for Acme Pty Ltd",
"name": "Acme Pty Ltd",
"isClosed": "false",
"createdDateTime": "2026-07-23T13:55:59",
"closedDateTime": "2026-07-23T13:55:59"
}
],
"durationMs": "42",
"status": "Ok",
"statusDescription": "Operation completed successfully"
}400
// Bad Request - the request was malformed or contained invalid parameters.
{
"status": "Error",
"statusDescription": "Invalid ledger account number.",
"errorCode": "400",
"errorMessage": "The supplied ledger account number could not be found.",
"durationMs": "42"
}401
// Unauthorized - authentication failed, or the API key was missing or invalid.
{
"status": "Error",
"statusDescription": "Invalid ledger account number.",
"errorCode": "400",
"errorMessage": "The supplied ledger account number could not be found.",
"durationMs": "42"
}500
// Internal Server Error - an unexpected error occurred while processing the request.
{
"status": "Error",
"statusDescription": "Invalid ledger account number.",
"errorCode": "400",
"errorMessage": "The supplied ledger account number could not be found.",
"durationMs": "42"
}