Skip to content

Commit 008bf83

Browse files
authored
Add SDKs & CLI documentation page (#305)
## Summary - Adds an **SDKs & CLI** page to the API Reference tab linking to the [Kotlin SDK](https://github.com/lightsparkdev/grid-kotlin-sdk) and [JS/TS SDK](https://github.com/lightsparkdev/grid-js-sdk), plus CLI documentation with command reference and an end-to-end example - Creates reusable snippets (`snippets/sdks.mdx`, `snippets/cli.mdx`) so the content can be included on any page - Fixes a mermaid diagram parse error in README.md (`opt` → `alt` to support `else`) ## Test plan - [ ] Run `make lint` and confirm no new warnings - [ ] Run `mint dev` and verify the SDKs & CLI page renders under API Reference - [ ] Confirm SDK cards link to the correct GitHub repos - [ ] Confirm CLI example code blocks render correctly (no blank boxes) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 56fabb7 commit 008bf83

6 files changed

Lines changed: 157 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ sequenceDiagram
395395
else Asynchronous Processing (within 5 seconds)
396396
Client-->>Grid: HTTP 202 Accepted
397397
Client->>Grid: /transactions/{transactionId}/approve or /reject
398-
opt Approved
398+
alt Approved
399399
Grid->>Bank: Execute payment to user's bank account
400400
Grid->>Client: Webhook: INCOMING_PAYMENT (COMPLETED)
401401
Client-->>Grid: HTTP 200 OK (acknowledge completion)

mintlify/api-reference/sdks.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: 'SDKs & CLI'
3+
icon: "/images/icons/code.svg"
4+
description: 'Official client libraries and command-line interface for the Grid API'
5+
"og:image": "/images/og/og-api-reference-generic.png"
6+
---
7+
8+
import Sdks from '/snippets/sdks.mdx';
9+
import Cli from '/snippets/cli.mdx';
10+
11+
<Sdks />
12+
13+
## CLI
14+
15+
<Cli />

mintlify/docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@
266266
"api-reference/terminology",
267267
"api-reference/authentication",
268268
"api-reference/webhooks",
269-
"api-reference/sandbox-testing"
269+
"api-reference/sandbox-testing",
270+
"api-reference/sdks"
270271
]
271272
},
272273
{

mintlify/images/icons/kotlin.svg

Lines changed: 3 additions & 0 deletions
Loading

mintlify/snippets/cli.mdx

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
The Grid CLI lets you interact with the Grid API directly from your terminal — manage customers, send payments, create quotes, and test in sandbox without writing any code.
2+
3+
<Card
4+
title="Grid CLI"
5+
icon="square-terminal"
6+
href="https://github.com/lightsparkdev/grid-api/tree/main/cli"
7+
>
8+
Open-source CLI built with Node.js and TypeScript.
9+
</Card>
10+
11+
### Installation
12+
13+
**Prerequisites:** Node.js v20 or v22 is required.
14+
15+
```bash
16+
git clone https://github.com/lightsparkdev/grid-api.git
17+
cd grid-api/cli
18+
npm install
19+
npm run build
20+
npm link # makes `grid` available globally
21+
```
22+
23+
### Configuration
24+
25+
Configure your credentials interactively:
26+
27+
```bash
28+
grid configure
29+
```
30+
31+
This prompts for your API Token ID and Client Secret, validates them, and saves to `~/.grid-credentials`.
32+
33+
Alternatively, set environment variables:
34+
35+
```bash
36+
export GRID_API_TOKEN_ID="your-token-id"
37+
export GRID_API_CLIENT_SECRET="your-client-secret"
38+
```
39+
40+
### Commands
41+
42+
| Command | Description |
43+
|---------|-------------|
44+
| `grid configure` | Set up API credentials |
45+
| `grid config get` | View platform configuration |
46+
| `grid customers list` | List customers |
47+
| `grid customers create` | Create a customer |
48+
| `grid accounts internal list` | List internal accounts |
49+
| `grid accounts external create` | Create an external bank account or wallet |
50+
| `grid quotes create` | Create a payment quote |
51+
| `grid quotes execute` | Execute a pending quote |
52+
| `grid transfers in` | Transfer funds in (external to internal) |
53+
| `grid transfers out` | Transfer funds out (internal to external) |
54+
| `grid transactions list` | List transactions |
55+
| `grid transactions get` | Get transaction details |
56+
| `grid receiver lookup-uma` | Look up a UMA address |
57+
| `grid sandbox fund` | Fund a sandbox account |
58+
| `grid sandbox send` | Simulate sending funds to a JIT quote |
59+
| `grid sandbox receive` | Simulate receiving a UMA payment |
60+
61+
Short aliases are available: `cust` for `customers`, `tx` for `transactions`, `acct` for `accounts`.
62+
63+
### Example: Send USDC to a Mexico Bank Account
64+
65+
<Steps>
66+
<Step title="Create a customer">
67+
```bash
68+
grid customers create \
69+
--platform-id "your-id" \
70+
--type INDIVIDUAL \
71+
--full-name "Carlos Garcia" \
72+
--birth-date "1988-03-20" \
73+
--address-line1 "Av Reforma 222" \
74+
--address-city "Mexico City" \
75+
--address-state "CDMX" \
76+
--address-postal "06600" \
77+
--address-country "MX"
78+
```
79+
</Step>
80+
<Step title="Create an external CLABE account for the customer">
81+
```bash
82+
grid accounts external create \
83+
--customer-id <customerId> \
84+
--currency MXN \
85+
--account-type CLABE \
86+
--clabe "012345678901234567" \
87+
--beneficiary-type INDIVIDUAL \
88+
--beneficiary-name "Carlos Garcia" \
89+
--beneficiary-birth-date "1988-03-20" \
90+
--beneficiary-nationality MX
91+
```
92+
</Step>
93+
<Step title="Create a quote">
94+
```bash
95+
grid quotes create \
96+
--source-customer <customerId> \
97+
--source-currency USDC \
98+
--dest-account <externalAccountId> \
99+
--dest-currency MXN \
100+
--amount 100000 \
101+
--lock-side RECEIVING
102+
```
103+
</Step>
104+
<Step title="In sandbox, simulate the USDC deposit">
105+
```bash
106+
grid sandbox send --quote-id <quoteId> --currency USDC
107+
```
108+
</Step>
109+
<Step title="Check transaction status">
110+
```bash
111+
grid transactions get <transactionId>
112+
```
113+
</Step>
114+
</Steps>
115+
116+
<Note>
117+
All amounts are in the **smallest currency unit** (e.g., cents for USD, satoshis for BTC). Quotes expire in 1–5 minutes.
118+
</Note>

mintlify/snippets/sdks.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Grid provides official SDKs to help you integrate faster. These libraries wrap the Grid API with idiomatic interfaces, type safety, and built-in error handling.
2+
3+
<CardGroup cols={2}>
4+
<Card
5+
title="JavaScript / TypeScript"
6+
icon="js"
7+
href="https://github.com/lightsparkdev/grid-js-sdk"
8+
>
9+
Install via npm and start building with full TypeScript support.
10+
</Card>
11+
<Card
12+
title="Kotlin"
13+
icon="/images/icons/kotlin.svg"
14+
href="https://github.com/lightsparkdev/grid-kotlin-sdk"
15+
>
16+
For JVM and Android applications. Available on Maven Central.
17+
</Card>
18+
</CardGroup>

0 commit comments

Comments
 (0)