PHP code example of mijnkantoor / nmbrs

1. Go to this page and download the library: Download mijnkantoor/nmbrs 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/ */

    

mijnkantoor / nmbrs example snippets


use Mijnkantoor\NMBRS\NmbrsClient;
mbrsClient("your-email-here", "your-token-here", "your-domai-here");

$highestDebNumber = $highestDebNumber = $client->getHighestDebtorNumber();
$debtor = $client->createDebtor('Some debtor', $highestDebNumber + 1));

$highestDebNumber = $client->getHighestDebtorNumber();
$client->createDebtor('Some client', $highestDebNumber + 1);

$highestCompanyNumber = $client->getHighestCompanyNumber();
$company = $client->createCompanyForDeptor($debtor->Id, [
    'Number' => $highestCompanyNumber,
    'CompanyName' => 'Some Company',
    'PeriodType' => NmbrsClient::DeclarationPeriodMonth,
    'DefaultCompanyId' => -1,
    'LabourAgreementSettingsGroupGuid' => '00000000-0000-0000-0000-000000000000',
    'PayInAdvance' => false
]);

$address = $client->createAddressForCompany($company->Id, [
    'Default' => true,
    'Street' => 'Some Street',
    'HouseNumber' => '123',
    'HouseNumberAddition' => 'A',
    'PostalCode' => '1234 AB',
    'City' => 'Some City',
    'StateProvince' => 'Some Province',
    'CountryISOCode' => 'nl',
]);

$bankAccount = $client->createBankAccountForCompany($company->id, [
    'Description' => 'Test rekening',
    'IBAN' => 'GB33BUKB20201555555555',
    'BIC' => 'ABNANL2A',
    'City' => 'TestDorp',
    'Name' => 'Henk',
    'Type' => 'Standaard',
]);

$client->updateDebtor($debtor->id, ['Name' => 'Other Debtor']);

// oops, doesn't exist at nmbrs API

$currentAddress = $client->getCurrentAddressByCompanyId($company->id));

$client->updateAddressForCompany($company->id, $currentAddress->id, [
    'Default' => true,
    'Street' => 'Other Street',
    'HouseNumber' => '123',
    'HouseNumberAddition' => 'A',
    'PostalCode' => '1234 AB',
    'City' => 'Other City',
    'StateProvince' => 'Other Province',
    'CountryISOCode' => 'nl',
]);

$currentBankAccount = $client->getDefaultBankAccountForCompany($company->id);

$client->updateBankAccountForCompany($company->id, $currentBankAccount->id, [
    'Description' => 'Test rekeninger',
    'IBAN' => 'NL70RABO4636681924',
    'Type' => 'Standaard',
]);