Hi all,
This question has been asked before but I can't find the solution from those for my situation.
I'm connecting to the API using PHP and I have a situation where I need to get the payment information for a specific
date range with the linked documents (i.e. invoice numbers) as well as payments which have not been fully allocated yet.
I've tried the customerPayment and customerPaymentJournal API calls, but get no results, or just the:
[
{
"id": "00000000-0000-0000-0000-000000000000",
"code": "GENERAL",
"displayName": "GENERAL",
"lastModifiedDateTime": "2026-02-04T03:26:36.887Z",
"balancingAccountId": "00000000-0000-0000-0000-00000000",
"balancingAccountNumber": "2910",
"customerPayments": []
}
The screenshots is from my demo company, how would I get the payment information for G04002 and that it's applied to invoice 103299 using the API?
Example of the code which I use to generate the URL, I'll add the filter on dates once I can actually get some payment info out:
$baseUrl = "https://api.businesscentral.dynamics.com/v2.0/" . $arrInfo['tenant_id'] . "/" . ENVIRONMENT . "/api/v2.0";
$endpoint = "/companies(" . rawurlencode($arrInfo['organisation_id']) . ")/customerPaymentJournals";
$expand = "\$expand=customerPayments";
$fullUrl = $baseUrl . $endpoint ."?" . $expand;
Any help would be great.
Thank you in advance :)