-
Notifications
You must be signed in to change notification settings - Fork 5
docs: Sync documentation with new account types #283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -613,6 +613,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)** | ||||||
|
|
||||||
|
|
@@ -818,6 +960,21 @@ 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)) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The Botswana mobile numbers are 8 digits after the country code (
Suggested change
If 7-digit numbers are genuinely valid (e.g. fixed-line numbers), the Prompt To Fix With AIThis 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"); | ||||||
| if (!/^\+265\d{9}$/.test(mwkPhoneNumber)) { | ||||||
| throw new Error("Invalid Malawian phone number"); | ||||||
| } | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BWP_ACCOUNT,XAF_ACCOUNT, andAED_ACCOUNTare each defined twice inaccountTypeSpecs— once here (lines 239–266) and again later (lines 325–343). Withstrict: truein the project's TypeScript config, the compiler will reject duplicate object literal keys. Even if it compiled, only the second definition would take effect at runtime, silently discarding the first.Delete lines 239–266 entirely and keep only the later definitions. Also note that the surviving
BWP_ACCOUNTat line 325 usesprovider: 'Orange'(mixed-case) while every other provider constant ('ORANGE','MTN','AIRTEL') usesSCREAMING_SNAKE_CASE— if the API is case-sensitive, that mismatch will cause failures.Prompt To Fix With AI