Quickbooks Online integration c#

Re - 1) Do I need to authenticate myself every time I wish to connect to QBO IPP (to retrieve a list of customers, submit an invoice, etc.)? Or can my app authenticate itself once & stay 'connected' for months?

Please find below steps to get OAuth tokens using which you can make API call against your QBO account. If you create an app in appcenter, you'll get consumerKey and consumerSecret. https://developer.intuit.com/Application/Create/IA

Using the above two tokens, you can generate accessToken and accessSecret from the OAuthPlayground. https://appcenter.intuit.com/Playground/OAuth/IA PN - After completing C2QB(OAuth) flow, you should use 'App Menu API Test.' option which will show you accessToken and accessSecret.

These tokens are valid for 180 days(at max). When these tokens are more than 150 days old(and <180 days), you can make Reconnect API call to revalidate those again. Ref https://developer.intuit.com/docs/0050_quickbooks_api/0020_authentication_and_authorization/oauth_management_api#Reconnect

So you can always persist these tokens and reuse it.

To let end users connect their QB data with you SaaS app, you need to implement a wizard called 'Connect to Quickbook'. Using 3-legged Oauth your app will be able to capture the acessToken and acessSecret corresponding to the end-user's qbo account. Ref - https://developer.intuit.com/docs/0100_accounting/0060_authentication_and_authorization/connect_from_within_your_app#7._Add_the_Connect_to_QuickBooks_button

Re - 2) Is there any sample code to do basic things such as obtain a list of customers, submit an invoice, etc.?

Please refer - https://developer.intuit.com/docs/0100_accounting/0500_developer_kits/0150_ipp_.net_devkit_3.0/0002_synchronous_calls#/Data_Services_API

and how to add invoice or sales receipt quickbooks rest api v3.0

Hope this will be useful.

Thanks