Method Community

 

Inserting Items through the API

Last post 04-19-2012 5:07 AM by warren_nickus. 13 replies.
Page 1 of 1 (14 items)
Sort Posts: Previous Next
  • 04-15-2012 8:30 AM

    Inserting Items through the API

    When I insert an item through the API the "PurchaseCost" field sometimes does not match the actual value which was sent.

    For instance, if the PurchaseCost field is "1442.20", the cost which is then shown in QuickBooks is "1,244.19995"

    Any idea why this is happening? I'm 100% sure our value is "1442.20" as its coming from a Database and we can actually see the data before sumbitting it to the API.

    Thanks,

    Nick

  • 04-16-2012 8:33 AM In reply to

    Re: Inserting Items through the API

     Hi warren_nickus,

    Can you tell me what function you are using to insert into the API? Also can you tell me whether you are using the current version of the api (https://www.methodintegration.com/MethodAPI/Service.asmx) or the one that will be released May 1 (https://www.methodintegration.com/MethodAPItest/Service.asmx)

     

  • 04-16-2012 8:56 AM In reply to

    Re: Inserting Items through the API

    David,

    I'm using MethodAPIInsert and MethodAPIUpdate, on the old service.

  • 04-16-2012 9:23 AM In reply to

    Re: Inserting Items through the API

     Hi warren_nickus,

    Are you using values generated in excel like the date issue from last week? If the value has been formatted to display in excel, it does not change the underlying root value.

     

    Dave

  • 04-16-2012 9:36 AM In reply to

    Re: Inserting Items through the API

    No David, the data is populated from a SQL database. The value inside the database is "1,442.20" and the data type is a Float.

    When debugging we can actually see that the value is correct.

    Nick

  • 04-16-2012 10:40 AM In reply to

    Re: Inserting Items through the API

     Warren_nickus

    Can you please trying inserting it using the new version of the api and let me know if that solves the problem

     https://www.methodintegration.com/MethodAPItest/Service.asmx

    Dave

  • 04-16-2012 1:56 PM In reply to

    Re: Inserting Items through the API

    Dave,

    Its not working. I'm getting the same result. The same thing is happening in an Estimate Object. If I insert an EstimateLine with a rate of "442.20", QuickBooks shows it as "442.199999". Any ideas?

    Nick

     

     

  • 04-16-2012 1:59 PM In reply to

    Re: Inserting Items through the API

    Dave,

    I'm checking Method CRM - it does show the correct amount of $442.20 - The problem is in the intergration between Method and Quickbooks.

    Nick

  • 04-17-2012 2:57 AM In reply to

    Re: Inserting Items through the API

    Guys are you checking it out or I'm all alone here? :)

  • 04-17-2012 7:40 AM In reply to

    Re: Inserting Items through the API

     warren_nickus,

    I am currently working on trying to reproduce the problem you have outlined.

    Dave

  • 04-17-2012 11:14 AM In reply to

    Re: Inserting Items through the API

    Please keep me posted - We cannot insert items before we rectify this problem.

    Nick

  • 04-18-2012 12:59 PM In reply to

    Re: Inserting Items through the API

    Dave,

    Were you able to come up with anything? This is really frustrating. Is the problem with the API on your end?

    Nick

     

  • 04-18-2012 3:01 PM In reply to

    Re: Inserting Items through the API

     Warren_nickus,

    I am unable to reproduce this problem. I have tested MethodAPIInsert,MethodAPIInsertV2,MethodAPIUpdate, MethodAPIUpdateV2 on both the original and forthcoming version of the API.

    Below is an example of the code I used to test MethodAPIInsert (I have blanked out the company account, user name and password, with XXXX, YYYY, and ZZZZ respectively) 


    string[ arrInsertFields = new string[ { "EstimateRecordID", "Item", "Quantity", "Rate" };

    string[ arrInsertValue = new string[ { "12", "AR BID", "1", "442.20" }; 

    string RecordID = "";

    lblMethodAPIInsert.Text = MethodAPI.MethodAPIInsert(XXXX, YYYY, ZZZZ, "EstimateLine", arrInsertFields, arrInsertValue, ref RecordID);


     

    Below is an example of the code I used to test MethodAPIInsertV2 (I have blanked out the company account, user name and password, with XXXX, YYYY, and ZZZZ respectively)

    string[ arrInsertFields = new string[ { "EstimateRecordID", "Item", "Quantity", "Rate" };

    string[ arrInsertValue = new string[ { "12", "AR BID", "1", "442.20" }; 

    lblMethodAPIInsertV2.Text = MethodAPI.MethodAPIInsertV2(XXXX, YYYY, ZZZZ,"", "EstimateLine", arrInsertFields, arrInsertValue);

     

    Below is an example of the code I used to test MethodAPIUpdate (I have blanked out the company account, user name and password, with XXXX, YYYY, and ZZZZ respectively)


    string[ arrUpdateFields = new string[ { "Rate" };

    string[ arrUpdateValue = new string[ { "442.20" };

    lblMethodAPIUpdate.Text = _MethodAPI.MethodAPIUpdate(XXXX, YYYY, ZZZZ, "EstimateLine", arrUpdateFields, arrUpdateValue, "62");

     

    Below is an example of the code I used to test MethodAPIUpdateV2 (I have blanked out the company account, user name and password, with XXXX, YYYY, and ZZZZ respectively)


    string[ arrUpdateFields = new string[ { "Rate" };

    string[ arrUpdateValue = new string[ { "442.20" };

    lblMethodAPIUpdate.Text = MethodAPI.MethodAPIUpdateV2(XXXX, YYYY, ZZZZ, "", "EstimateLine", arrUpdateFields, arrUpdateValue, "63");

     

    This works fine 442.20 is being entered in method as 442.20. When the quickbooks sync happens the rate in quickbooks shows up as 442.20.

    You will notice I used hardwired string values.

    You mentioned in your post above you are using float values from a database. Have you confirmed that the value is not saved there as 442.199999? If it is stored there as 442.199999, and you want to use it in method as 442.20 have you rounded it to 2 decimal places first?

    Have you confirmed that the value being passed to the api function calls is not 442.199999?

    Dave

     

  • 04-19-2012 5:07 AM In reply to

    Re: Inserting Items through the API

    Answer

    This question is no longer API related. The problem is between Method and Quickbooks. When I create a new sales order and put an item with a price - $44.20, after syncing I get under "Rate" in Quickbooks $44.1999999

    I will post it in the general forum.

Page 1 of 1 (14 items)