Skip to content

feat!: rename receiver_id/customer field wire keys for the post-#1799 customers cutover - #40

Open
ericviana wants to merge 1 commit into
mainfrom
eric/customers-wave-2
Open

feat!: rename receiver_id/customer field wire keys for the post-#1799 customers cutover#40
ericviana wants to merge 1 commit into
mainfrom
eric/customers-wave-2

Conversation

@ericviana

Copy link
Copy Markdown
Member

What breaks

This wave finishes the receivers -> customers sunset. Wave 1 (already shipped, v3.0.0/v3.1.0) removed the deprecated receivers resource and aligned the SDK's wire fields with what production serves today. This PR goes one step further and aligns with the API as it will be after blindpay-v2 #1799 reaches production: the remaining receiver_* wire fields become customer_*, and the deprecated receiver webhook events stop firing entirely.

Because production today still sends receiver_id etc. on these responses, this PR is a breaking change against the live API and must not merge before the cutover.

Migration table

Field Old (today) New (post-#1799) Where
Customer reference receiver_id customer_id Payin, Payout, Transfer, PayinQuote, CreatePayinResponse, CreatePayoutResponse, InitiateTosInput, CustomerOwner (owners[])
Payout/quote local amount receiver_local_amount customer_local_amount Payout, Quote (CreateQuoteResponse), PayinQuote
Transfer wallet address receiver_wallet_address customer_wallet_address Transfer, CreateTransferQuoteInput
Transfer token receiver_token customer_token Transfer, CreateTransferQuoteInput
Transfer network receiver_network customer_network Transfer, CreateTransferQuoteInput
Instance invite redirect receiver_invite_redirect_url customer_invite_redirect_url UpdateInstanceInput
Webhook events receiver.new / receiver.update / receiver.delete (removed, stop firing) WebhookEvent enum; ReceiverDeleteWebhookOut deleted
CustomerOwner.customerId dual decode: customer_id or receiver_id (wave 1 transitional shim) customer_id only, still optional (not required in the target spec's owners[] item schema) Customer.swift
ApiKeys resource present removed entirely (API Keys isn't in the public reference, so it doesn't belong in the SDK) ApiKey.swift, ApiKeysService.swift deleted

receiver_rfi_emails_enabled, receivers_amount, and the RFI-scoped receiver_type / receiver_kyc_status / receiver_aiprise_* fields are part of the same changelog but aren't modeled by this SDK today (no RFI or instance-settings-with-those-fields surface exists here), so there's nothing to rename for them.

Intentionally unchanged

  • receiver_amount (singular) keeps its name everywhere -- it's the receiving-side amount on quotes, payins, payouts and transfers, and the target spec confirms it's the only receiver_* key still present anywhere.
  • CurrencyType keeps .sender / .receiver raw values (currency_type field).
  • The re_ prefix on stored ID values is untouched -- this PR renames wire keys, not the format of the IDs those keys carry (see doc examples still using re_123).

Why held

These are breaking changes against the API deployed today (confirmed by diffing this repo's target snapshot against blindpay-v2's live apps/api/openapi.json -- today's spec still serves receiver_id/receiver_local_amount/etc. on every one of the schemas this PR touches). They only become correct once blindpay-v2 #1799 reaches production. Labeled hold-until-1799-deploy; do not merge until a production probe confirms the cutover.

Contract check

Added .api-sync/check-contract.swift, a dependency-free (Foundation-only) script wired into new .github/workflows/ci.yml:

  • Direction A (hard fail): every wire key the SDK declares (CodingKeys string values, params["..."] query literals) must exist as a property or parameter name somewhere in the committed .api-sync/spec-snapshot.json, unless allow-listed.
  • Direction B (hard fail): mapped SDK enums (WebhookEvent, CurrencyType) must cover every enum member the spec declares for them.

Run locally: swift .api-sync/check-contract.swift.

Seeded .api-sync/allow-list.json with 15 genuine pre-existing divergences that predate this wave and aren't part of the customers rename (verified against both today's and the target spec -- none of these are documented in either): PartnerFee/CreatePartnerFeeInput/CreatePartnerFeeResponse.{evm,stellar}_wallet_address, tracking_partner_fee on Payin/Payout/Transfer/CreatePayinResponse/CreatePayoutResponse, billing_fee on Payin/PayinQuote/CreatePayinResponse, and AuthorizeSolanaResponse.serialized_transaction.

Verified it actually catches the bug class it targets: reverted one customer_id rename back to receiver_id locally and confirmed the check fails with a precise message, then restored it.

Versioning

Versioning here is git-tag-based (no in-repo version constant). This release will be v4.0.0 on merge -- breaking change, next major.

https://claude.ai/code/session_01F1stiNzuNtJXoXtiW9ZCbs

@ericviana ericviana added the hold-until-1799-deploy Do not merge until blindpay-v2 #1799 reaches production label Jul 27, 2026
@BernardoSM

BernardoSM commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

…re contract check

Wave-2 breaking release (v4.0.0 on tag): the remaining receiver_* field renames, removal of
the receiver.* webhook events and legacy surface, and a mechanical contract-check in CI
that validates every SDK-declared wire key and the webhook enum against the committed
public spec snapshot (.api-sync/spec-snapshot.json).

Held until blindpay-v2 #1799 reaches production; the branch history was rebuilt as this
single commit so the snapshot only ever contains the public filtered spec.

Claude-Session: https://claude.ai/code/session_01F1stiNzuNtJXoXtiW9ZCbs
@ericviana
ericviana force-pushed the eric/customers-wave-2 branch from c3b1584 to ccbb1eb Compare July 27, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold-until-1799-deploy Do not merge until blindpay-v2 #1799 reaches production

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants