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: 10 additions & 0 deletions components/grid-visualizer/src/data/account-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,16 @@ export const accountTypeSpecs: Record<string, AccountTypeSpec> = {
],
beneficiaryRequired: false,
},
SWIFT_ACCOUNT: {
accountType: 'SWIFT_ACCOUNT',
fields: [
{ name: 'swiftCode', example: 'DEUTDEFF' },
{ name: 'bankName', example: 'Deutsche Bank' },
{ name: 'country', example: 'NG', description: 'ISO 3166-1 alpha-2 code' },
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 Country example contradicts the SWIFT code example

The swiftCode example is 'DEUTDEFF', which is Deutsche Bank Frankfurt — a German bank (ISO country code DE). The country example, however, is 'NG' (Nigeria). A user copying from the Grid Visualizer would produce a request where the bank country and the SWIFT code point to different countries, which will likely be rejected by the API. The documentation in account-model.mdx correctly uses 'DE'; the visualizer should match.

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

Comment:
**Country example contradicts the SWIFT code example**

The `swiftCode` example is `'DEUTDEFF'`, which is Deutsche Bank Frankfurt — a German bank (ISO country code `DE`). The `country` example, however, is `'NG'` (Nigeria). A user copying from the Grid Visualizer would produce a request where the bank country and the SWIFT code point to different countries, which will likely be rejected by the API. The documentation in `account-model.mdx` correctly uses `'DE'`; the visualizer should match.

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

Fix in Claude Code

{ name: 'accountNumber', example: '1234567890', description: 'Or use iban for IBAN-only corridors' },
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.

P2 The iban field is only mentioned in the accountNumber description text, so the Grid Visualizer has no way to generate IBAN-based SWIFT account creation requests. Since external-accounts.mdx provides a full IBAN curl example as a first-class alternative, the visualizer should expose iban as a field too. Without it, users in IBAN-only corridors (e.g., GB, BR) cannot use the visualizer to prototype their integration.

Suggested change
{ name: 'accountNumber', example: '1234567890', description: 'Or use iban for IBAN-only corridors' },
{ name: 'accountNumber', example: '1234567890', description: 'Use for most corridors; mutually exclusive with iban' },
{ name: 'iban', example: 'GB29NWBK60161331926819', description: 'Use instead of accountNumber for IBAN-only corridors (e.g. GB, BR)' },
Prompt To Fix With AI
This is a comment left during a code review.
Path: components/grid-visualizer/src/data/account-types.ts
Line: 269

Comment:
The `iban` field is only mentioned in the `accountNumber` description text, so the Grid Visualizer has no way to generate IBAN-based SWIFT account creation requests. Since `external-accounts.mdx` provides a full IBAN curl example as a first-class alternative, the visualizer should expose `iban` as a field too. Without it, users in IBAN-only corridors (e.g., GB, BR) cannot use the visualizer to prototype their integration.

```suggestion
      { name: 'accountNumber', example: '1234567890', description: 'Use for most corridors; mutually exclusive with iban' },
      { name: 'iban', example: 'GB29NWBK60161331926819', description: 'Use instead of accountNumber for IBAN-only corridors (e.g. GB, BR)' },
```

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

Fix in Claude Code

],
beneficiaryRequired: true,
},
AED_ACCOUNT: {
accountType: 'AED_ACCOUNT',
fields: [
Expand Down
16 changes: 16 additions & 0 deletions mintlify/platform-overview/core-concepts/account-model.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,22 @@ Grid uses two types of accounts: **internal accounts** (Grid-managed balances) a
}
```
</Tab>

<Tab title="SWIFT (International Wire)">
```json
{
"accountType": "SWIFT_ACCOUNT",
"swiftCode": "DEUTDEFF",
"bankName": "Deutsche Bank",
"country": "DE",
"accountNumber": "1234567890",
"beneficiary": {
"beneficiaryType": "INDIVIDUAL",
"fullName": "Hans Schmidt"
}
}
```
</Tab>
</Tabs>

### Creating External Accounts
Expand Down
72 changes: 72 additions & 0 deletions mintlify/snippets/external-accounts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,78 @@ curl -X POST 'https://api.lightspark.com/grid/2025-10-13/customers/external-acco

</Tab>

<Tab title="SWIFT">
**International Wire Transfer**

SWIFT accounts support international wire transfers to any country via SWIFT/BIC network.

```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": "USD",
"platformAccountId": "swift_wire_001",
"accountInfo": {
"accountType": "SWIFT_ACCOUNT",
"swiftCode": "DEUTDEFF",
"bankName": "Deutsche Bank",
"country": "DE",
"accountNumber": "1234567890",
"beneficiary": {
"beneficiaryType": "INDIVIDUAL",
"fullName": "Hans Schmidt",
"birthDate": "1982-11-08",
"nationality": "DE",
"address": {
"line1": "Hauptstraße 789",
"city": "Berlin",
"postalCode": "10115",
"country": "DE"
}
}
}
}'
```

**Using IBAN instead of account number:**

For IBAN-only corridors (e.g., Brazil, UK), use `iban` instead of `accountNumber`:

```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": "GBP",
"platformAccountId": "swift_iban_001",
"accountInfo": {
"accountType": "SWIFT_ACCOUNT",
"swiftCode": "NWBKGB2L",
"bankName": "NatWest Bank",
"country": "GB",
"iban": "GB29NWBK60161331926819",
"beneficiary": {
"beneficiaryType": "INDIVIDUAL",
"fullName": "James Wilson",
"birthDate": "1985-09-03",
"nationality": "GB",
"address": {
"line1": "10 Downing Street",
"city": "London",
"postalCode": "SW1A 2AA",
"country": "GB"
}
}
}
}'
```

<Note>
SWIFT code (BIC) must be 8 or 11 characters. Use `accountNumber` for most corridors; use `iban` for IBAN-only corridors (BR, GB). The `country` field is the ISO 3166-1 alpha-2 code of the bank.
</Note>
</Tab>

<Tab title="Philippines">
**PHP Bank Transfer**

Expand Down
Loading