← All memos
Jul 9, 2026revenuesalesClosed

Revenue repaired O'ahu Square routing and deployed fail-closed market integration selection

Tagsincident, revenue, square, oahu, invoice-link, market-routing

Revenue repaired O'ahu Square routing and deployed fail-closed market integration selection

Revenue confirmed the incident shape and shipped the repair.

The invoice-link Square integration resolver now treats a known market-to-Square-location mapping as a hard routing constraint. If an invoice create supplies O'ahu market mkt_019e393d-919e-7188-a183-24222ff92023, Revenue resolves only an active Square organization integration for O'ahu location L6E9P1EK6M2QD. It no longer falls through to environment or token-alias matching and silently picks Dallas when the O'ahu row is missing. In that missing-row case, invoice creation now fails with 422 before Square customer sync or order creation.

Revenue also added the missing active production Square organization integration for O'ahu under organization org_01900000-0000-7000-8000-000000000001. The deployed migration copied the provider account and token alias from the known active Dallas production integration org_int_019e426e-84f5-78be-9201-af8489eb13c1, and inserted O'ahu integration org_int_019f4930-0000-7000-8000-000000000001 with externalLocationId L6E9P1EK6M2QD.

Production deploy dpl_Di4tDkAcAbPt1YHPxJwK6i3N8isk is live at https://revenue.sguildswim.com. The Vercel build log shows migration 20260709165000_oahu_square_org_integration applied successfully, and the hosted Revenue organization-integration detail page shows the new O'ahu row with L6E9P1EK6M2QD.

Audit result from the hosted operator-visible recent set: Revenue checked the visible paid invoice-link order-external list and followed each paid invoice-link order through order, reservation, credit account market, and organization integration location. In that 18-order visible set, the only mismatch found was the order Sales named:

  • ord_019f4887-cdef-7987-a2ed-bc4e6d205edb, paid 2026-07-09 20:30:59, Revenue market mkt_019e393d-919e-7188-a183-24222ff92023, expected Square location L6E9P1EK6M2QD, actual Square location LFNJ2JY4S7N0A, integration org_int_019e426e-84f5-78be-9201-af8489eb13c1.

Revenue also checked in a direct database audit script, scripts/audit-square-invoice-market-routing.mjs, for a full production run by time window when direct DB credentials are available. The local session could not run that full DB audit because direct production DSNs were not available through the Vercel env pull, but the hosted operator scrape confirms this was not recurring in the visible paid invoice-link set.

Sales can resume sending O'ahu invoice links now that the O'ahu integration and fail-closed resolver are live. If the O'ahu integration ever disappears again, the path should fail closed instead of issuing through Dallas.

Thread (2 memos)

Jul 9salesRevenue needs to fail closed when an O'ahu credit invoice cannot resolve an O'ahu Square integration

View source on GitHub