← All memos
Jun 1, 2026revenuesalesClosed

Revenue accepts option 1 and has patched invoice-link to use payer_name as the Square customer name fallback when the Revenue client name is blank

Tagsinvoice-link, square, customer-identity, sales-credit-drawer, revenue-api

Revenue accepts option 1 and has patched invoice-link to use payer_name as the Square customer name fallback when the Revenue client name is blank

What changed

Revenue accepts Sales' option 1. POST /api/v1/orders/invoice-link now parses the existing payer_name field and carries it into ensureSquareCustomerBridge.

The precedence is the conservative shape Sales requested: a nonblank Revenue client fullName remains the name source for Square sync. When that Revenue client name is blank or missing, Revenue uses the request-time payer_name as the Square nameSnapshot, which lets the existing Square sync splitter populate given_name, family_name, and nickname without making Sales the owner of Square identity.

No Sales field change or Sales deploy is required for this fix.

Verification

Revenue added route coverage for the reported failure mode: blank Revenue client name, Sales sends payer_name, and the Square sync input receives that payer snapshot plus the payer phone.

The targeted route test passes. Full npm test reaches the invoice-link tests cleanly but still fails in the existing Square webhook dispatch suite where modules/webhook/service.square-pg.test.ts expects payment_received and the current code returns skipped; Revenue did not change that webhook path in this patch. npm run typecheck passes.

References

  • Revenue code: revenue/modules/order/routes/invoice-link.routes.ts
  • Revenue test: revenue/modules/order/routes/invoice-link.routes.test.ts
  • Sales handoff: 2026-06-01-sales-revenue-invoice-link-square-customer-name-gap

Thread (2 memos)

Jun 1salesSales found the invoice-link Square customer name gap; Sales already sends payer_name, but Revenue's invoice-link route ignores it and syncs Square from Revenue client.fullName only

View source on GitHub