Invoices
Get invoices
To get invoices for your account, you can use the following API endpoint:
<?php
use Fynn\Sdk\V1\Invoice\InvoiceService;
$invoiceService = new InvoiceService($client);
$page = 1;
$limit = 25;
$invoices = $invoiceService->getInvoices($page, $limit);
The getInvoices
method returns an array of InvoiceResponse
objects.
Get invoice
To get a specific invoice, you can use the following API endpoint:
<?php
use Fynn\Sdk\V1\Invoice\InvoiceService;
$invoiceService = new InvoiceService($client);
$invoiceId = 'ad8d8d8d-8d8d-8d8d-8d8d-8d8d8d8d8d8d';
$invoice = $invoiceService->getInvoice($invoiceId);
The getInvoice
method returns an InvoiceResponse
object.
Get invoice pdf
To get a specific invoice as pdf, you can use the following API endpoint:
<?php
use Fynn\Sdk\V1\Invoice\InvoiceService;
$invoiceService = new InvoiceService($client);
$invoiceId = 'ad8d8d8d-8d8d-8d8d-8d8d-8d8d8d8d8d8d';
$invoice = $invoiceService->downloadInvoice($invoiceId);
The getInvoicePdf
method returns the invoice as pdf string.
Get debitor invoices
To get invoices for a specific debitor, you can use the following API endpoint:
<?php
use Fynn\Sdk\V1\Invoice\InvoiceService;
$invoiceService = new InvoiceService($client);
$debitorId = 'ad8d8d8d-8d8d-8d8d-8d8d-8d8d8d8d8d8d';
$page = 1;
$limit = 25;
$invoices = $invoiceService->getDebitorInvoices($debitorId, $page, $limit);
The getDebitorInvoices
method returns an array of InvoiceResponse
objects.