Method Community

 

Creating a Sales Receipt from our website using API

Last post 01-30-2018 4:14 PM by Method_Peter. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 11-29-2017 1:05 PM

    Creating a Sales Receipt from our website using API

    Aloha,

    We have a website (NogginBuilders.com) that takes orders from a customer.  We then use an API to sync information from the website into Mehtod.   The Sales Receipts and their associated Sales Receipts Lines come over to Mehtod perfeclty.  The only problem is the Sales Receipts do not automatically sync to QB.  When we called support they told us to set the IsWaitingForSyncApproval to False.  Support had us go into the SalesReceipt and manually set the IsWaitingForSyncApproval to Yes and then back to No and this allows the Sales Receipt to sync.

    We do not write APi's so we have been working with a developer to handle that portion of our website.   They work with off shore developers.  Below is a thread of email that we had the last couple of days that we hope you will understand.  Any help you can provide us to pass on to the developer would be greatly appreciated.  This is the last piece of this project to be completed and is time sensative.

    Stuart Katz

    Noggin Builders

    808-214-0008


    Email thread that we hope will help clarify.  Please note they indicate they have set it both as a string and boolean and neither made a difference.

    From: Dmitry Nikolenko <dnikolenko@mooseworldwidedigital.com>
    Sent: Wednesday, November 29, 2017 10:44 AM
    Subject: Re: Need to understand
    To: Justin Reed <justin@mooseworldwidedigital.com>

    1) I can't set a type for the field in a request to the API

    I can use only 2 parameters, thay are:

    -- arrInsertFieldsArray – An array containing the names of fields you wish to insert. http://joxi.ru/ZrJJkjYT1zO3Nr

    -- arrInsertValueArray – An array containing the values of the fields you wish to insert. http://joxi.ru/KAgeBJofgbZnjm

    Method detects the type of a value automatically

    And I already tried to send the value both as a string and as a boolean. We discussed this on a call.

    At first it was as boolean, without the quotes http://joxi.ru/DmByZRLUNZONwr

    Then I changed a value to string, with the quotes http://joxi.ru/KAxxJMoC4Xe4QA

    Now the value sends as string


    From: Justin Reed
    Sent: Wednesday, November 29, 2017 4:34:51 PM
    To: Dmitry Nikolenko
    Subject: FW: Need to understand

    Dmitry - can you confirm you are sending the value of the field as a type= Boolean "False"?

    Justin Reed
    COO, Lead Project Manager

    www.mooseworldwidedigital.com
    Skype: justinfreed
    Cell:     773.610.4524

    -----Original Message-----
    From: Stuart [mailto:katz@kapalua-dream.com]
    Sent: Tuesday, November 28, 2017 2:24 PM
    To: Justin Reed <justin@mooseworldwidedigital.com>
    Cc: Mrs. Torf Amy <amytorf@comcast.net>
    Subject: Need to understand

    Hi Justin

    Sales Receipts still not automatically syncing to QB.  We would like to understand where we stand on this.  I sent you a previous email indicating that Method said the flag should be sent as  Boolean

    Stuart Katz
    Noggin Builders
    Let your children come explore the wonders!
  • 12-04-2017 11:47 AM In reply to

    Re: Creating a Sales Receipt from our website using API

    Hi Stuart,

    I believe the suggestion from Support is a bit of red herring in your case.  Setting and resetting IsWaitingForSyncApproval will not result in the SalesReceipt being "Pushed" (automatically synced) to Quickbooks.

    There is a call in the API that is meant to take care of this.  It is called - MethodAPIActionSendToDesktopV2 . In your case the process to Push SalesReceipt data to QuickBooks should be:

    1. Create the SalesReceipt via MethodAPIInsertV2 - capture the RecordID

    2. Create one or more SalesReceiptLine via MethodAPIInsertV2 (using the SalesReceipt RecordID)

    3. Push the data to QuickBooks via MethodAPIActionSendToDesktopV2 (also using the SalesReceipt RecordID)

    Unfortunately, there is a bug with the MethodAPIActionSendToDesktopV2 call at the moment and it does not work with QuickBooks Desktop (it does work with QuickBooks Online). I will post an update to this forum post when the status changes.  Until the fix is available you will need to rely on Method's Changes-only Sync to send the data to QuickBooks on the changes-only schedule (typically runs every 15 minutes).

    Just in case someone stumbles across this post and is looking for guidance on using the IsWaitingForSyncApproval field - it is a YesNo field, which means you need to send either Yes or No to the field.  The best way to figure this out is to make a MethodAPIFieldListV2 call (API call) and look for the field you are interested in.  In this case, if you call MethodAPIFieldListV2 for the SalesReceipt table you will see IsWaitingForSyncApproval in the list of fields returned and the DataType is YesNo.

    Peter

    Peter Dyer
    Product Manager - Method
  • 12-04-2017 1:39 PM In reply to

    Re: Creating a Sales Receipt from our website using API

    HI Peter,

    I am not sure why you say the suggestion from support is a red herring.   It works.   If we send across the Sales Receipt and get it into Method using the API everything looks right in Method other than it does not come across to QB.  It we create a Sales Receipt directly in Method it come across to QB very quickly.   What support told us to do was to set the IsWaitingForSyncApproval to yes and then set it back to no.  Once we do this the SalesReceipt comes across to QB within in a very short amount of time.  Without doing this we can wait for a very long time and it does not seem to ever come across.

    Not sure what you are saying about the MethodAPIActionSendToDesktopV2.  Very disappointed to hear that it does not work with QB Desktop.  Any idea when it will be fixed to work from the API.   

    If what you are saying is that the SendToDesktop forces the send to QB immediately versus the "Changes-only Sync" only does it periodically (typically 15 mins) then the problem we reported is a problem for some reason whcih we do not understand.   We have waited many hours for the sync and unless we set the IsWaitingForSyncApproval flag as we noted it does not come across.to QB.

    One think you noted is that the flag is a YesNo.  That was one question we raised in terms of when setting that flag in the API should it be a string = "No" or is it a boolean value of 0?

    Please feel free to call me if you want to discuss in any more detail.

    808-214-0008




    Stuart Katz
    Noggin Builders
    Let your children come explore the wonders!
  • 12-04-2017 3:07 PM In reply to

    Re: Creating a Sales Receipt from our website using API

    We discussed some good points for clarification:

    - Stuart is 100% right, the IsWaitingForSyncApproval field needs to be set to No (or false), or it will not Sync.  The red herring comment was strictly in reference to forcing data to be sent to QuickBooks with the API.  That requires calling MethodAPIActionSendToDesktopV2 .  To that end there is a decent example of MethodAPIActionSendToDesktopV2 on Page 28 of the API documentation.

    - With regard to setting the value of IsWaitingForSyncApproval, technically you have a lot of options.  First, it must be set as a string.  Second, you can set the string to true or false , yes or no , 1 or 0 (all as strings, capital letters or not).  If you ask the API for a YesNo field it will respond with true or false.

    Peter Dyer
    Product Manager - Method
  • 12-14-2017 2:34 PM In reply to

    Re: Creating a Sales Receipt from our website using API

    Peter,

    Sorry for the delay in getting back to this.  Other business has been higher on the list.

    We are running Method Classic and QB Desktop.

    Okay we understand the following:

    1. At this time the MethodAPIActionSendToDesktopV2  does not work for syncing with the DeskTop QB.  We understand that Method is working on correcting this issue.  Assuming this is corrected then in the future will the following will be valid?
    2. MethodAPIActionSendToDesktopV2  needs to be called in order for the Sales Receipt to be synced.  Are we correct to assume that this must be called for each individual Sales Receipt we send over via an API using the SalesReceipt RecordID?
    3. Can we also assume that if the QB DeskTop is offline then when it comes back online all the Sales Receipts that have been sent via an API with both the MethodAPIInsertV2 and the MethodAPIActionSendToDesktopV2 will be synced the next time the sync between Method and QB runs automatically.   
    4. Assuming the above is valid then we assume the MethodAPIActionSendToDesktopV2 must be setting a flag or putting the Sales Receipt into a queue of some type as well as kicking off a Sync.   Are we correct in assuming that the code for the Save / Update Actions must be doing this same thing behind the scenes in Method.

    Thanks

    Stuart

    Stuart Katz
    Noggin Builders
    Let your children come explore the wonders!
  • 12-14-2017 3:20 PM In reply to

    Re: Creating a Sales Receipt from our website using API

    i Stuart,

    1. Correct

    2. MethodAPIActionSendToDesktoV2 needs to be called to Sync the Sales Receipt in 'real-time'.  If you don't call MethodAPIActionSendToDesktoV2 (or can't because it is broken) the Sales Receipt will get picked up by the next Changes-Only (typically, syncs every 15 mins) or Full (typically, syncs once a day) Sync.  You are correct that the call must be made for each individual Sales Receipt using the RecordID.

    3. Correct.  The next time Sync runs (either a Changes-Only or Full Sync) any records that have been updated since the last Sync (including, but not limited toany recors created via the API) will get picked up and Sync'ed.

    4. Correct.  MethodAPIInsertV2 will add a record to Method, and MethodAPIActionSendToDesktopV2 will trigger the change to be sent to QBDT.  Similarly, you could call MethodAPIUpdateV2 to update a record in Method, and then call MethodAPIActionSendToDesktopV2 to trigger that change to be sent to QBDT.

    Regards,

    Peter Dyer
    Product Manager - Method
  • 01-29-2018 2:14 PM In reply to

    Re: Creating a Sales Receipt from our website using API

    Peter,

    I am not sure why we are having such difficulty expressing the problem.

    We understand that the API send to Desktop V2 is broken.

    You said:

    Until the fix is available you will need to rely on Method's Changes-only Sync to send the data to QuickBooks on the changes-only schedule (typically runs every 15 minutes).

    Our problem is that when we wait for the Sync to run as scheduled the Sales Receipts still do not come over until we run a little routine that sets the IsWaitingforSync to "YES" and then setting it right back to "NO".

    In the PHP code the developer has the following:

    'IsWaitingForSyncApproval' => 'false',
                                                                  

    We need to get this fixed.  We can we anticipate this to be corrected.

    Stuart

    Stuart Katz
    Noggin Builders
    Let your children come explore the wonders!
  • 01-30-2018 4:14 PM In reply to

    Re: Creating a Sales Receipt from our website using API

    The issue appears related to MethodAPIActionSendToDesktopV2.  Even though the real-time sync is not initiated when MethodAPIActionSendToDesktopV2 is called (becaue of the previously mentionend issue), it still needs to be called after a transaction and the transactions lines are inserted to ensure the transaction gets picked up by regarularly scheduled sync (Changes-Only and Full).  

    This is can also be accomplished by editing the transaction in the Method:UI.  This appears to be what was happening when IsWaitingForSyncApproval was edited.

    Peter Dyer
    Product Manager - Method
Page 1 of 1 (8 items)