Skip to content

fix(samples/kotlin): send customer email for USDB embedded wallets#590

Merged
pengying merged 1 commit into
mainfrom
06-16-fix_samples_kotlin_send_customer_email_for_usdb_embedded_wallets
Jun 26, 2026
Merged

fix(samples/kotlin): send customer email for USDB embedded wallets#590
pengying merged 1 commit into
mainfrom
06-16-fix_samples_kotlin_send_customer_email_for_usdb_embedded_wallets

Conversation

@pengying

Copy link
Copy Markdown
Contributor

The platform requires a customer email when it supports USDB embedded
wallets. Wire email through the customer create builder and add it to
the sample's default request body. The Grid API validates domain
deliverability, so the default uses a real domain (gmail.com).

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Jun 26, 2026 12:17am
grid-wallet-demo Ignored Ignored Preview Jun 26, 2026 12:17am

Request Review

@greptile-apps

greptile-apps Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR wires an email field through the customer creation flow for platforms that support USDB embedded wallets, which require the Grid API to validate domain deliverability via MX records.

  • Frontend sample (CreateCustomer.tsx): adds an email field with a random suffix to the default JSON body, mirroring the existing platformCustomerId pattern, and includes a comment explaining the MX-validation requirement.
  • Kotlin backend sample (Customers.kt): routes the email key from the incoming JSON body into CreateCustomerRequest.Individual.Builder, following the same optional-field pattern already used for fullName, nationality, and birthDate.

Confidence Score: 5/5

Safe to merge — both changes are additive, follow established patterns, and touch only sample code.

Both files make small, additive changes: the frontend adds an email field to the editable default JSON (mirroring the existing platformCustomerId random-suffix pattern), and the Kotlin route threads the email value into the builder exactly as other optional fields are handled. No logic is altered, no required fields are removed, and the gmail.com domain reliably passes MX validation.

No files require special attention.

Important Files Changed

Filename Overview
samples/frontend/src/steps/CreateCustomer.tsx Adds email with random suffix to DEFAULT_BODY, consistent with existing platformCustomerId pattern; comment correctly explains MX-validation requirement.
samples/kotlin/src/main/kotlin/com/grid/sample/routes/Customers.kt Wires email from JSON body into the Individual builder using the same optional-field pattern as fullName, nationality, and birthDate.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant FE as Frontend Sample (CreateCustomer.tsx)
    participant KT as Kotlin Sample (Customers.kt)
    participant Grid as Grid API

    FE->>KT: "POST /api/customers { platformCustomerId, fullName, email, ... }"
    KT->>KT: Parse JSON body
    KT->>KT: Build Individual with platformCustomerId, fullName, email (NEW), nationality, birthDate, address
    KT->>Grid: customers.create(params)
    Note over Grid: Validates email domain MX records (required for USDB wallets)
    Grid-->>KT: Customer response
    KT-->>FE: 201 Created (JSON)
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant FE as Frontend Sample (CreateCustomer.tsx)
    participant KT as Kotlin Sample (Customers.kt)
    participant Grid as Grid API

    FE->>KT: "POST /api/customers { platformCustomerId, fullName, email, ... }"
    KT->>KT: Parse JSON body
    KT->>KT: Build Individual with platformCustomerId, fullName, email (NEW), nationality, birthDate, address
    KT->>Grid: customers.create(params)
    Note over Grid: Validates email domain MX records (required for USDB wallets)
    Grid-->>KT: Customer response
    KT-->>FE: 201 Created (JSON)
Loading

Reviews (3): Last reviewed commit: "fix(samples/kotlin): send customer email..." | Re-trigger Greptile

jklein24
jklein24 previously approved these changes Jun 17, 2026
@pengying pengying force-pushed the 06-16-feat_samples_kotlin_support_grid_api_base_url_override branch from cc1024a to f206e35 Compare June 18, 2026 18:13
@pengying pengying force-pushed the 06-16-fix_samples_kotlin_send_customer_email_for_usdb_embedded_wallets branch from a565834 to 4019a29 Compare June 18, 2026 18:13

@restamp-bot restamp-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4019a29 is a pure rebase onto f206e35. Approving based on @jklein24's previous approval of a565834.

restamp-bot[bot]
restamp-bot Bot previously approved these changes Jun 18, 2026

@restamp-bot restamp-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4019a29 is a pure rebase onto f206e35. Approving based on @jklein24's previous approval of a565834.

shreyav
shreyav previously approved these changes Jun 26, 2026

pengying commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Jun 26, 12:16 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 26, 12:18 AM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 26, 12:18 AM UTC: @pengying merged this pull request with Graphite.

@pengying pengying changed the base branch from 06-16-feat_samples_kotlin_support_grid_api_base_url_override to graphite-base/590 June 26, 2026 00:16
@pengying pengying changed the base branch from graphite-base/590 to main June 26, 2026 00:16
@pengying pengying dismissed stale reviews from shreyav, restamp-bot[bot], and jklein24 June 26, 2026 00:16

The base branch was changed.

The platform requires a customer email when it supports USDB embedded
wallets. Wire `email` through the customer create builder and add it to
the sample's default request body. The Grid API validates domain
deliverability, so the default uses a real domain (gmail.com).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pengying pengying force-pushed the 06-16-fix_samples_kotlin_send_customer_email_for_usdb_embedded_wallets branch from 4019a29 to 64ed903 Compare June 26, 2026 00:17

@restamp-bot restamp-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

64ed903 is a pure rebase onto 2e9f36b. Approving based on @shreyav's previous approval of 4019a29.

@pengying pengying merged commit dd024a1 into main Jun 26, 2026
10 checks passed
@pengying pengying deleted the 06-16-fix_samples_kotlin_send_customer_email_for_usdb_embedded_wallets branch June 26, 2026 00:18
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.

3 participants