Right now, I can only send one line per request.
Is it possible to post both debit and credit lines for the same journal entry in a single API call, or do I need to use multiple requests
When creating a journal entry, you need to include:
Account Type and Account No.
Balance Account Type and Balance Account No.
With these fields provided, you can pass a single journal entry. The system will automatically create the balancing entries:
A Debit entry for the Account Type
A Credit entry for the Balance Account Type
This way, you don’t need to pass two separate lines for debit and Credit.
API Approach::
API calls can be made line by line to insert data (document wise considering accoutn & bal. account type in same line ) into the General Journal Line table in Business Central . The actual posting of a document or batch is handled within Business Central
If you are working with a document-based approach, you can send the Document Number as a parameter from your API. Business Central will group all lines with the same Document Number and post them together in one go.
If you are working with a unique batch, you can insert all the lines first and then post the batch at the end with a single POST command in codeunit 12.
IF you find this answer helpful , please verify the answer .
Regards
Pallavi Phade
Sohail Ahmed
2,669
Super User 2025 Season 2
Sumit Singh
2,668
Jeffrey Bulanadi
2,203