How can I send some customer details to the custom fields through the RAH API?

  • 1
  • Question
  • Updated 11 months ago
  • Answered
Hi guys,

I'm trying to create a customer or update one in the Reckon Account Hosted though the API. I've created some custom fields for the customer through front end for the extra info. How can I send records to these fields? How can I define these fields in the QBXML body?

I really appreciate your help.
Photo of Mehrnoosh

Mehrnoosh

  • 606 Points 500 badge 2x thumb

Posted 11 months ago

  • 1
Photo of Ifti

Ifti, PSG Support Team Leader

  • 5,898 Points 5k badge 2x thumb
Hi Mehrnoosh,

Thank you for your post.

To do this you need to include a extended QBXML call to also include the additional elements required for custom fields. For a example please see below


<DataExtModRq>
<DataExtMod>
<OwnerID>0</OwnerID>
<DataExtName>CustomerNumber</DataExtName>
<ListDataExtType>Customer</ListDataExtType>
<ListObjRef>
<FullName>Test Customer.</FullName>
</ListObjRef>
<DataExtValue>1234</DataExtValue>
</DataExtMod>
</DataExtModRq>


In this instance the user is updating the Customer List for the Customer Test Customer and adding the number 1234 to the custom field CustomerNumber.



I hope the above helps.

Thanks

Ifti
Reckon API Team
Photo of Mehrnoosh

Mehrnoosh

  • 606 Points 500 badge 2x thumb
Thanks Ifti,

I tried it and it works for sending a value to one of the custom fields. 
{
"FileName":"Q:\\Mycompanyfile.QBW",
"Operation":"<?xml version=\"1.0\"?><?qbxml version=\"6.1\"?><QBXML><QBXMLMsgsRq onError=\"stopOnError\">
<DataExtAddRq>
<DataExtAdd> 
<OwnerID>0</OwnerID> 
<DataExtName>Member</DataExtName>
<ListDataExtType>Customer</ListDataExtType>
<ListObjRef> 
<ListID>80000069-1500524784</ListID>
</ListObjRef>
<DataExtValue>22335</DataExtValue> 
</DataExtAdd>
</DataExtAddRq>
</QBXMLMsgsRq>
</QBXML>",
"UserName":"username",
"Password":"password",
"CountryVersion":"2015.R2.AU"
}
I'm going to send more than one custom value to multiple custom fields belong to the customer in one payload. How can I send multiple? I tried this Qbxml:
{
"FileName":"Q:\\Mycompanyfile.QBW",
"Operation":"<?xml version=\"1.0\"?><?qbxml version=\"6.1\"?><QBXML><QBXMLMsgsRq onError=\"stopOnError\">
<DataExtAddRq>
<DataExtAdd> 
<OwnerID>0</OwnerID> 
<DataExtName>Member</DataExtName>
<ListDataExtType>Customer</ListDataExtType>
<ListObjRef> 
<ListID>80000069-1500524784</ListID>
</ListObjRef>
<DataExtValue>22335</DataExtValue> 
</DataExtAdd>
<DataExtAdd> 
<OwnerID>0</OwnerID> 
<DataExtName>Ticket</DataExtName>
<ListDataExtType>Customer</ListDataExtType>
<ListObjRef> 
<ListID>80000069-1500524784</ListID>
</ListObjRef>
<DataExtValue>12345</DataExtValue> 
</DataExtAdd>
</DataExtAddRq>
</QBXMLMsgsRq>
</QBXML>",
"UserName":"username",
"Password":"password",
"CountryVersion":"2015.R2.AU"
}
It returns code 400 bad request:
{
    "Message": "Error connecting to Reckon Accounts. Reckon Accounts found an error when parsing the provided XML text stream."
}

It seems to me my XML is not in right order or I missed something. Any idea?
Photo of Simon Hutchinson

Simon Hutchinson, Employee

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

You don't need to include the <OwnerID>0</OwnerID> multiple times :)

Thanks

Simon
Photo of Mehrnoosh

Mehrnoosh

  • 606 Points 500 badge 2x thumb
Hi Simon,
Thanks,

I took out the second <OwnerID>0</OwnerID> from the request body but I still receive the same error:
{
    "Message": "Error connecting to Reckon Accounts. Reckon Accounts found an error when parsing the provided XML text stream."
}