Creating the Posted Data for Importing Invoice on Reckon Accounts Hosted

  • 1
  • Question
  • Updated 1 year ago
  • Answered
Hi Guys, 

Good day.

I just want to ask on how can I be able to send invoices from my application to Reckon Accounts Hosted via API.

I was able to set up a test company provided from the SDK Development Tools and was able to initiate connection to it, now my problem is on how to send my invoice data to the RAH via API.

Do I need to create a QBXML file? Then send it via POST Method (Submit Request 2 as per AZURE PORTAL)? If yes, can you redirect me some link on how to create a QBXML file? I already have some articles here on how to create it, I just want to know if you can recommend some articles that is much informative than what I currently have here.

Hoping for your quick response.
Thanks for reading.
Photo of Jerwin Ollica Plaquia

Posted 1 year ago

  • 1
Photo of Mehrnoosh

Mehrnoosh

  • 606 Points 500 badge 2x thumb
Hi  Jerwin,

I'm new in this area but this link might help you in regard to creating QBXML.
https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html
you can find your request for example InvoiceAdd from  drop down list and use it in the body of request (Payload factory).
Hope it helps you.
Hi Mehrnoosh,

Thank you so much for the link. I am also new to this Integration so the link you shared really helps a lot.

Thanks again.


Hi Jason,

Noted that, thanks.
Hi Mehrnoosh,

Following the link you gave earlier, I was wondering on how I can have it attached to the JSON Request like what Jason did as per the above reply.

Because on how I can see it, it seems the QBXML request is included in the JSON array. Now my concern is, how can I add the QBXML request to the JSON? I am thinking that I will parse it to string, then insert it to the JSON Array? Not sure though if this is correct.

If parsing the QBXML to string is correct, may I know how to do it?

Hi Jason,

I also have a question, does the "Filename" field on the JSON request sample you gave, how do we make it dynamic? I mean, how do I get the company file that the user use to process the request to?

Hoping for quick response.
Thanks for reading guys.
Good day.
Photo of Jason Hollis

Jason Hollis, Head of Product

  • 9,002 Points 5k badge 2x thumb
We don't have a dynamic endpoint (yet) but we are investigating. Hosted uses AD so there are some complexities. The file path currently needs to be provided by the user. 

Some apps guide them through the set-up with a wizard with examples on how to find the file path, but ideally we want to automate it.

The best way (currently) is, logged in as ADMIN, go to File > Audit Company File which shows the correct credentials (remembering some files can be in the root drive (Q:) whilst others are shared).

Use our help docs to determine the correct path details required.



Also don't forget to escape the \\ in the JSON. 
(Edited)
Hi Jason, 

I see, okay that is understood. For now I will just hard code my QBW path for testing.

Thanks.
Photo of Jason Hollis

Jason Hollis, Head of Product

  • 9,002 Points 5k badge 2x thumb
I also updated this for shared folders on our Hosted API FAQ page. https://reckon.helpdocsonline.com/api-reckon-accounts-hosted-faq
Photo of Mehrnoosh

Mehrnoosh

  • 606 Points 500 badge 2x thumb
Hi Jerwin,

I'm not quite sure about your problem and I'm not confident enough in this area.
What I've tried for Reckon Account Hosted API, using Postman and also Azure API portal to test my message and it works well so far.
From where I'm standing this is a qbxml format embedded in the JSON. 
My message for adding a new customer is like this:

{

"FileName":"Q:\\mycompanyfilename.QBW",

"Operation":"<?xml version=\"1.0\"?><?qbxml version=\"6.1\"?><QBXML><QBXMLMsgsRq onError=\"stopOnError\">

<CustomerAddRq>

   <CustomerAdd>

      <Name>Mehrnoosh A</Name>

      <FirstName>Mehrnoosh</FirstName>

      <LastName>A</LastName>

      <BillAddress>

         <Addr1>Harbour Espalanade</Addr1>

         <City>Docklands</City>

         <State>Victoria</State>

         <PostalCode>3018</PostalCode>

         <Country>Australia</Country>

         <Note>testNote</Note>

      </BillAddress>

      <ShipAddress>

         <Addr1>Toorak Road</Addr1>

         <City>Toorak</City>

         <State>Victoria</State>

         <PostalCode>3142</PostalCode>

         <Country>Australia</Country>

         <Note>AnotherTest</Note>

      </ShipAddress>

      <Phone>1345676</Phone>

      <Email>Test@gmail.com</Email>

      <JobStatus>InProgress</JobStatus>

   </CustomerAdd>

</CustomerAddRq>

</QBXMLMsgsRq></QBXML>",

"UserName":"username",

"Password":"password",

"CountryVersion":"2015.R2.AU"

 }

I use the XML in the link that I've sent you to embed it into QBXMLMsgsRq.

I started to work with Reckon API for one of our clients yesterday and I am not confident about this API, Sorry, it may don't help you,
Photo of Mehrnoosh

Mehrnoosh

  • 606 Points 500 badge 2x thumb
That's great Jerwin.

I came across this XML parsing error as well. I don't know what is the problem for some fields. I used online XML reader to find out is it my problem but XML reader can parse my XML. but Reckon API cannot.
Photo of Mehrnoosh

Mehrnoosh

  • 606 Points 500 badge 2x thumb
Hi Jason,

Can I post a new job to the reckon through the API? In the link that I've already shared here, I found qbxml for adding job type but I couldn't find any XML for adding a New job?

Thanks in advance
Photo of Jason Hollis

Jason Hollis, Head of Product

  • 9,002 Points 5k badge 2x thumb
A job is simply a subset of a customer. Customer:Job, so really, it is still a customer. 
Photo of Mehrnoosh

Mehrnoosh

  • 606 Points 500 badge 2x thumb
Thank you for your prompt reply.
Photo of Jason Hollis

Jason Hollis, Head of Product

  • 9,002 Points 5k badge 2x thumb
Hi, 

I was able to finally send a sample data on creating a customer on the Reckon AZURE portal last Friday. Then this morning I proceed to sending an Invoice through API as per data below, on the Reckon Azure Portal as well.

{
"Filename": "Q:\\myCompany.QBW",
"Operation": "<?xml version=\"1.0\"?>
<?qbxml version=\"6.1\"?>
<QBXML>
<QBXMLMsgsRq onError=\"stopOnError\">
<InvoiceAddRq>
<InvoiceAdd>
<CustomerRef>
<FullName>Jerwin Ollica Plaquia</FullName>
</CustomerRef>
<TxnDate>2017-05-22</TxnDate>
<RefNumber>PHP20799</RefNumber>
<BillAddress>
<Add1>323 Malugay St.</Add1>
<Add2>San Martin De Porres</Add2>
<City>Paranaque</City>
<State>Metro Manila</State>
<PostalCode>1700</PostalCode>
<Country>Philippines</Country>
</BillAddress>
<PONumber>11250</PONumber>
<DueDate>2017-05-25</DueDate>
<InvoiceLineAdd>
<Desc>JE-003 - Jerwin Desc Style Test - Chrome</Desc>
<Quantity>5</Quantity>
<Rate>100.0000</Rate>
<Amount>500.0000</Amount>
</InvoiceLineAdd>
<InvoiceLineAdd>
<Desc>JE-003 - Jerwin Desc Style Test - Gold</Desc>
<Quantity>4</Quantity>
<Rate>100.0000</Rate>
<Amount>400.0000</Amount>
</InvoiceLineAdd>
</InvoiceAdd>
</InvoiceAddRq>
</QBXMLMsgsRq>
</QBXML>",
"Username": "TestApp",
"Password": "1234",
"CountryVersion": "2015.R2.AU"
}

However upon sending I encountered this error again.



Can you please enlighten me on what is wrong on the QBXML that I am sending? As I have followed the format as per Mehrnoosh link above, though I haven't added all fields as per that link since most of them are optional.

Also, I am just wondering if its possible that you can make the response error a bit more detailed? ie if I am missing a required column or have added a column that is not accepted on the QBXML version 6.1? Instead of getting the same error and then doing a trial and error on removing or adding a column? Not sure about this though.

Hoping for your quick response.
Thanks for reading.
Good day.
Photo of Jason Hollis

Jason Hollis, Head of Product

  • 8,978 Points 5k badge 2x thumb
Can you post the full code you sent here please? (change anything sensitive)
Hi Jason,

Here it is. Hasn't done any changes.

It's almost the same as the one I post here yesterday, I just added the "<ItemRef>" tag as per Simons' instruction.

{
"FileName": "Q:\\I8TestRAH\\Cougar Enterprises.QBW",
"Operation": "<?xml version=\"1.0\"?>
<?qbxml version=\"6.1\"?>
<QBXML>
<QBXMLMsgsRq onError=\"stopOnError\">
<InvoiceAddRq>
<InvoiceAdd>
<CustomerRef>
<FullName>Jerwin Ollica Plaquia</FullName>
</CustomerRef>
<TxnDate>2017-05-22</TxnDate>
<RefNumber>PHP20799</RefNumber>
<BillAddress>
<Add1>323 Malugay St.</Add1>
<Add2>San Martin De Porres</Add2>
<City>Paranaque</City>
<State>Metro Manila</State>
<PostalCode>1700</PostalCode>
<Country>Philippines</Country>
</BillAddress>
<PONumber>11250</PONumber>
<DueDate>2017-05-25</DueDate>
<InvoiceLineAdd>
<ItemRef>
<FullName>Test 01</FullName>
</ItemRef>
<Desc>JE-003 - Jerwin Desc Style Test - Chrome</Desc>
<Quantity>5</Quantity>
<Rate>100.0000</Rate>
<Amount>500.0000</Amount>
</InvoiceLineAdd>
<InvoiceLineAdd>
<ItemRef>
<FullName>Test 02</FullName>
</ItemRef>
<Desc>JE-003 - Jerwin Desc Style Test - Gold</Desc>
<Quantity>4</Quantity>
<Rate>100.0000</Rate>
<Amount>400.0000</Amount>
</InvoiceLineAdd>
</InvoiceAdd>
</InvoiceAddRq>
</QBXMLMsgsRq>
</QBXML>",
"Username": "TestApp",
"Password": "1234",
"CountryVersion": "2015.R2.AU"
}

Thanks,
Photo of Simon Hutchinson

Simon Hutchinson, Employee

  • 1,844 Points 1k badge 2x thumb
Hi Jerwin

Try this in the Operation element

<?xml version="\1.0\"?>
<?qbxml version=\"6.1\"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<InvoiceAddRq>
<InvoiceAdd>
<CustomerRef>
<FullName>Jerwin Ollica Plaquia</FullName>
</CustomerRef>
<TxnDate>2017-05-22</TxnDate>
<RefNumber>PHP20799</RefNumber>
<BillAddress>
<Addr1>323 Malugay St.</Addr1>
<Addr2>San Martin De Porres</Addr2>
<City>Paranaque</City>
<State>Metro Manila</State>
<PostalCode>1700</PostalCode>
<Country>Philippines</Country>
</BillAddress>
<PONumber>11250</PONumber>
<DueDate>2017-05-25</DueDate>
<InvoiceLineAdd>
<ItemRef>
<FullName>Test 01</FullName>
</ItemRef>
<Desc>JE-003 - Jerwin Desc Style Test - Chrome</Desc>
<Quantity>5</Quantity>
<Rate>100.00</Rate>
<Amount>500.00</Amount>
</InvoiceLineAdd>
<InvoiceLineAdd>
<ItemRef>
<FullName>Test 02</FullName>
</ItemRef>
<Desc>JE-003 - Jerwin Desc Style Test - Gold</Desc>
<Quantity>4</Quantity>
<Rate>100.00</Rate>
<Amount>400.00</Amount>
</InvoiceLineAdd>
</InvoiceAdd>
</InvoiceAddRq>
</QBXMLMsgsRq>
</QBXML>

Thanks

Simon H
Reckon API
HI Simon,

That seems to do it, although it still returns an error but the error is much clearer now.

I am just wondering as per the error, it says There is an invalid reference to Reckon Accounts Item "Test 01" in the Invoice line. Does this mean, that I need to create the Line Item First?

If yes, is it possible to add an invoice item without adding it to the List? like manually adding an item. 

Hoping for your quick response.
Thanks
Photo of Jason Hollis

Jason Hollis, Head of Product

  • 8,978 Points 5k badge 2x thumb
You should ensure the item exists Jerwin - yes. If not, create it first.

Items are linked to chart of accounts, so they need to exist first also. 

Before creating an invoice in the UI you generally need (as a minimum - and lets forget tax codes for this example):

  1. Chart of accounts
  2. Items
  3. Customers
Then optionals like TERMS etc...
Hi Guys,

Good day, Just to give you an update.

I was finally able to create an Invoice using the API. Thanks for all of your help.

Although I still have some concern, sorry for this.

1) How do we create a Credit Note?  Because as per the link Mehrnoosh gave, I can't seem to see a sample code on how to request a Credit Note.

2) How can I apply a payment to an Invoice using the API? Same reason as point 1.

3) I am trying to set up another company file, apparently when I tried sending the first request for Authorizing the API as per below. It works fine, I am getting a 200 response which is good.

{
"CountryVersion": "2015.R2.AU",
"FileName": "Q:\\DevTestRAH\\Cougar Enterprises.QBW",
"Operation": "<?xml version=\"1.0\"?><?qbxml version=\"6.1\"?><QBXML><QBXMLMsgsRq onError=\"continueOnError\"><CompanyQueryRq /></QBXMLMsgsRq></QBXML>",
"UserName": "Admin",
"Password": "admin"
}

However, upon proceeding to step four as per this link https://reckon.helpdocsonline.com/https-//reckon-helpdocsonline-com/api-reckon-accounts-hosted-autho... which should sent the new request with the new credentials set up on the Integrated Application preferences as per below. I am now getting a 400 Bad Request error.

{
"CountryVersion": "2015.R2.AU",
"FileName": "Q:\\DevTestRAH\\Cougar Enterprises.QBW",
"Operation": "<?xml version=\"1.0\"?><?qbxml version=\"6.1\"?><QBXML><QBXMLMsgsRq onError=\"continueOnError\"><CompanyQueryRq /></QBXMLMsgsRq></QBXML>",
"UserName": "GlassApp",
"Password": "1234"
}

Hope you can help me on this one.
Sorry I haven't created a new thread.

Thanks for reading.
Photo of Mehrnoosh

Mehrnoosh

  • 606 Points 500 badge 2x thumb
Hi Jason,

Could you please give me a favour? Where should I sign up to receive  "700+ page doc on the Intuit SDK "?

Thanks,
Photo of Jason Hollis

Jason Hollis, Head of Product

  • 9,002 Points 5k badge 2x thumb
You only need this Jerwin. \\\\MMCptyltd\\mycompany.QBW

You'll find more info on shared file on the online help site with a image of what the folder looks like in the hosted file browser. 
Photo of Jason Hollis

Jason Hollis, Head of Product

  • 9,002 Points 5k badge 2x thumb
Send us a request at Reckon API Mehrnosh. You should already have received the link when you signed up as a developer partner. Also include the email you would have signed up with.

Thanks,
Jason
(Edited)
Hi Mehrmoosh,

Thanks for the response.
Apparently, I already check it on the "File>Audit Company File" to check for the shared file path. And the path I am sending on the request is correct.

I even double check as of this writing. But I beg to insists the path I am sending on the request is correct.
Photo of Jason Hollis

Jason Hollis, Head of Product

  • 9,002 Points 5k badge 2x thumb
This will help you determine the correct prefix Jerwin. It's hard for us to tell without seeing your shared folders. 

ps. Can you start new threads for new topics? Will make it easier for developers to find what they need next time. Thx

Ref: https://reckon.helpdocsonline.com/api-reckon-accounts-hosted-overview