Attempting to create a GL Journal via REST and the Erp.BO.GLJournalEntrySvc/GLJournalEntries

I think I have most of the fields correct but I’m seeing a “REST API Exception” with a “Group references invalid” error message as a response. Looks like part of GLJrnHEad but apart from GroupID I can’t see anything that looks like a Group reference

I’ve stripped out everything that I think is superfluous to minimum requirements but then I can’t find anything that lists required fields (the API documentation is vague on what fields do)

And yes I am aware that this journal is unbalanced. I’m simply trying to a journal loaded via REST as a proof of concept.

{'AllowChgAfterPrint': False,
 'AllowUnbalancedEntries': True,
 'BookID': 'MAIN',
 'CommentText': 'CommentText - A string',
 'Company': 'xxxxx',
 'CurrencyCode': 'AUD',
 'Description': 'The General Journal Description',
 'DispTotCredit': 1100.0,
 'DispTotDebit': 1100.0,
 'EnteredBy': 'xxxx-SBenson',
 'FiscalPeriod': 9,
 'FiscalYear': 2023,
 'GLJrnDtlMnls': [{'BookID': 'MAIN',
                   'CommentText': 'Another Comment Line',
                   'Company': 'xxxx',
                   'CreditAmount': 0,
                   'DebitAmount': 0,
                   'Description': 'Journal Line 1',
                   'FiscalPeriod': 9,
                   'FiscalYear': 2023,
                   'GLAccount': '52020|1001',
                   'JEDate': '2023-03-23T11:48:26.592442+10:00',
                   'PostedBy': 'xxxx-SBenson',
                   'TransAmt': 1000}],
 'GroupID': 'GJ2303SB',
 'JEDate': '2023-03-23T11:48:26.592442+10:00',
 'JournalCode': 'MJ',
 'TotCredit': 1100.0,
 'TotDebit': 1100.0}]

While I am would like a solution for this what I also want to learn is how to go about fixing this myself.


Did you create the group first? I’d have to look at the sequence when doing a journal entry, but that might be a good place to start.

Thank you - that did trick.