Skip to content

PUL-16: minimal WhatsApp Cloud API pilot, for App Review - #13

Merged
nitheeshdr merged 2 commits into
mainfrom
feat/pul-16-cloud-api-pilot
Sep 7, 2026
Merged

PUL-16: minimal WhatsApp Cloud API pilot, for App Review#13
nitheeshdr merged 2 commits into
mainfrom
feat/pul-16-cloud-api-pilot

Conversation

@nitheeshdr

Copy link
Copy Markdown
Collaborator

Jira issue

PUL-16 (partial slice)

Summary

App Review's screencast/API-test-call requirements need a real feature
to demonstrate. This is a deliberately minimal, real slice: one working
send (whatsapp_business_messaging) and one working template list
(whatsapp_business_management), against Meta's own free test business
number. Not the merchant-facing send path (PUL-18) -- just enough to
legitimately pass App Review.

Checks

  • npm run typecheck
  • npm run lint (0 errors, 5 pre-existing warnings unrelated)
  • node scripts/check-openapi.mjs (42/42 routes documented)
  • Verified in browser: new page correctly redirects to sign-in
    (proxy.ts gating works), no server compile errors
  • Real send/template-list not yet tested end-to-end -- still
    waiting on the Phone Number ID from the App Dashboard

Note

This is a partial slice of PUL-16's full scope (no webhook receiver,
no template-message sending). Staying open after merge, not Done.

App Review's screencast and API-test-call requirements need a real,
working feature to demonstrate -- nothing in the Cloud API epic
(PUL-13 through PUL-20) existed in code yet, only Jira tracking and
Meta-side account setup.

This is a deliberately minimal, real slice: one working send
(whatsapp_business_messaging) and one working template list
(whatsapp_business_management), against Meta's own free test business
number (temporary token from the App Dashboard's API Setup page, in
.env.local, never committed). Not the merchant-facing send path --
that's PUL-18, gated on the billing decision (PUL-15) and template
workflow (PUL-17). Not reachable from the main sidebar nav.

- src/lib/whatsapp-cloud/client.ts: new, parallel to (not replacing)
  src/lib/whatsapp/client.ts's gateway client, per PUL-16's own scope
  note in the epic.
- src/app/api/whatsapp-cloud/{test-send,templates}: two thin routes,
  same requireTenant + hand-typed-recipient-only pattern as the
  existing /api/whatsapp/test route.
- src/app/(app)/whatsapp-cloud-pilot: one page to record the App
  Review screencast against.
- src/proxy.ts: added to PROTECTED_PAGES.
- src/lib/openapi.ts: both new routes documented, new tag added.

This is a partial slice of PUL-16's full scope (no webhook receiver,
no template-message sending yet) -- staying open after this merges,
not moving to Done.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pulse-commerce Ready Ready Preview Sep 7, 2026 4:58pm UTC

Two real bugs found by actually testing against Meta's live API:

1. sendCloudTextMessage (free-form) only delivers within an open 24h
   customer-service window -- Meta's API accepts the call and returns
   a real message id outside that window, but never delivers it. A
   pre-verified test recipient is exempt from needing App-Review
   production access, but NOT from this window rule, which is
   universal. Confirmed by a real send that "succeeded" per the API
   response but never arrived.

2. listCloudMessageTemplates tried to resolve the WABA id from the
   phone number node via a `whatsapp_business_account` field that
   does not exist on that node ("(#100) Tried accessing nonexisting
   field"). There is no documented way to derive it from the phone
   number id -- it's a third env var now, read directly from the App
   Dashboard's "WhatsApp Business account ID" shown next to the test
   number.

Fix for (1): added sendCloudTemplateMessage, using the "hello_world"
template every WABA has pre-approved from creation -- delivers
reliably with no open-window requirement, same as real merchant sends
(order confirmations, campaigns) always will need. The pilot page and
route now default to template mode, with free-form text still
available and clearly labelled with the window caveat.

Fix for (2): WHATSAPP_CLOUD_TEST_WABA_ID env var, set directly rather
than derived.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@nitheeshdr
nitheeshdr merged commit f0d2090 into main Sep 7, 2026
7 of 10 checks passed
@nitheeshdr
nitheeshdr deleted the feat/pul-16-cloud-api-pilot branch September 7, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant