Skip to content

IntuitDeveloper/SampleAppCustomFieldsNodeJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SampleApp-CustomFields-NodeJS

A sample Node.js application demonstrating how to manage QuickBooks Online (QBO) custom fields and create invoices using the QuickBooks API and GraphQL.

Features

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.

Prerequisites

  • Node.js (v16+ recommended)
  • A QuickBooks Online developer account
  • QuickBooks app credentials (Client ID, Client Secret, Redirect URI)

Setup Instructions

  1. Clone the repository:

    git clone <your-repo-url>
    cd SampleApp-CustomFields-NodeJS
  2. Install dependencies:

    npm install
  3. Configure environment variables: Create a .env file 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
  4. Start the app:

    node index.js
  5. Open in browser: Visit http://localhost:3000

Usage

  • Click Connect to QuickBooks and complete the OAuth login.
  • Use the UI to view, create, and manage custom fields and invoices.

Project Structure

  • index.js - Main server entry point
  • routes/oauth.js - OAuth authentication routes
  • routes/customfields.js - API routes for custom fields and invoices
  • services/ - Helper modules for authentication and GraphQL
  • pages/ - Frontend HTML, CSS, and JS
  • graphql/ - GraphQL queries and templates

API Reference

Visual Overview

App Home Screen OAuth Flow View All Custom Fields Create New Custom Field Create Invoice Using Custom Fields Invoice Verification in QBO

Notes

  • 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.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published