From 4019a29ae1235850b614bd81d3e20b5c2abe42f4 Mon Sep 17 00:00:00 2001 From: peng Date: Tue, 16 Jun 2026 15:27:15 -0700 Subject: [PATCH] fix(samples/kotlin): send customer email for USDB embedded wallets 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) --- samples/frontend/src/steps/CreateCustomer.tsx | 3 +++ .../kotlin/src/main/kotlin/com/grid/sample/routes/Customers.kt | 1 + 2 files changed, 4 insertions(+) diff --git a/samples/frontend/src/steps/CreateCustomer.tsx b/samples/frontend/src/steps/CreateCustomer.tsx index cc7f79c52..5098205e1 100644 --- a/samples/frontend/src/steps/CreateCustomer.tsx +++ b/samples/frontend/src/steps/CreateCustomer.tsx @@ -7,6 +7,9 @@ const DEFAULT_BODY = JSON.stringify({ platformCustomerId: `cust_${Math.random().toString(36).slice(2, 10)}`, customerType: "INDIVIDUAL", fullName: "Jack Doe", + // Must be a real, deliverable address (the API validates the domain's MX records). + // Required when the platform supports USDB embedded wallets. + email: `jack.doe+${Math.random().toString(36).slice(2, 10)}@gmail.com`, birthDate: "1992-03-25", address: { line1: "123 Pine Street", diff --git a/samples/kotlin/src/main/kotlin/com/grid/sample/routes/Customers.kt b/samples/kotlin/src/main/kotlin/com/grid/sample/routes/Customers.kt index c5292b752..6e55142a4 100644 --- a/samples/kotlin/src/main/kotlin/com/grid/sample/routes/Customers.kt +++ b/samples/kotlin/src/main/kotlin/com/grid/sample/routes/Customers.kt @@ -29,6 +29,7 @@ fun Route.customerRoutes() { .apply { json.optText("platformCustomerId")?.let { platformCustomerId(it) } json.optText("fullName")?.let { fullName(it) } + json.optText("email")?.let { email(it) } json.optText("nationality")?.let { nationality(it) } json.optText("birthDate")?.let { birthDate(LocalDate.parse(it)) } json.get("address")?.takeIf { !it.isNull }?.let { addrNode ->