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

Mehrnoosh
Mehrnoosh Member Posts: 36 Reckoner Reckoner
edited October 11 in Accounts Hosted
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.

Comments

  • Ifti
    Ifti Reckon Staff Posts: 258 Reckon Staff
    edited February 2019
    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.

    image

    I hope the above helps.

    Thanks

    Ifti
    Reckon API Team
  • Mehrnoosh
    Mehrnoosh Member Posts: 36 Reckoner Reckoner
    edited July 2017
    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?"
  • Simon Hutchinson_8164484
    Simon Hutchinson_8164484 Reckon Alumni Posts: 135 Former Reckon Staff Member Former Reckon Staff
    edited July 2017
    Hi Mehrnoosh,

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

    Thanks

    Simon

  • Mehrnoosh
    Mehrnoosh Member Posts: 36 Reckoner Reckoner
    edited July 2017
    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."
    }
This discussion has been closed.