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
29 changes: 29 additions & 0 deletions components/grid-visualizer/src/data/account-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,39 @@ export const accountTypeSpecs: Record<string, AccountTypeSpec> = {
fields: [
{ name: 'phoneNumber', example: '+221771234567' },
{ name: 'provider', example: 'ORANGE', description: 'Mobile money provider' },
{ name: 'region', example: 'SN', description: 'Country code: BJ, CI, SN, or TG' },
],
paymentRails: ['MOBILE_MONEY'],
beneficiaryRequired: true,
},
BWP_ACCOUNT: {
accountType: 'BWP_ACCOUNT',
fields: [
{ name: 'phoneNumber', example: '+26771234567' },
{ name: 'provider', example: 'ORANGE', description: 'Mobile money provider' },
],
paymentRails: ['MOBILE_MONEY'],
beneficiaryRequired: true,
},
XAF_ACCOUNT: {
accountType: 'XAF_ACCOUNT',
fields: [
{ name: 'phoneNumber', example: '+237671234567' },
{ name: 'provider', example: 'MTN', description: 'Mobile money provider' },
{ name: 'region', example: 'CM', description: 'Country code: CM or CG' },
],
paymentRails: ['MOBILE_MONEY'],
beneficiaryRequired: true,
},
AED_ACCOUNT: {
accountType: 'AED_ACCOUNT',
fields: [
{ name: 'iban', example: 'AE070331234567890123456' },
{ name: 'swiftCode', example: 'EBILAEAD', description: 'Optional' },
],
paymentRails: ['BANK_TRANSFER'],
beneficiaryRequired: true,
},
SPARK_WALLET: {
accountType: 'SPARK_WALLET',
fields: [
Expand Down
30 changes: 30 additions & 0 deletions components/grid-visualizer/src/data/currencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,34 @@ export const currencies: FiatCurrency[] = [
allRails: ['Mobile Money'],
examplePerson: { fullName: 'Amadou Diallo', nationality: 'SN' },
},
{
code: 'BWP',
name: 'Botswana Pula',
countryCode: 'bw',
accountType: 'BWP_ACCOUNT',
accountLabel: 'Mobile Money',
instantRails: [],
allRails: ['Mobile Money'],
examplePerson: { fullName: 'Kelebogile Mosweu', nationality: 'BW' },
},
{
code: 'XAF',
name: 'Central African CFA Franc',
countryCode: 'cm',
accountType: 'XAF_ACCOUNT',
accountLabel: 'Mobile Money',
instantRails: [],
allRails: ['Mobile Money'],
examplePerson: { fullName: 'Jean-Pierre Mballa', nationality: 'CM' },
},
{
code: 'AED',
name: 'UAE Dirham',
countryCode: 'ae',
accountType: 'AED_ACCOUNT',
accountLabel: 'UAE Bank Account',
instantRails: [],
allRails: ['Bank Transfer'],
examplePerson: { fullName: 'Ahmed Al-Maktoum', nationality: 'AE' },
},
];
158 changes: 158 additions & 0 deletions mintlify/snippets/external-accounts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,148 @@ curl -X POST 'https://api.lightspark.com/grid/2025-10-13/customers/external-acco
</Note>
</Tab>

<Tab title="West Africa (XOF)">
**XOF Mobile Money**

```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": "XOF",
"platformAccountId": "xof_mobile_001",
"accountInfo": {
"accountType": "XOF_ACCOUNT",
"phoneNumber": "+221771234567",
"provider": "ORANGE",
"region": "SN",
"beneficiary": {
"beneficiaryType": "INDIVIDUAL",
"fullName": "Amadou Diallo",
"birthDate": "1990-03-15",
"nationality": "SN",
"address": {
"line1": "Avenue Cheikh Anta Diop",
"city": "Dakar",
"postalCode": "10000",
"country": "SN"
}
}
}
}'
```

<Note>
Region is required: `BJ` (Benin), `CI` (Ivory Coast), `SN` (Senegal), or `TG` (Togo).
</Note>
</Tab>

<Tab title="Central Africa (XAF)">
**XAF Mobile Money**

```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": "XAF",
"platformAccountId": "xaf_mobile_001",
"accountInfo": {
"accountType": "XAF_ACCOUNT",
"phoneNumber": "+237671234567",
"provider": "MTN",
"region": "CM",
"beneficiary": {
"beneficiaryType": "INDIVIDUAL",
"fullName": "Jean-Pierre Mballa",
"birthDate": "1988-07-22",
"nationality": "CM",
"address": {
"line1": "Boulevard du 20 Mai",
"city": "Yaoundé",
"postalCode": "00237",
"country": "CM"
}
}
}
}'
```

<Note>
Region is required: `CM` (Cameroon) or `CG` (Congo).
</Note>
</Tab>

<Tab title="Botswana">
**BWP Mobile Money**

```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": "BWP",
"platformAccountId": "bwp_mobile_001",
"accountInfo": {
"accountType": "BWP_ACCOUNT",
"phoneNumber": "+26771234567",
"provider": "ORANGE",
"beneficiary": {
"beneficiaryType": "INDIVIDUAL",
"fullName": "Kelebogile Mosweu",
"birthDate": "1992-05-10",
"nationality": "BW",
"address": {
"line1": "Plot 123 Main Mall",
"city": "Gaborone",
"postalCode": "00000",
"country": "BW"
}
}
}
}'
```

<Note>
Phone number must be in format `+267XXXXXXXX`.
</Note>
</Tab>

<Tab title="UAE">
**AED 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": "AED",
"platformAccountId": "aed_bank_001",
"accountInfo": {
"accountType": "AED_ACCOUNT",
"iban": "AE070331234567890123456",
"swiftCode": "EBILAEAD",
"beneficiary": {
"beneficiaryType": "INDIVIDUAL",
"fullName": "Ahmed Al-Maktoum",
"birthDate": "1985-11-30",
"nationality": "AE",
"address": {
"line1": "Sheikh Zayed Road",
"city": "Dubai",
"postalCode": "00000",
"country": "AE"
}
}
}
}'
```

<Note>
UAE IBAN must be 23 characters starting with `AE`. SWIFT/BIC code is optional.
</Note>
</Tab>

<Tab title="Cryptocurrency">
**Bitcoin Lightning (Spark Wallet)**

Expand Down Expand Up @@ -605,6 +747,22 @@ if (!/^\+260\d{9}$/.test(zmwPhoneNumber)) {
if (!/^\+250\d{9}$/.test(rwfPhoneNumber)) {
throw new Error("Invalid Rwandan phone number");
}
if (!/^\+267\d{7,8}$/.test(bwpPhoneNumber)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

P2 Botswana phone number format inconsistency between Note and regex

The Note for the Botswana tab states the format is +267XXXXXXXX (implying exactly 8 digits after the country code), but the validation regex on line 750 is \+267\d{7,8} — which allows 7 or 8 digits. These two pieces of documentation contradict each other, which could confuse developers about the actual accepted format.

Botswana mobile numbers are 8 digits after the country code (+267), so the regex should be tightened to match the Note, or the Note should be updated to reflect both lengths:

Suggested change
if (!/^\+267\d{7,8}$/.test(bwpPhoneNumber)) {
if (!/^\+267\d{8}$/.test(bwpPhoneNumber)) {

If 7-digit numbers are genuinely valid (e.g. fixed-line numbers), the Note should be updated to reflect that:

Phone number must be in format `+267XXXXXXX` (7 digits) or `+267XXXXXXXX` (8 digits).
Prompt To Fix With AI
This is a comment left during a code review.
Path: mintlify/snippets/external-accounts.mdx
Line: 750

Comment:
**Botswana phone number format inconsistency between Note and regex**

The `Note` for the Botswana tab states the format is `+267XXXXXXXX` (implying exactly 8 digits after the country code), but the validation regex on line 750 is `\+267\d{7,8}` — which allows **7 or 8** digits. These two pieces of documentation contradict each other, which could confuse developers about the actual accepted format.

Botswana mobile numbers are 8 digits after the country code (`+267`), so the regex should be tightened to match the `Note`, or the `Note` should be updated to reflect both lengths:

```suggestion
if (!/^\+267\d{8}$/.test(bwpPhoneNumber)) {
```

If 7-digit numbers are genuinely valid (e.g. fixed-line numbers), the `Note` should be updated to reflect that:

```
Phone number must be in format `+267XXXXXXX` (7 digits) or `+267XXXXXXXX` (8 digits).
```

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

throw new Error("Invalid Botswana phone number");
}

// XOF/XAF region codes
if (!['BJ', 'CI', 'SN', 'TG'].includes(xofRegion)) {
throw new Error("Invalid XOF region code");
}
if (!['CM', 'CG'].includes(xafRegion)) {
throw new Error("Invalid XAF region code");
}

// UAE IBAN: 23 characters starting with AE
if (!/^AE\d{21}$/.test(aedIban)) {
throw new Error("Invalid UAE IBAN");
}
```

</Accordion>
Expand Down
Loading