You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"pay [UMA address]", "send to CLABE", "send to PIX", "send to IBAN", "send to UPI",
8
8
"fund sandbox account", "test a payment", "on-ramp", "off-ramp", "convert crypto to fiat",
9
9
"convert fiat to crypto", "look up UMA", "real-time quote", "JIT funding", or any payment
10
-
operations using the Grid API.
10
+
operations using the Grid API CLI.
11
11
allowed-tools:
12
12
- Bash
13
13
- Read
@@ -18,10 +18,10 @@ allowed-tools:
18
18
19
19
# Grid API Skill
20
20
21
-
You are a Grid API assistant that helps users manage global payments. You can:
21
+
Assist users with global payment operations via the Grid API. Core capabilities:
22
22
23
23
1.**Execute API Operations** - Use `curl` to interact with the Grid API directly
24
-
2.**Answer Documentation Questions** - Fetch docs from https://grid.lightspark.com or the OpenAPI spec
24
+
2.**Answer Documentation Questions** - Fetch docs from <https://grid.lightspark.com/llms.txt> or the OpenAPI spec (<https://raw.githubusercontent.com/lightsparkdev/grid-api/refs/heads/main/openapi.yaml>)
25
25
3.**Guide Payment Workflows** - Help users send payments to bank accounts, UMA addresses, and crypto wallets
-**Sandbox**: May use a different base URL — check `~/.grid-credentials` for the `baseUrl` field
82
+
-**Dev or local**: May use a different base URL — check `~/.grid-credentials` for the `baseUrl` field
83
+
84
+
### Documentation Resources
85
+
86
+
For questions not covered by this skill's reference files, fetch additional information from the web:
87
+
88
+
-**LLM-optimized docs**: Fetch `https://grid.lightspark.com/llms.txt` for a concise overview of the Grid API, or `https://grid.lightspark.com/llms-full.txt` for comprehensive documentation
89
+
-**OpenAPI Spec**: Fetch `https://raw.githubusercontent.com/lightsparkdev/grid-api/refs/heads/main/openapi.yaml` for the full API schema with request/response definitions
90
+
-**Published docs**: Browse `https://grid.lightspark.com` for guides, tutorials, and API reference. Any page can use the `.md` suffix for a more agent-readable format.
**IMPORTANT**: When specifying a destination account, you MUST also include `currency` in the destination object. This is required even though the external account already has a currency.
328
-
329
275
### Same-Currency Transfers
330
276
331
277
```bash
332
278
# Transfer in (external → internal, same currency)
-**On-Ramp (Fiat to Crypto)**: Verify KYC -> Deposit fiat -> Create crypto external account -> Quote with `immediatelyExecute`
403
+
-**Off-Ramp (Crypto to Fiat)**: Create fiat external account -> Deposit crypto -> Quote -> Execute
404
+
-**Incoming Payment Handling**: List pending approvals -> Review -> Approve/Reject
484
405
485
406
### Real-Time / Just-in-Time Funded Transfers
486
407
487
-
Use this flow when the user asks for a "realtime quote" or "just in time" funded transfer. The quote response includes `paymentInstructions` for how to fund the transfer.
408
+
Use this flow when the user asks for a "realtime quote" or "just in time" funded transfer. Only use with instant settlement methods — do not use with slow methods like ACH since quotes expire quickly.
488
409
489
-
**Key concept:** Real-time funding is about instant settlement, not currency type. Use this when funds will be provided at execution time via any instant payment method:
-**Fiat:** RTP, SEPA Instant, and other instant payment rails
493
414
494
-
**Important:** Only use real-time funding with instant settlement methods. Do not use with slow methods like ACH since quotes expire quickly.
415
+
**Flow:**
495
416
496
417
1. Create a quote with `sourceType: "REALTIME_FUNDING"`. Destination can be an internal account, external account, or UMA address.
418
+
2. The response includes `paymentInstructions` with **multiple funding options simultaneously** (e.g., Lightning + Spark for BTC, Solana + Base + Polygon for USDC). Show all options to the user.
419
+
3.**Auto-execution**: Once the user sends funds to ANY of the provided addresses, Grid automatically detects the deposit and executes at the locked rate. Do NOT call the execute endpoint for JIT quotes. Webhooks sent: `ACCOUNT_STATUS` on deposit, `OUTGOING_PAYMENT` on completion.
420
+
4.**Quote expiration**: Quotes expire in 1-5 minutes. If expired, create a new quote.
497
421
498
-
2. The response includes `paymentInstructions` with **multiple funding options simultaneously**:
499
-
- For BTC: Lightning invoice AND Spark wallet address
500
-
- For USDC: Solana wallet AND Base wallet AND Polygon wallet
501
-
- For fiat: RTP details or SEPA Instant details
502
-
503
-
The user can choose any one of these options to fund the quote.
504
-
505
-
3. Show the user ALL payment options and the exchange rate. Let them choose their preferred method.
506
-
507
-
4.**Auto-execution**: Once the user sends funds to ANY of the provided addresses, Grid automatically:
508
-
- Detects the deposit (monitors blockchain/payment rails)
509
-
- Executes the transfer at the locked exchange rate
510
-
- Credits the destination account
511
-
- Sends webhooks: `ACCOUNT_STATUS` on deposit, `OUTGOING_PAYMENT` on completion
512
-
513
-
5.**No manual execution needed** - Do NOT call the execute endpoint for JIT quotes. The transfer executes automatically when funds are received.
514
-
515
-
6.**Quote expiration**: Quotes expire in 1-5 minutes. If expired, create a new quote. Do not use slow settlement methods (ACH) with JIT funding.
516
-
517
-
## Documentation Resources
518
-
519
-
For questions not covered by this skill's reference files, fetch additional information from the web:
520
-
521
-
-**LLM-optimized docs**: Fetch `https://grid.lightspark.com/llms.txt` for a concise overview of the Grid API, or `https://grid.lightspark.com/llms-full.txt` for comprehensive documentation
522
-
-**OpenAPI Spec**: Fetch `https://raw.githubusercontent.com/lightsparkdev/webdev/main/openapi.yaml` for the full API schema with request/response definitions
523
-
-**Published docs**: Browse `https://grid.lightspark.com` for guides, tutorials, and API reference
524
-
525
-
## Best Practices
422
+
## Best Practices and Common Pitfalls
526
423
527
424
1.**Check platform config first**: Call `GET /config` to see supported currencies and required fields
528
425
2.**Use smallest currency units**: All amounts are in cents/satoshis - use `decimals` field for display
529
426
3.**Handle quote expiration**: Quotes expire in 1-5 minutes; be prepared to create new quotes
530
427
4.**Choose the right flow**: Use prefunded for immediate execution, JIT for crypto/instant rails
531
428
5.**Pipe through jq**: Always append `| jq .` for readable output, or `| jq -r .field` to extract specific values
532
429
6.**URL-encode special characters**: UMA addresses contain `$` — encode as `%24` in URL paths
533
-
534
-
## Common Mistakes to Avoid
535
-
536
-
### External Account Creation
537
-
538
-
1.**Missing individual beneficiary fields**: For `beneficiaryType: "INDIVIDUAL"`, you MUST include in the `beneficiary` object:
539
-
-`fullName`
540
-
-`birthDate` (YYYY-MM-DD)
541
-
-`nationality` (2-letter country code)
542
-
543
-
2.**Wrong field names**:
544
-
- Use `bankName` (NOT `bankCode`) for Nigerian accounts
545
-
- Use `purposeOfPayment` for Nigerian accounts (required)
1.**Missing destination currency**: When specifying a destination account, you MUST also include `currency` in the destination object. This is required even though the external account already has a currency associated with it.
430
+
7.**Always include destination currency in quotes**: When specifying a destination account, you MUST include `currency` in the destination object even though the external account already has a currency
431
+
8.**Individual beneficiary fields are all required**: For `beneficiaryType: "INDIVIDUAL"`, you MUST include `fullName`, `birthDate` (YYYY-MM-DD), and `nationality` (2-letter code) in the `beneficiary` object
432
+
9.**Use correct Nigerian field names**: Use `bankName` (NOT `bankCode`) and include `purposeOfPayment`
433
+
10.**Don't forget country-specific required fields**: Brazil (PIX) requires `pixKey`, `pixKeyType`, and `taxId`; Europe (IBAN) requires `swiftBic`
0 commit comments