PHP code example of arkon-event / send-regning-api

1. Go to this page and download the library: Download arkon-event/send-regning-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

arkon-event / send-regning-api example snippets



use \ArkonEvent\SendRegningApi\ApiClient;
$client = new ApiClient('loginEmail', 'password', 'account-id');

//To execute a get request simply use get and add the path
$invoices = $client->get('/invoices/');

//or to get a single invoice
$invoice = $client->get('/invoices/14');

//use $queryParameters to send parameters
$params = ['from' => '2015-02-01','to' => '2015-06-01'];
$invoice = $client->get('/invoices/not-due',$params);

//use the callLink method to call links returned in the object
$client->callLink($invoice,ApiClient::LINK_SEND_AGAIN);

//To send a POST request without body
$client->post('/recipients/123456/available');

//To send a POST request with a body, data must be provided in format supported as input for json_encode 
$data = ['amount' => 0.25];
$client->post('/sales-ledger/123456/loss',$data);