I am trying to figure out how to create a Journal Entry by using the API.
Is the sequence I am explaining correct?
1. I use the following to GET the company.
2. Then I use the company to GET the journal batch.
3. Then I use journal batch to GET the journal entry I want to add a new line to.
4. Then I POST to add a new journal line the following data as a json object.
Dim postdataje As New JObject
postdataje.Add(/lineNumber/, /3000/)
postdataje.Add(/accountType/, /G_x002F_L_x0020_Account/)
postdataje.Add(/accountNumber/, /12130/)
postdataje.Add(/postingDate/, /2024-05-28/)
postdataje.Add(/documentNumber/, /G00003/)
postdataje.Add(/externalDocumentNumber/, //)
postdataje.Add(/amount/, /500/)
postdataje.Add(/balanceAccountType/, /G_x002F_L_x0020_Account/)
The actual post request looks like:
httpWebRequest.ContentType = /application/json/
httpWebRequest.Method = /POST/
httpWebRequest.Headers.Add(/Authorization/, /Bearer / & token)
httpWebRequest.KeepAlive = True
httpWebRequest.Accept = /application/json/
I end up getting an error which I am trying to figure out:
(400) Bad Request.
Does all this look correct?
Thanks Keith