Dinero PHP Wrapper
, (*1)
Installation
Using Composer, (*2)
composer require partner-it/dinero-php
Usage
Create a new instance:, (*3)
<?php
$Dinero = new \PartnerIT\Dinero\Dinero([
'clientId' => 'clientId',
'clientSecret' => 'xxx',
'apiKey' => 'yyy'
]);
Request a new token:, (*4)
<?php
$Dinero->requestToken();
Get the Organizations, (*5)
<?php
$organizations = $Dinero->Organizations->getOrganizations();
$organizationId = $organizations[0]['id'];
Create a new ledger:, (*6)
<?php
$nextVoucherNumber = $Dinero->LedgerItems->getNextVoucherNumber($organizationId);
$data = [
[
"Amount" => -500,
"Description" => "produkt, lille",
"BalancingAccountVatCode" => null,
"AccountNumber" => 1000,
"BalancingAccountNumber" => null,
"VoucherDate" => "2015-05-27",
"VoucherNumber" => $nextVoucherNumber,
"AccountVatCode" => "I25"
]
];
$Dinero->LedgerItems->createLedgeritems($organizationId, $data);
Run a manual call:, (*7)
<?php
$result = $Dinero->call('/endpoint', 'GET', []);
Links
Official API documentation:, (*8)
https://api.dinero.dk/docs, (*9)