| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Pure SDK 6.5.2 webhook integration with real-time CloudEvents dashboard
This sample application demonstrates QuickBooks CloudEvents v1.0 webhook implementation using Java SDK 6.5.2 with Java 17 + Spring Boot 3.3.5
QuickBooks webhooks now use the CloudEvents v1.0 specification. Each webhook event includes:
[
{
"specversion": "1.0",
"id": "88cd52aa-33b6-4351-9aa4-47572edbd068",
"source": "intuit.dsnBgbseACLLRZNxo2dfc4evmEJdxde58xeeYcZliOU=",
"type": "qbo.customer.created.v1",
"datacontenttype": "application/json",
"time": "2025-09-10T21:31:25.179Z",
"intuitentityid": "1234",
"intuitaccountid": "310687",
"data": {}
}
]Key Fields:
Note: Make sure to enable CloudEvents format in your QuickBooks developer portal webhook settings!
When you enable CloudEvents payload format in the QuickBooks developer portal, you'll see a warning:
"Warning: changing payload format requires changing your endpoint processing to recognize the new format."
This sample app is already configured for CloudEvents! Here's what changed:
CloudEvents Format (This App):
[{
"specversion": "1.0",
"type": "qbo.customer.created.v1",
"intuitentityid": "123",
"intuitaccountid": "9341455327810551"
}]git clone <repository-url>
cd SampleApp-Webhooks-JavaCopy .env.example to .env and fill in your QuickBooks app credentials:
cp .env.example .envEdit .env with your values:
QB_CLIENT_ID=your_client_id_from_developer_intuit_com
QB_CLIENT_SECRET=your_client_secret_from_developer_intuit_com
QB_REDIRECT_URI=https://your-ngrok-url.ngrok-free.app/callback
QB_ENVIRONMENT=sandbox
WEBHOOKS_VERIFIER_TOKEN=your_webhook_verifier_tokenSecurity Note: Never commit your .env file! It's already in .gitignore.
ngrok exposes your localhost to the internet so QuickBooks can send webhooks to your local development environment.
Note: This sample app is designed for ngrok. While other tunneling services may work, ngrok is recommended and tested for this application.
Install ngrok:
Start ngrok:
ngrok http 8080Copy the HTTPS URL (e.g., https://abc123.ngrok-free.app) and:
Important: Keep ngrok running in a separate terminal while testing webhooks!
Configure your QuickBooks app with OAuth credentials and webhook settings in the developer portal.
Login to developer portal:
Configure Keys & OAuth:
Configure Webhooks:
IMPORTANT: Run this command in a separate terminal window (keep ngrok running in the first terminal):
./gradlew bootRunWait for the message: Started Application in X.XXX seconds
Then open http://localhost:8080 and click "Connect to QuickBooks"
Webhooks_Demo_compressed.mp4Watch the complete application walkthrough above showing OAuth connection, webhook configuration, and real-time event monitoring.
Launch Page - The home page displays the main features and a "Connect to QuickBooks" button to begin OAuth authentication.
OAuth Authorization - Click "Connect to QuickBooks" and select your QuickBooks Sandbox company to authorize the application to receive webhooks.
Configure Webhook Settings in Developer Portal - Navigate to your app in the QuickBooks Developer Portal, configure your webhook endpoint URL and verifier token, then enable CloudEvents format. Click "Send test event" to test your webhook endpoint and verify it can receive CloudEvents notifications.
Dashboard Overview - After connecting, the dashboard displays your connection information, webhook URL endpoint, and recent webhook events.
View Webhook Details - Click "View Details" on any webhook event to see CloudEvents metadata, Entity ID, Account ID, and the formatted JSON payload showing the complete CloudEvents structure.
Once the sample app code is on your computer, you can do the following steps to run the app:
Webhooks requires your endpoint to be exposed over the internet. The easiest way to do that while you are still developing your code locally is to use ngrok.
Sign up and install: Visit ngrok.com to create a free account and download ngrok
Authenticate: Follow ngrok's setup guide to connect your account
Expose your localhost by running this command in a terminal:
./ngrok http 8080You will get a forwarding URL that looks like this:
Forwarding https://cb063e9f.ngrok.io -> localhost:8080
Important: Use only the HTTPS URL, not HTTP, for webhooks!
Your webhook endpoint URL will be: https://cb063e9f.ngrok.io/webhooks
Copy this URL and configure it in your QuickBooks app on developer.intuit.com
This app processes CloudEvents v1.0 format webhooks from QuickBooks:
[
{
"specversion": "1.0",
"id": "88cd52aa-33b6-4351-9aa4-47572edbd068",
"type": "qbo.customer.created.v1",
"time": "2025-09-10T21:31:25.179Z",
"intuitentityid": "1",
"intuitaccountid": "123456789",
"data": {}
}
]CloudEvents Features:
How It Works:
src/main/java/
config/
QuickBooksConfig.java # App configuration & OAuth settings
EnvConfig.java # .env file loader
controllers/
WebhooksViewController.java # Main dashboard controller
WebhooksController.java # Webhook receiver endpoint
service/
CloudEventsWebhookParser.java # CloudEvents parser using SDK
QuickBooksOAuthService.java # OAuth 2.0 flow
WebhookStorageService.java # In-memory webhook storage
security/
SecurityService.java # Webhook signature validation
WebhooksServiceFactory.java # SDK WebhooksService factory
domain/
ResponseWrapper.java # API response model
src/main/resources/
application.yml # Main configuration
templates/
index.html # Home page
dashboard.html # Webhooks dashboard
1. QuickBooks -> Webhook Notification (CloudEvents v1.0) -> /webhooks endpoint 2. WebhooksController -> Validates signature using SDK WebhooksService 3. CloudEventsWebhookParser -> Parses using SDK WebhooksCloudEvents class 4. WebhookStorageService -> Stores events in memory (List) 5. Dashboard -> Displays webhook events with auto-refresh
Environment-based:
./gradlew test./gradlew clean buildThymeleaf templates reload automatically in dev mode.
If you see webhooks in your terminal logs but they don't appear in the dashboard UI, this is typically caused by accessing the app from a different URL than the one configured for OAuth.
Solution: Access the app using your ngrok URL instead of localhost:8080. OAuth session cookies are domain-specific and won't work across different URLs.
Note on Other Tunneling Services: This sample app is tested with ngrok. Other tunneling services may not properly forward session cookies, which can cause webhooks to be received but not displayed in the UI.
This is a common issue! Here's what to check:
Signature Validation - The app validates webhook signatures for security
Dashboard Smart Refresh - The dashboard automatically refreshes every 30 seconds
Using ngrok vs Other Testing Tools:
Check Application Logs:
# Look for these messages in your terminal:
"Webhook request received" # ✓ Webhook reached your app
"Webhook signature validated" # ✓ Signature is valid
"Stored webhook event" # ✓ Webhook was stored
"Webhook signature validation failed" # ✗ Invalid signature - webhook rejectedVerify ngrok Configuration:
WARNING: This is a demo app. For production:
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Copyright 2016 Intuit, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
| Back | FazBrowse Home | New Git URL |