Skip to content

feat: structured business entity data for B2B invoicing#1605

Merged
bokelley merged 5 commits into
mainfrom
bokelley/org-party-data
Mar 25, 2026
Merged

feat: structured business entity data for B2B invoicing#1605
bokelley merged 5 commits into
mainfrom
bokelley/org-party-data

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • Add business-entity.json schema for structured B2B invoicing data (legal name, VAT ID, tax ID, registration number, address, contact, bank details)
  • Add billing_entity to accounts and sync_accounts — default invoicing details for the party responsible for payment
  • Add invoice_recipient to media buys (create, update, get responses) — per-buy override of who gets invoiced
  • Add billing: "advertiser" option — operator places orders but advertiser pays directly (social platform / DACH B2B pattern)
  • Add "advertiser" to supported_billing in get_adcp_capabilities so sellers can declare support
  • Bank details are write-only (never echoed in responses) per security review
  • Invoice recipient overrides require governance approval when governance_agents are configured
  • All free-text fields have maxLength constraints; nested objects have additionalProperties: false
  • Update MCP tool definitions (create_media_buy, update_media_buy) to include invoice_recipient

Motivated by DACH market feedback on DBCFM mapping — structured party data (VAT IDs, bank details) needed for formal B2B booking processes that currently require ext workarounds.

Test plan

  • All 501 tests pass (schema validation, examples, drift detection, unit, typecheck)
  • Schema examples validate against their own schemas
  • build:schemas succeeds
  • Pre-push Mintlify link check passes (no broken links)
  • Code review: addressed all Must Fix and Should Fix items
  • Security review: 0 Must Fix, addressed Should Fix (write-only note on account.json billing_entity)
  • Ad tech protocol review: confirmed DBCFM mapping, EU VAT directive compliance, SEPA/non-SEPA bank coverage

🤖 Generated with Claude Code

bokelley and others added 3 commits March 21, 2026 15:17
Add billing_entity to accounts and invoice_recipient to media buys,
enabling formal B2B invoicing with VAT IDs, tax IDs, addresses, contacts,
and bank details. Add billing: "advertiser" for when operator places orders
but advertiser pays directly. Bank details are write-only (never echoed in
responses). Invoice recipient overrides require governance approval.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Keep both invoice_recipient (our branch) and new_packages/status/confirmed_at/
revision/valid_actions (from main). No logic conflicts — fields are additive.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
B2B workflows often need separate billing, legal, and creative contacts.
Adds role enum (billing/legal/creative/general) on each contact.

Driven by DBCFM gap analysis — DBCFM has contacts[] with role info.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bokelley and others added 2 commits March 25, 2026 19:28
- Add invoice_recipient field to check-governance-request schema so
  governance agents can validate billing changes (was prose-only MUST)
- Add maxLength to modification_summary in check-governance-request
- Add registration_number, bank, contacts to MCP tool invoice_recipient
  schemas (was missing vs protocol schema)
- Add enum: [true] constraint on canceled fields in MCP tools
- Add account_id to sync-accounts-response schema and examples
- Strip bank details from OAuth retry URL params to prevent PII in
  browser history and access logs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…idation tests

- Fix cancellation docs to use nested object (matches schema)
- Fix contact→contacts pluralization in docs
- Add media_buy_id/package_id to all update_media_buy examples
- Add invoice_recipient/new_packages/valid_actions to update_media_buy docs
- Add invoice_recipient to get_media_buys docs
- Fix double bullet in create_media_buy usage notes
- Declare address/contacts property schemas in MCP tools
- Fix example-validation.test.cjs $ref resolution and stale example data (0/21→21/21)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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