How to get Quickbooks online data in my webapp without the user logging in

喜夏-厌秋 提交于 2019-12-24 12:37:18

问题


I'm creating an ecomerce app for a local store and they use Quickbooks Online. I can see the Quickbooks Online API requires a "Connect to Quickbooks" button where the user then logs in, but that's not what I'm looking for. What I'm looking for is something when they look at the products page, the app queries (or sends a REST/SOAP call) and gets back product data for my store. Our customers will have no idea that we're using quickbooks online, and definitely won't have a login. The flow would be like:

Customer clicks Products

ProductsAction will execute a service call to QuickBooks to get the products we sell (select * from products)

ProductsAction will return Success passing in the list of products to the page to be rendered.

mycompany/Products renders the items returned from QuickBooks Online.

Is there any possible way to do this? Everything I've read requires O'Auth authentication (meaning the user would have to login to QBO).

Feel free to ask any questions an thanks in advance!


回答1:


I can see the Quickbooks Online API requires a "Connect to Quickbooks" button where the user then logs in, but that's not what I'm looking for.

Yes, it is.

You only have to log in ONCE. Exactly ONCE, and then you never, ever have to log in ever again. So, your QuickBooks admin logs in ONCE using the "Connect to QuickBooks" button, and then NEVER LOGS IN AGAIN.

Instead, you store the OAuth tokens, and use the stored tokens to do you queries from there on out.

What I'm looking for is something when they look at the products page, the app queries (or sends a REST/SOAP call) and gets back product data for my store.

This is all perfectly do-able. The reason you can't do it right now is because you're not storing the OAuth tokens like you should be.

Our customers will have no idea that we're using quickbooks online, and definitely won't have a login.

They don't need to have any idea about this. Store the OAuth tokens after you connect ONCE, and then everything can be unattended, no login, you just query away whenever you want to.

Is there any possible way to do this?

Yes!

Everything I've read requires O'Auth authentication (meaning the user would have to login to QBO).

The QuickBooks admin logs in ONCE and then never again. Store the OAuth tokens after that one and only login, and then use those to do all of your queries in the future.

This is how OAuth works for every single application that uses OAuth on the entire planet. Log in and authenticate once, store the tokens you get for future queries.

... ...

Did I mention you should be storing the OAuth tokens that you get back after that one single time your QuickBooks admin logs in? :-P




回答2:


Yes, you can do this:

  1. Create an account on https://developer.intuit.com using your accounts QBO login.
  2. Make an app
  3. Grab OAuth creds from the API Explorer.

See my tutorial for help on the first two steps: http://minimul.com/integrating-rails-and-quickbooks-online-via-the-version-3-api-part-1.html

You still need OAuth creds but since you only desire to interact with your company/personal QBO account you don't need to do anything formal, just get the OAuth credentials somehow. Once you have the credentials you can start building your integration code.



来源:https://stackoverflow.com/questions/26424785/how-to-get-quickbooks-online-data-in-my-webapp-without-the-user-logging-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!