CreateGeneralJournal - accountsIQ/API-Wiki GitHub Wiki

CreateGeneralJournal and post it to the transaction table.

Warning: You may see the properties Debit and Credit for a GeneralJournalLine. Please do not use these as they are no longer in use.

Parameter List

Parameter Type Description
token String The session token retrieved during authentication.
journal GeneralJournal The general journal to post into the entity.

The overall value of the transaction must be 0. This means that it requires at least two lines balancing each other out.

In each line, either a signed amount should be entered (Line1 = +100, Line2=-100) or a positive Credit/Debit should be entered (Line1 Credit = 100, Line2 Debit = 100).

Example

C#

Integration ws = new Integration();

String auth = ws.Login(entityID, partnerKey, userKey);
if( auth != null )
{
      GeneralJournal journal = new GeneralJournal
      {
          ExternalReference = "TEST",
          InternalReference = "T000012",
          TransactionDate = DateTime.Now.AddDays( 2.0 )
      };

      journal.Lines = new GeneralJournalLine[] 
      { 
          new GeneralJournalLine { GLAccountCode = "1000", Amount = 100.0M, Description = "Description" },
          new GeneralJournalLine { GLAccountCode = "2000", Amount = -100.0M, Description = "Description" }
      };

      status = ws.CreateGeneralJournal( auth, journal );
      Assert.AreEqual( OperationStatus.Success, status.Status );
}

Visual Basic

Dim ws As New Integration_1_1

Dim auth As String = ws.Login(entityID, partnerKey, userKey)
If (Not Me.auth Is Nothing) Then
  Dim journal As New GeneralJournal
  journal.ExternalReference = "TEST"
  journal.InternalReference = "T000012"
  journal.TransactionDate = DateTime.Now.AddDays(2)
  Dim lines As GeneralJournalLine() = New GeneralJournalLine(0) {}
  Dim journal As GeneralJournal = journal

  lines = New GeneralJournalLine(2) {}
  line = New GeneralJournalLine
  line.GLAccountCode = "1000"
  line.Amount = 100.0
  line.Description = "Description"
  lines(0) = line

  line =  New GeneralJournalLine
  line.GLAccountCode = "2000"
  line.Amount = -100.0
  line.Description = "Description"
  lines(1) = line
  journal.Lines = lines
  status = Me.ws.CreateGeneralJournal(Me.auth, journal)
  Assert.AreEqual(Of OperationStatus)(OperationStatus.Success, status.Status)

End If

See Also

⚠️ **GitHub.com Fallback** ⚠️