Debitor credit balance
The debitor credit balance is the amount of money that is available on the debitor account. The credit balance can be used to pay invoices. The balance is the result of refunds and overpayments or topups.
Credit balance object
The credit balance object is a simple object with the following properties:
- amount: The amount of money that is available on the debitor account in cents
- currencyCode: The currency of the amount
- precision: The precision of the amount, which is the number of digits after the decimal point
Example:
{
"amount": 1000,
"currencyCode": "EUR",
"precision": 2
}
Result: 10,00 €
Get debitor credit balance
The debitor credit balance can be retrieved by using the API:
<?php
use Fynn\Sdk\V1\Debitor\DebitorCreditBalanceService;
$debitorCreditBalanceService = new DebitorCreditBalanceService($client);
$creditBalance = $debitorCreditBalanceService->getCreditBalance($debitorId);
The getCreditBalance
method returns a CreditBalanceResponse
object.
Book debitor credit balance
In some cases it is necessary to book the credit balance of a debitor. This can be done by using the API:
<?php
use Fynn\Sdk\V1\Debitor\DebitorCreditBalanceService;
$debitorCreditBalanceService = new DebitorCreditBalanceService($client);
$debitorCreditBalanceService->bookCreditBalance($debitorId, $amount, $description);
The amount will be available immediately on the debitor account.