Myself and two other people that are trying to communicate with Sage Accounting using sData, but perhaps someone has used sData.
I'm trying to post sData to our Sage server and create a deposit transaction that will show up in the bank reconciliation. I've tried tons of different variations, but this is what the sData looks like that I am currently posting to the server.
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005"
xmlns="http://www.w3.org/2005/Atom"
xmlns:sdata="http://schemas.sage.com/sdata/2008/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
xmlns:sync="http://schemas.sage.com/sdata/sync/2008/1"
xmlns:sme="http://schemas.sage.com/sdata/sme/2007"
xmlns:http="http://schemas.sage.com/sdata/http/2008/1">
<sdata:payload>
<GL_TransactionJournalHeader sdata:uri="/sdata/MasApp/MasContract/TS2/GL_TransactionJournalHeaderSPECIAL()" xmlns="">
<PostingDate>2018-02-16</PostingDate>
<SourceJournal>BR</SourceJournal>
<AcceptOutOfBalance>N</AcceptOutOfBalance>
<TransactionType>D</TransactionType>
<JournalDeleted>N</JournalDeleted>
<JournalComment>If this works it will be a miracle!</JournalComment>
<JournalType>F</JournalType>
<Offset>C</Offset>
<OffsetAccountKey>000000034</OffsetAccountKey>
<JournalTotal>5.0000</JournalTotal>
<GL_TransactionJournalDetail>
<PostingComment>Test line comment</PostingComment>
<DebitAmount>5.00</DebitAmount>
<CreditAmount>0.00</CreditAmount>
<TransactionType>D</TransactionType>
<AccountKey>000000005</AccountKey>
</GL_TransactionJournalDetail>
</GL_TransactionJournalHeader>
</sdata:payload>
</entry>
I've tried posting more than this and less than this. I've tried adding it in line by line and I always get an error when I add the AccountKey using a valid Sage Account Key. If I use an invalid Account Key the error message says that the account is invalid, this is what the server returns when the account key is valid.
<?xml version="1.0" encoding="utf-8"?>
<sdata:diagnoses xmlns="http://schemas.sage.com/sdata/2008/1" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sdata="http://schemas.sage.com/sdata/2008/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:sync="http://schemas.sage.com/sdata/sync/2008/1" xmlns:sme="http://schemas.sage.com/sdata/sme/2007" xmlns:http="http://schemas.sage.com/sdata/http/2008/1">
<sdata:diagnosis>
<sdata:severity>error</sdata:severity>
<sdata:sdataCode>ApplicationDiagnosis</sdata:sdataCode>
<sdata:applicationCode />
<sdata:message> is not on file.Š</sdata:message>
<sdata:stackTrace />
<sdata:payloadPath />
</sdata:diagnosis>
</sdata:diagnoses>
I've seen posts on other forums but the answer was "no one uses sData". While this is likely true, it doesn't really solve my problem. I'm stuck with sData for the time being. Has anyone seen this sort of error before and have any suggestions on how to fix it?
So the error I was getting wasn't complaining about the AccountKey not on file it was complaining about the Bank Code not being included. I added the BankCode and then the DepositNo and the transaction posted successfully.