InstaTunnel
Navigation menu o kirikae
API
11 min read
28 views

localhost上の CloudEvents Webhooks: 配列とコンテンツタイプ、そしてそれらをスキップするパーサ

Qlik Cloudは CloudEvents のみを採用へ。2026年12月10日。QuickBooks の Webhooks が JSON 配列として届く理由と、localhost でコンテンツタイプとパーサをテストする方法を学びましょう。

IT
InstaTunnel Team
Published by the InstaTunnel team | Editorial policy
localhost上の CloudEvents Webhooks: 配列とコンテンツタイプ、そしてそれらをスキップするパーサ

Quick answer

localhost上の CloudEvents Webhooks: 配列とコンテンツタイプ: webhook testing answer

For local webhook testing, run your app locally, expose it with a public HTTPS tunnel, and paste the stable callback URL into the provider dashboard.

How do I test webhooks on localhost?

Start your local server, open a public HTTPS tunnel to that port, configure the provider webhook URL, and inspect events in your local logs.

Why does a stable webhook URL matter?

Stable URLs prevent provider dashboards from needing manual callback updates every time you restart a tunnel.

On December 10, 2026, eight days from today, Qlik Cloud stops sending hybrid webhook payloads and sends CloudEvents only. Intuit has already moved QuickBooks Online webhooks to CloudEvents. Its mandatory migration deadline was extended from May 15 to July 31, 2026, and has now passed. Two vendors, one standard, and the same quiet failure waiting on your laptop: a handler that never actually reads the request.\n\nThis article is about the envelope, not the migration. If you have been through a provider’s v1-to-v2 cutover before, you know the field-mapping work. The part that bites during local development is different: CloudEvents deliveries can arrive as a JSON array, under a content type your JSON parser does not recognize. Here is what the vendors send, what popular parsers do with it (I tested four), and how to build a localhost harness that catches the problem before production does.\n\n## 何が変更され、いつ(checked December 2, 2026)\n\nQlik Cloud. Events that were not already CloudEvents have been sent as hybrids, carrying both legacy and CloudEvents fields, since November 3, 2025. Qlik’s changelog says the legacy fields (eventId, eventTime, eventType, cloudEventsVersion, contentType and the extensions properties) are removed on December 10, 2026, when hybrid events become CloudEvents-only. Qlik moved that date from October 6, 2026, in an update dated October 2, so older posts and cached pages may still show the earlier one. Qlik says the new format follows CloudEvents 1.0.2, and the replacements are id, source, type, time and the other standard attributes. Qlik also published a community guide for migrating Qlik Automate workflows, which is worth reading if automations trigger from webhooks.\n\nIntuit QuickBooks Online. Intuit’s developer blog says its webhooks infrastructure moved to CloudEvents, and that an app which makes no change will stop being able to process notifications. The original deadline was May 15, 2026. A May 5, 2026 update on Intuit’s Medium post moved it to July 31, 2026, and the Intuit blog page still shows the older date. Apps switch with a per-app option on the Webhooks page in the developer portal, in sandbox and production separately, and Intuit says you can switch back if needed. Intuit’s SDKs support both formats. Its post names Java 6.5.2, PHP 6.2.2 and .NET 14.7.3 as the versions to update to.\n\nOne gap to know about. Hookdeck’s QuickBooks guide, last updated November 18, 2026, includes live test deliveries. It reports that an app with the CloudEvents toggle off (the default) still received the legacy eventNotifications object, and that no Intuit page it could read says when the legacy format stops being sent. Don’t assume your app is on either format. Check the toggle, confirm with a real delivery, and until then handle both shapes.\n\n## CloudEvents over HTTP: three modes, three signals\n\nThe CloudEvents HTTP protocol binding (v1.0.2) defines three content modes, and the receiver tells them apart by the Content-Type header:\n\n| Mode | Content-Type | Body |\n| — | — | — |\n| Binary | Whatever the event’s datacontenttype is (often application/json) | Just the event data; attributes arrive as ce-* headers |\n| Structured | application/cloudevents+json | One JSON object holding attributes and data |\n| Batched | application/cloudevents-batch+json | A JSON array of event objects |\n\nThe spec’s detection rule is simple. A value starting with application/cloudevents-batch means batched mode, a value starting with application/cloudevents means structured, and anything else defaults to binary. IANA registered both JSON media types on May 12, 2026. It describes application/cloudevents+json as a body with exactly one CloudEvent, and the batch type as a body with any number of events as a JSON array. The spec also says batched mode must not be used unless solicited. Registering a webhook endpoint is arguably that solicitation, but either way your handler cannot assume one event per request.\n\nThe consequence is worth stating plainly. A body can be valid CloudEvents JSON and still arrive labelled application/json. By the spec’s own rule a strictly compliant receiver would treat that as binary mode and look for ce-* headers that are not there. Don’t point an SDK’s HTTP decoder at every vendor’s endpoint and assume it will work.\n\n## Two vendors, two envelopes\n\n| | Qlik Cloud | QuickBooks Online (CloudEvents) |\n| — | — | — |\n| Body shape | One JSON object | JSON array, one element per event |\n| Content-Type | application/json in Qlik’s documented example request | application/cloudevents-batch+json; charset=utf-8 in Hookdeck’s November 2026 test delivery |\n| Event type | type, e.g. com.qlik.analytics.change-store.changes.saved | type, e.g. qbo.account.created.v1 |\n| Identity | tenantid and userid at the top level | intuitaccountid (the realm ID) and intuitentityid per element |\n| Signature header | Qlik-Signature, hex HMAC-SHA256 of the raw body | intuit-signature, base64 HMAC-SHA256 of the raw body |\n| Secret | Optional, you choose it, 32 to 64 characters | Verifier Token from the portal, one per environment |\n\nIntuit’s own documentation is inconsistent about the content type. Its sample headers show application/json; charset=utf-8, and its migration notes, as quoted by Hookdeck, warn that CloudEvents payloads may arrive as application/cloudevents+json. The test delivery Hookdeck captured used neither. It was the batch type, with an intuit-notification-schema-version: 2.0 header, while a legacy test delivery carried 1.0 and application/json; charset=utf-8. Treat the header as a handy tell for which shape you received, but don’t rely on it in production code.\n\nTwo more QuickBooks details matter for the array. Intuit says one notification can contain events for different companies, so read the realm from every element, never once per request. And data can be empty or missing (Intuit’s own sales receipt example omits it), so treat it as optional and fetch the record from the API.\n\nOn the Qlik side, the “Cloud event” checkbox on the webhook form switches a webhook to the CloudEvents format, and Hookdeck reports that it cannot be undone once saved. Use a throwaway test webhook for it.\n\n## Which parsers skip the request\n\nI sent the same one-element array to four setups under four content types: application/json, application/cloudevents+json, application/cloudevents-batch+json; charset=utf-8 and, for Express, text/plain.\n\n| Framework (version tested) | application/json | CloudEvents types |\n| — | — | — |\n| Express 4 (4.22.3), default express.json() | Parsed as an array | 200, but req.body is {} |\n| Express 5 (5.3.0), default express.json() | Parsed as an array | 200, but req.body is undefined |\n| Fastify (5.12.8), default parser | Parsed as an array | 415 FST_ERR_CTP_INVALID_MEDIA_TYPE |\n| Flask (3.1.3), request.get_json() | Parsed as an array | Parsed as an array |\n\nThese were the latest releases of each on December 2, 2026. Flask accepts any application/*+json type, which is why Python handlers often work by accident. The Node results are the dangerous ones, and they fail in different ways.\n\nExpress skips silently. The default JSON parser only matches application/json. For anything else it moves on without touching the body, so your route runs with an empty or missing req.body. If you verify signatures against the raw body, the check fails and you return 401. If you don’t, your code iterates an empty object and returns 200 having processed nothing, which is worse: the vendor thinks the event was delivered.\n\nFastify rejects loudly. A 415 is at least visible, but it is still a failed delivery. Per Hookdeck’s summary of Intuit’s documentation, QuickBooks expects a 200 within three seconds and retries failures at 10 seconds, 20 seconds, 30 seconds, 5 minutes, 20 minutes, 2 hours, 4 hours and 6 hours, then every six hours. Intuit also warns that you may not receive later events until the first is acknowledged. Hookdeck adds, from Intuit’s migration notes, that a 400 marks the delivery failed and retries the whole batch.\n\nThe same trap applies to a signature middleware that expects application/json. Whatever raw-body capture you use must run for every content type on the webhook route. Before you can preserve the bytes, the parser has to agree to read them.\n\n## Fixing the parser\n\nFor Express, widen the JSON parser’s type option. I tested this on both versions. All three JSON content types now yield an array, while text/plain still falls through:\n\n\napp.use(express.json({ type: ['application/json', 'application/*+json'] }));\n\n\n\nIf you verify signatures (you should), skip the JSON parser on that route and take the bytes yourself:\n\n\napp.post('/webhooks/quickbooks',\n express.raw({ type: () => true, limit: '10mb' }),\n handler);\n\n\n\nFor Fastify, register a parser for the CloudEvents types. I tested the buffer form, and both types now return a buffer:\n\n\nfastify.addContentTypeParser(\n ['application/cloudevents+json', 'application/cloudevents-batch+json'],\n { parseAs: 'buffer' },\n (req, body, done) => done(null, body)\n);\n\n\n\n## One handler for both envelopes\n\nUntil your app and your vendors have settled on one shape, normalize at the door and let the rest of your code see a single event type. This handler verifies the QuickBooks signature over the raw bytes, then flattens the CloudEvents array, the legacy object and a single CloudEvent object into one list:\n\n\nconst crypto = require('crypto');\nconst express = require('express');\n\nfunction verify(raw, header, token) {\n if (!header || !token) return false;\n const expected = crypto.createHmac('sha256', token).update(raw).digest('base64');\n const a = Buffer.from(header), b = Buffer.from(expected);\n return a.length === b.length && crypto.timingSafeEqual(a, b);\n}\n\nfunction normalize(body) {\n if (Array.isArray(body)) { // QuickBooks CloudEvents batch\n return body.map(e => ({ id: e.id, type: e.type, realm: e.intuitaccountid, raw: e }));\n }\n if (Array.isArray(body?.eventNotifications)) { // QuickBooks legacy\n return body.eventNotifications.flatMap(n =>\n (n.dataChangeEvent?.entities ?? []).map(en =>\n ({ id: null, type: `${en.name}.${en.operation}`, realm: n.realmId, raw: en }))));\n }\n if (body?.specversion) { // single CloudEvent object\n return [{ id: body.id, type: body.type, realm: body.tenantid, raw: body }];\n }\n return []; // unknown shape: log it, don't throw\n}\n\nconst app = express();\napp.post('/webhooks/quickbooks', express.raw({ type: () => true, limit: '10mb' }), (req, res) => {\n const raw = Buffer.isBuffer(req.body) ? req.body : Buffer.alloc(0);\n if (!verify(raw, req.get('intuit-signature'), process.env.QUICKBOOKS_VERIFIER_TOKEN)) {\n return res.sendStatus(401);\n }\n const events = normalize(JSON.parse(raw.toString('utf8')));\n // persist events, then process them asynchronously\n res.sendStatus(200);\n});\n\n\n\nI ran this on Express 5.3.0 against four requests. A CloudEvents batch sent as application/cloudevents-batch+json, the same bytes sent as application/json, and a legacy object all verified and normalized correctly. A request with a bad signature returned 401.\n\nLegacy QuickBooks entries have no event ID, so a dedupe key has to be built from the realm, entity name, entity ID, operation and lastUpdated. For CloudEvents, store each event’s id.\n\nFor Qlik, the same pattern applies with its own pieces: a hex digest in Qlik-Signature, the raw body, and type, id and time as the primary fields. Qlik’s guidance is to move to those now and keep the legacy names only as a fallback until December 10.\n\n## Testing CloudEvents webhooks through a tunnel\n\nBoth vendors need a public HTTPS URL pointing at your laptop, and a tunnel is the usual answer. The tunnel isn’t where this problem lives: it forwards bytes and headers, and the failure happens in your parser. What a tunnel does give you is a way to receive real deliveries locally. Hookdeck’s CLI, for instance, forwards to localhost with npx hookdeck-cli listen 3000 quickbooks --path /webhooks/quickbooks, and any tunnel that keeps the same URL between restarts saves you from re-registering the endpoint.\n\nA workable loop:\n\n1. Capture real deliveries. Save the raw body and the full header set of every request to disk. Fixtures from real traffic are worth more than examples from documentation. Hookdeck notes that Qlik publishes complete examples for only 2 of its 22 event types.\n2. Replay with curl. Use printf '%s' to write the body, because a trailing newline changes the HMAC:\n\n\nprintf '%s' '[{"specversion":"1.0","id":"88cd52aa-33b6-4351-9aa4-47572edbd068","type":"qbo.account.created.v1","intuitentityid":"1234","intuitaccountid":"310687"}]' \u003e batch.json\n\ncurl -i http://localhost:3000/webhooks/quickbooks \\\n -H 'Content-Type: application/cloudevents-batch+json; charset=utf-8' \\\n -H 'intuit-signature: PTs9BSwjYqOgFhLMBnVFCOlBZ+EC6WWqVDBTUoSfxH8=' \\\n --data-binary @batch.json\n\n\n\nWith the verifier token quickbooks-test-verifier-token, that signature is the correct base64 HMAC-SHA256 of that exact body. I recomputed it independently and it matches the value in Hookdeck’s QuickBooks guide, so you can test your verification code before a real delivery arrives. \n3. Use the vendors’ test tools. Intuit’s portal has a Send test events option on the Webhooks page, with separate sandbox and production configurations. Hookdeck reports that with the CloudEvents toggle on, the picker lists 105 event names, and that void operations are spelled void, not voided (for example qbo.invoice.void.v1). Qlik’s webhook form has the Cloud event option described above. \n4. Account for timing quirks. Intuit says the first notification can take up to five minutes, and notifications only arrive for companies that have authorized your app through OAuth, sandbox companies included.\n\n## Checklist before the cutover\n\n- Read the raw body for every content type on the webhook route.\n- Accept application/cloudevents+json, application/cloudevents-batch+json and application/json, with or without ; charset=utf-8.\n- Branch on Array.isArray(body), then normalize into one internal event.\n- Loop over every element and read the realm or tenant per event.\n- Treat data as optional.\n- Log unknown shapes and content types instead of throwing.\n- Return 200 quickly, then process from a queue.\n- Confirm in a real delivery which shape your app receives today.\n\n## FAQ\n\nAre CloudEvents webhooks always JSON arrays? \nNo. A single event can be a JSON object (structured mode, application/cloudevents+json), and batched mode is the array form. QuickBooks sends arrays, while Qlik’s documented example is a single object.\n\nWhat Content-Type does QuickBooks send for CloudEvents? \nHookdeck’s November 2026 test delivery used application/cloudevents-batch+json; charset=utf-8. Intuit’s docs show application/json in samples and its migration notes mention application/cloudevents+json. Accept all three.\n\nWhen does Qlik Cloud remove legacy webhook fields? \nOn December 10, 2026, according to Qlik’s changelog, extended from October 6, 2026.\n\nIs the old QuickBooks webhook format still sent? \nIntuit’s deadline for migrating was extended to July 31, 2026 and has passed. Hookdeck’s November 2026 testing still received the legacy object on an app with the CloudEvents toggle off, and it found no end date stated on Intuit’s pages. Check your app’s toggle and handle both shapes.\n\nWhy does my Express handler return 200 but process nothing? \nThe default express.json() only parses application/json. For other content types it moves on without touching the body, so your route runs with an empty or missing req.body. If you verify signatures against the raw body, the check fails and you return 401. If you don’t, your code iterates an empty object and returns 200 having processed nothing, which is worse: the vendor thinks the event was delivered.\n\n## Sources\n\n- Qlik changelog: webhooks legacy fields removal\n- Qlik Cloud system events\n- Qlik Community: Webhooks migration to new event formats\n- Intuit: Upcoming change to webhooks payload structure (blog)\n- Intuit: Upcoming change to webhooks payload structure (Medium, with May 5, 2026 update)\n- Intuit: Configure webhooks\n- Hookdeck: Guide to QuickBooks webhooks\n- Hookdeck: Guide to Qlik Cloud webhooks\n- CloudEvents HTTP protocol binding v1.0.2\n- IANA: application/cloudevents-batch+json\n- IANA: application/cloudevents+json

Continue from this article into the most relevant product guides and workflows.

Related Topics

#CloudEvents#CloudEvents webhooks#CloudEvents webhook localhost#CloudEvents JSON array#CloudEvents content type#application/cloudevents+json#application/cloudevents-batch+json#CloudEvents batch mode#CloudEvents spec#CloudEvents envelope#CloudEvents structured mode#CloudEvents binary mode#CloudEvents parser#CloudEvents body parser#CloudEvents SDK#CloudEvents Node.js#CloudEvents Express#CloudEvents Python#CloudEvents Go#webhook localhost testing#test webhooks locally#localhost webhook tunnel#webhook tunneling#ngrok alternative#expose localhost to internet#local webhook development#webhook debugging#webhook handler#webhook payload array#webhook JSON array parsing#webhook content type mismatch#express.json content type#body-parser type option#webhook middleware#webhook signature verification#webhook raw body#QuickBooks webhooks#QuickBooks CloudEvents#QuickBooks webhook migration#Intuit webhooks CloudEvents#Intuit developer webhooks#QuickBooks Online API#QuickBooks webhook payload#Qlik Cloud webhooks#Qlik CloudEvents#Qlik webhook legacy fields removal#Qlik Cloud December 2026#webhook format migration#legacy webhook payload#webhook breaking change#webhook event schema#event-driven architecture#event-driven webhooks#cloud-native events#CNCF CloudEvents#API webhooks best practices#developer infrastructure#webhook development guide

Keep building with InstaTunnel

Read the docs for implementation details or compare plans before you ship.

Share this article

More InstaTunnel Insights

Discover more tutorials, tips, and updates to help you build better with localhost tunneling.

Browse All Articles