Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions components/grid-visualizer/src/data/account-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ export const accountTypeSpecs: Record<string, AccountTypeSpec> = {
INR_ACCOUNT: {
accountType: 'INR_ACCOUNT',
fields: [
{ name: 'vpa', example: 'customer@okbank' },
{ name: 'vpa', example: 'customer@okbank', description: 'For UPI' },
{ name: 'accountNumber', example: '000111222333', description: 'For NEFT/RTGS' },
{ name: 'ifsc', example: 'HDFC0001234', description: 'For NEFT/RTGS' },
{ name: 'rail', example: 'NEFT', description: 'NEFT or RTGS' },
{ name: 'bankName', example: 'HDFC Bank', description: 'Optional' },
],
beneficiaryRequired: true,
},
Comment on lines 54 to 64

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Missing required paymentRails field for INR_ACCOUNT

code-generator.ts's buildAccountInfoBody populates the request body exclusively by iterating over spec.fields (line 47–49). The OpenAPI schema (InrAccountInfo) marks paymentRails as a required field, but there is no paymentRails entry in the fields array here. Every INR account creation call emitted by the Grid Visualizer will therefore be missing that field and fail API validation. A { name: 'paymentRails', example: '["NEFT"]' } entry (or equivalent special-casing in the code generator) is needed to produce a valid request body.

Prompt To Fix With AI
This is a comment left during a code review.
Path: components/grid-visualizer/src/data/account-types.ts
Line: 54-64

Comment:
**Missing required `paymentRails` field for INR_ACCOUNT**

`code-generator.ts`'s `buildAccountInfoBody` populates the request body exclusively by iterating over `spec.fields` (line 47–49). The OpenAPI schema (`InrAccountInfo`) marks `paymentRails` as a **required** field, but there is no `paymentRails` entry in the fields array here. Every INR account creation call emitted by the Grid Visualizer will therefore be missing that field and fail API validation. A `{ name: 'paymentRails', example: '["NEFT"]' }` entry (or equivalent special-casing in the code generator) is needed to produce a valid request body.

How can I resolve this? If you propose a fix, please make it concise.

Expand Down Expand Up @@ -328,7 +332,8 @@ export const accountTypeSpecs: Record<string, AccountTypeSpec> = {
accountType: 'GTQ_ACCOUNT',
fields: [
{ name: 'accountNumber', example: '1234567890' },
{ name: 'phoneNumber', example: '+50212345678' },
{ name: 'bankAccountType', example: 'CHECKING', description: 'CHECKING or SAVINGS' },
{ name: 'bankName', example: 'Example Bank' },
],
beneficiaryRequired: true,
},
Expand All @@ -345,6 +350,7 @@ export const accountTypeSpecs: Record<string, AccountTypeSpec> = {
{ name: 'accountNumber', example: '1234567890' },
{ name: 'branchCode', example: '12345', description: '5-digit branch code' },
{ name: 'bankAccountType', example: 'CHECKING', description: 'CHECKING or SAVINGS' },
{ name: 'bankName', example: 'Example Bank' },
],
beneficiaryRequired: true,
},
Expand Down
4 changes: 2 additions & 2 deletions components/grid-visualizer/src/data/currencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ export const currencies: FiatCurrency[] = [
name: 'Indian Rupee',
countryCode: 'in',
accountType: 'INR_ACCOUNT',
accountLabel: 'UPI',
accountLabel: 'UPI / Bank Account',
instantRails: ['UPI'],
allRails: ['UPI'],
allRails: ['UPI', 'NEFT', 'RTGS'],
examplePerson: { fullName: 'Priya Sharma', nationality: 'IN' },
},
{
Expand Down
2 changes: 1 addition & 1 deletion mintlify/snippets/country-support.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { FeatureCard, FeatureCardGrid, FeatureCardList, FeatureCardContainer } f
| 🇭🇹 Haiti | HT | `Bank Transfer` |
| 🇭🇺 Hungary | HU | `SEPA` `SEPA Instant` |
| 🇮🇸 Iceland | IS | `SEPA` `SEPA Instant` |
| 🇮🇳 India | IN | `UPI` |
| 🇮🇳 India | IN | `UPI` `NEFT` `RTGS` |
| 🇮🇩 Indonesia | ID | `Bank Transfer` |
| 🇮🇪 Ireland | IE | `SEPA` `SEPA Instant` |
| 🇮🇹 Italy | IT | `SEPA` `SEPA Instant` |
Expand Down
43 changes: 42 additions & 1 deletion mintlify/snippets/external-accounts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,11 @@ curl -X POST 'https://api.lightspark.com/grid/2025-10-13/customers/external-acco
</Tab>

<Tab title="India">
**UPI**
**UPI, NEFT, or RTGS**

India supports three payment rails: UPI (instant), NEFT (near-real-time), and RTGS (real-time for large transfers).

**UPI:**

```bash cURL
curl -X POST 'https://api.lightspark.com/grid/2025-10-13/customers/external-accounts' \
Expand All @@ -413,6 +417,40 @@ curl -X POST 'https://api.lightspark.com/grid/2025-10-13/customers/external-acco
"accountInfo": {
"accountType": "INR_ACCOUNT",
"vpa": "user@okbank",
"paymentRails": ["UPI"],
"beneficiary": {
"beneficiaryType": "INDIVIDUAL",
"fullName": "Priya Sharma",
"birthDate": "1991-05-14",
"nationality": "IN",
"address": {
"line1": "123 MG Road",
"city": "Mumbai",
"state": "Maharashtra",
"postalCode": "400001",
"country": "IN"
}
}
}
}'
```

**NEFT/RTGS (Bank Transfer):**

```bash cURL
curl -X POST 'https://api.lightspark.com/grid/2025-10-13/customers/external-accounts' \
-H 'Authorization: Basic $GRID_CLIENT_ID:$GRID_CLIENT_SECRET' \
-H 'Content-Type: application/json' \
-d '{
"currency": "INR",
"platformAccountId": "in_neft_001",
"accountInfo": {
"accountType": "INR_ACCOUNT",
"accountNumber": "000111222333",
"ifsc": "HDFC0001234",
"rail": "NEFT",
"bankName": "HDFC Bank",
"paymentRails": ["NEFT"],
"beneficiary": {
"beneficiaryType": "INDIVIDUAL",
"fullName": "Priya Sharma",
Expand All @@ -430,6 +468,9 @@ curl -X POST 'https://api.lightspark.com/grid/2025-10-13/customers/external-acco
}'
```

<Note>
UPI requires `vpa` (Virtual Payment Address). NEFT/RTGS requires `accountNumber` (9-18 digits), `ifsc` (11-character bank branch code), and `rail` (NEFT or RTGS).
</Note>
</Tab>

<Tab title="Nigeria">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,14 @@ private fun buildAccountInfo(accountType: String, accountInfo: JsonNode): Extern
"INR_ACCOUNT" -> {
val info = InrExternalAccountCreateInfo.builder()
.accountType(InrExternalAccountCreateInfo.AccountType.INR_ACCOUNT)
.vpa(accountInfo.requireText("vpa"))
.beneficiary(buildInrBeneficiary(beneficiaryNode))
.apply {
accountInfo.optText("vpa")?.let { vpa(it) }
accountInfo.optText("accountNumber")?.let { accountNumber(it) }
accountInfo.optText("ifsc")?.let { ifsc(it) }
accountInfo.optText("rail")?.let { rail(it) }
accountInfo.optText("bankName")?.let { bankName(it) }
}
.build()
ExternalAccountCreate.AccountInfo.ofInrAccount(info)
}
Comment on lines 116 to 129

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 paymentRails never forwarded to the INR account builder

The OpenAPI schema (InrAccountInfo) requires paymentRails (an array like ["NEFT"] or ["UPI"]). The apply block maps all five INR account-info fields, but never reads or sets paymentRails. Any INR account creation request routed through this sample will omit the required field and receive a validation error from the API. Both the UPI and NEFT/RTGS documentation examples explicitly include "paymentRails", so the Kotlin path should read it from the incoming request body (e.g., accountInfo.optList("paymentRails")) and call the corresponding builder method.

Prompt To Fix With AI
This is a comment left during a code review.
Path: samples/kotlin/src/main/kotlin/com/grid/sample/routes/ExternalAccounts.kt
Line: 116-129

Comment:
**`paymentRails` never forwarded to the INR account builder**

The OpenAPI schema (`InrAccountInfo`) requires `paymentRails` (an array like `["NEFT"]` or `["UPI"]`). The `apply` block maps all five INR account-info fields, but never reads or sets `paymentRails`. Any INR account creation request routed through this sample will omit the required field and receive a validation error from the API. Both the UPI and NEFT/RTGS documentation examples explicitly include `"paymentRails"`, so the Kotlin path should read it from the incoming request body (e.g., `accountInfo.optList("paymentRails")`) and call the corresponding builder method.

How can I resolve this? If you propose a fix, please make it concise.

Expand Down
Loading