0

I am having a look at the xero developer documentation for manual journal lines: https://developer.xero.com/documentation/api/manual-journals#LineItemsPOST. Forgive me for the simple question, but I have a question regarding the adding in 'journalLines' looking at the "Example of a new draft manual journal with optional elements" JSON sample on the xero developer website. Do the journal lines LineAmounts (credit and debit) have to add up to zero, such as in the case of the sample on the website, or is it acceptable to just add journalLines in as needed? The reason behind this is that a large list of 'journal lines' would need to be sent over. Below is a random example of what could be sent to the API. Thanks

{
  "Date": "2014-08-13",
  "Status": "DRAFT",
  "Narration": "This is some random text",
  "LineAmountTypes": "NoTax",
  "JournalLines": {
    "JournalLine": [
      {
        "Description": "Prepaid Annual Phone",
        "LineAmount": -1000.00,
        "AccountCode": "489",
        "TaxType": "NONE"        
        }
      },
      {
        "Description": "Prepayment",
        "LineAmount": 132.00,
        "AccountCode": "620",
        "TaxType": "NONE"        
        },
       {
        "Description": "Prepayment",
        "LineAmount": 31.00,
        "AccountCode": "620",
        "TaxType": "NONE"        
        },
       {
        "Description": "Prepayment",
        "LineAmount": 97.00,
        "AccountCode": "620",
        "TaxType": "NONE"        
        }
      }
    ]
  },
  "ShowOnCashBasisReports": "false"
}
Gene Smith
  • 169
  • 12
  • 1
    I would imagine from an accounting point of view, the journal should balance. You could try it in the API previewer and see it accepts an unbalanced one and, if not, what the error message tells you. – droopsnoot Jul 30 '20 at 18:36
  • I ended up finding Xero's API previewer, and yes it does need to balance or an error is returned. – Gene Smith Jul 31 '20 at 13:43
  • That does seem reasonable, I can't imagine any accounting system allowing you to unbalance it. You could probably write your comment as the answer below, in case anyone else is searching. – droopsnoot Jul 31 '20 at 14:00

1 Answers1

1

I ended up finding Xero's API previewer, and yes it does need to balance or an error is returned.

Gene Smith
  • 169
  • 12