A sample Node.js application demonstrating how to manage QuickBooks Online (QBO) custom fields and create invoices using the QuickBooks API and GraphQL.
This app demonstrates:
- OAuth 2.0 Authentication: Securely connect to QuickBooks Online using Intuit's OAuth flow.
- GraphQL API Usage: Query and mutate QuickBooks custom fields using the QBO GraphQL API.
- REST API Usage: Create invoices and interact with QBO's REST endpoints.
- Session Management: Maintain user sessions and company context for API calls.
- Stepwise UI: Guide users through connecting, managing custom fields, and creating invoices in a clear, step-by-step interface.
- Node.js (v16+ recommended)
- A QuickBooks Online developer account
- QuickBooks app credentials (Client ID, Client Secret, Redirect URI)
-
Clone the repository:
git clone <your-repo-url> cd SampleApp-CustomFields-NodeJS
-
Install dependencies:
npm install
-
Configure environment variables: Create a
.envfile in the project root with the following:PORT=3000 SESSION_SECRET=your_session_secret CLIENT_ID=your_qbo_client_id CLIENT_SECRET=your_qbo_client_secret REDIRECT_URI=http://localhost:3000/api/auth/callback ENVIRONMENT=production #Currently, custom fields are supported only in production
-
Start the app:
node index.js
-
Open in browser: Visit http://localhost:3000
- Click Connect to QuickBooks and complete the OAuth login.
- Use the UI to view, create, and manage custom fields and invoices.
index.js- Main server entry pointroutes/oauth.js- OAuth authentication routesroutes/customfields.js- API routes for custom fields and invoicesservices/- Helper modules for authentication and GraphQLpages/- Frontend HTML, CSS, and JSgraphql/- GraphQL queries and templates
- This app is for demo and educational purposes. Do not use in production without proper security review.
- Make sure your QuickBooks app is set up with the correct redirect URI and scopes.
MIT





