Introduction
Using these API functions, you can request a wide variety of financial data for use in external reporting and financial administration software.
Contents
Financial Journal
A financial journal contains a summarized overview of financial data grouped by financial group over a specific period.
Let’s say we want to request a full financial journal for the month of January 2015. The following example code will do this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
<?php require_once('Mplusqapiclient.php'); $mplusqapiclient = new Mplusqapiclient(); // Initialize the client with your details. $from = strtotime('2015-1-1'); // Make sure to use Unix timestamps for these values $through = strtotime('2015-1-31'); // Make sure to use Unix timestamps for these values // Then we call the getFinancialJournal() function wrapped in a try/catch block to intercept any exceptions. try { if (false !== ($financial_journal = $mplusqapiclient->getFinancialJournal($from, $through))) { // Success exit('Retrieved financial journal.'); } else { exit('Invalid result after running getFinancialJournal.'); } } catch (MplusQAPIException $e) { exit($e->getMessage()); } |
If successful, the variable $financial_journal which we set in the example can have the following contents:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
array(1) { ["financialGroups"]=> array(2) { [0]=> array(13) { ["financialGroupType"]=> string(29) "FINANCIAL-GROUP-TYPE-TURNOVER" ["financialGroupSource"]=> string(30) "FINANCIAL-GROUP-SOURCE-INVOICE" ["financialGroupNumber"]=> int(1) ["financialGroupName"]=> string(9) "OMZETGROEP 1" ["accountNumber"]=> int(8001) ["branchNumber"]=> int(1) ["fromFinancialDate"]=> array(3) { ["day"]=> int(1) ["mon"]=> int(1) ["year"]=> int(2015) } ["throughFinancialDate"]=> array(3) { ["day"]=> int(31) ["mon"]=> int(1) ["year"]=> int(2015) } ["quantity"]=> int(5) ["decimalPlaces"]=> int(0) ["inclAmount"]=> int(15125) // prices are always in cents ["exclAmount"]=> int(12500) // prices are always in cents ["vatGroupList"]=> array(1) { [0]=> array(5) { ["vatCode"]=> int(2) ["vatPercentage"]=> int(2100) ["exclAmount"]=> int(12500) // prices are always in cents ["vatAmount"]=> int(2625) // prices are always in cents ["accountNumber"]=> int(2) } } } [1]=> array(13) { ["financialGroupType"]=> string(32) "FINANCIAL-GROUP-TYPE-CASH-INFLOW" ["financialGroupSource"]=> string(30) "FINANCIAL-GROUP-SOURCE-RECEIPT" ["financialGroupNumber"]=> int(19) ["financialGroupName"]=> string(4) "Fooi" ["accountNumber"]=> int(8019) ["branchNumber"]=> int(1) ["fromFinancialDate"]=> array(3) { ["day"]=> int(1) ["mon"]=> int(1) ["year"]=> int(2015) } ["throughFinancialDate"]=> array(3) { ["day"]=> int(31) ["mon"]=> int(1) ["year"]=> int(2015) } ["quantity"]=> int(81) ["decimalPlaces"]=> int(0) ["inclAmount"]=> int(16200) // prices are always in cents ["exclAmount"]=> int(15285) // prices are always in cents ["vatGroupList"]=> array(1) { [0]=> array(5) { ["vatCode"]=> int(1) ["vatPercentage"]=> int(600) ["exclAmount"]=> int(15285) // prices are always in cents ["vatAmount"]=> int(915) // prices are always in cents ["accountNumber"]=> int(1) } } } } } |
financialGroupType can have the following values:
- FINANCIAL-GROUP-TYPE-TURNOVER
Dutch: omzetgroepen - FINANCIAL-GROUP-TYPE-PAYMENT
Dutch: uitbetalingen - FINANCIAL-GROUP-TYPE-SUSPENSE-ACCOUNT
Dutch: tussenrekeningen - FINANCIAL-GROUP-TYPE-CASH-INFLOW
Dutch: kassa ingave - FINANCIAL-GROUP-TYPE-CASH-OUTFLOW
Dutch: kassa uitgave - FINANCIAL-GROUP-TYPE-BPE
Dutch: breuk/promotie/eigen gebruik
financialGroupSource can have the following values:
- FINANCIAL-GROUP-SOURCE-INVOICE
Dutch: verkoopfacturen - FINANCIAL-GROUP-SOURCE-RECEIPT
Dutch: kassabonnen - FINANCIAL-GROUP-SOURCE-ORDER
Dutch: verkooporders
!! Note !!
getFinancialJournal only returns turnovergroups and it’s data.
Payment methods and associated data can be retrieved with the getJournals call.
getJournals
Retrieves the financial journals including assigned ledger numbers for the payment methods.
JournalFilter can have the following values:
- JOURNAL-FILTER-RECEIPT
Dutch: kassabonnen - JOURNAL-FILTER-INVOICE
Dutch: facturen - JOURNAL-FILTER-ORDER
Dutch: verkooporders
Cash Count List
Let’s say we want to retrieve all cash counts made in the month of February, 2015.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
<?php require_once('Mplusqapiclient.php'); $mplusqapiclient = new Mplusqapiclient(); // Initialize the client with your details. $from = strtotime('2015-2-1'); // Make sure to use Unix timestamps for these values $through = strtotime('2015-2-28'); // Make sure to use Unix timestamps for these values // Then we call the getCashCountList() function wrapped in a try/catch block to intercept any exceptions. try { if (false !== ($cash_counts = $mplusqapiclient->getCashCountList($from, $through))) { // Success exit(sprintf('Retrieved %d cash counts.', count($cash_counts))); } else { exit('Invalid result after running getCashCountList.'); } } catch (MplusQAPIException $e) { exit($e->getMessage()); } |
If successful, the variable $cash_counts which we set in the example can have the following contents:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
array(1) { [0]=> array(12) { ["cashCountId"]=> string(32) "EC27A8A2958C4D5FBFE6E1351F0795BE" ["financialDate"]=> array(3) { ["day"]=> int(7) ["mon"]=> int(2) ["year"]=> int(2015) } ["entryTimestamp"]=> array(8) { ["sec"]=> int(35) ["min"]=> int(55) ["hour"]=> int(8) ["day"]=> int(7) ["mon"]=> int(2) ["year"]=> int(2015) ["isdst"]=> bool(false) ["timezone"]=> int(0) } ["branchNumber"]=> int(1) ["workplaceNumber"]=> int(1) ["cashCountNumber"]=> array(2) { ["year"]=> int(2015) ["number"]=> int(2) } ["versionNumber"]=> int(1) ["employeeNumber"]=> int(700) ["countingEmployeeNumber"]=> int(700) ["shiftFirstTransaction"]=> array(7) { ["transactionId"]=> string(32) "BB2008C5E10B4D7F85978AF487133DDC" ["financialDate"]=> array(3) { ["day"]=> int(13) ["mon"]=> int(1) ["year"]=> int(2015) } ["branchNumber"]=> int(1) ["workplaceNumber"]=> int(1) ["transactionNumber"]=> array(2) { ["year"]=> int(2015) ["number"]=> int(996) } ["employeeNumber"]=> int(999999) ["entryTimestamp"]=> array(8) { ["sec"]=> int(8) ["min"]=> int(28) ["hour"]=> int(13) ["day"]=> int(13) ["mon"]=> int(1) ["year"]=> int(2015) ["isdst"]=> bool(false) ["timezone"]=> int(0) } } ["shiftLastTransaction"]=> array(8) { ["transactionId"]=> string(32) "169D494D1B1249E8A50A79333210C6CD" ["financialDate"]=> array(3) { ["day"]=> int(7) ["mon"]=> int(2) ["year"]=> int(2015) } ["branchNumber"]=> int(1) ["workplaceNumber"]=> int(1) ["transactionNumber"]=> array(2) { ["year"]=> int(2015) ["number"]=> int(2046) } ["employeeNumber"]=> int(700) ["entryTimestamp"]=> array(8) { ["sec"]=> int(28) ["min"]=> int(47) ["hour"]=> int(8) ["day"]=> int(7) ["mon"]=> int(2) ["year"]=> int(2015) ["isdst"]=> bool(false) ["timezone"]=> int(0) } ["relationNumber"]=> int(10) } ["cashCountLineList"]=> array(3) { [0]=> array(7) { ["paymentMethod"]=> string(7) "CONTANT" ["startAmount"]=> int(184) // prices are always in cents ["addedAmount"]=> int(152) // prices are always in cents ["countedAmount"]=> int(336) // prices are always in cents ["depositedAmount"]=> int(0) // prices are always in cents ["differenceAmount"]=> int(0) // prices are always in cents ["endAmount"]=> int(336) // prices are always in cents } [1]=> array(8) { ["paymentMethod"]=> string(9) "CADEAUBON" ["startAmount"]=> int(2632) // prices are always in cents ["addedAmount"]=> int(1263) // prices are always in cents ["countedAmount"]=> int(3895) // prices are always in cents ["depositedAmount"]=> int(3895) // prices are always in cents ["differenceAmount"]=> int(0) // prices are always in cents ["endAmount"]=> int(0) // prices are always in cents ["depositPaymentMethod"]=> string(9) "K_AFSTORT" } [2]=> array(8) { ["paymentMethod"]=> string(3) "EFT" ["startAmount"]=> int(0) // prices are always in cents ["addedAmount"]=> int(22805) // prices are always in cents ["countedAmount"]=> int(22805) // prices are always in cents ["depositedAmount"]=> int(22805) // prices are always in cents ["differenceAmount"]=> int(0) // prices are always in cents ["endAmount"]=> int(0) // prices are always in cents ["depositPaymentMethod"]=> string(11) "AFSTORT_EFT" } } } } |
startAmount is the amount of money we started out with at the beginning of this period.
addedAmount is the amount of money that was added throughout the period.
countedAmount is the amount of money that was counted at the end of this period.
depositedAmount is the amount of money that was deposited to a different account.
differenceAmount is the difference between
countedAmount and what should have been the final amount according to the recorded transactions (
startAmount +
addedAmount).
Financial Journal by Cash Count
This function can be used to request a financial journal based on the time period of an existing cash count.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<?php require_once('Mplusqapiclient.php'); $mplusqapiclient = new Mplusqapiclient(); // Initialize the client with your details. $cash_count_id = 'C982304CC1AD11E48DFCAA07A5B093DB'; // Get an cash count UUID from getCashCountList() // Then we call the getFinancialJournalByCashCount() function wrapped in a try/catch block to intercept any exceptions. try { if (false !== ($financial_journal = $mplusqapiclient->getFinancialJournalByCashCount($cash_count_id))) { // Success exit('Retrieved financial journal.'); } else { exit('Invalid result after running getFinancialJournalByCashCount.'); } } catch (MplusQAPIException $e) { exit($e->getMessage()); } |
Processing this financial journal is identical to processing a financial journal that came in through getFinancialJournal.