Loading...
Loading...
This skill should be used when the user asks to "send a payment", "check balance", "list transactions", "create a quote", "manage customers", "create external account", "what currencies does Grid support", "how do I use the Grid API", "send money to [country]", "pay [UMA address]", "send to CLABE", "send to PIX", "send to IBAN", "send to UPI", "fund sandbox account", "test a payment", "on-ramp", "off-ramp", "convert crypto to fiat", "convert fiat to crypto", "look up UMA", "real-time quote", "JIT funding", or any payment operations using the Grid API CLI.
npx skill4agent add lightsparkdev/grid-api grid-apicurlreferences/references/account-types.mdreferences/endpoints.mdreferences/workflows.md$user@domain.comPENDINGACTIVEUNDER_REVIEWINACTIVEcurrency.decimals10000decimals: 2GRID_API_TOKEN_IDGRID_API_CLIENT_SECRETGRID_BASE_URL~/.grid-credentialsexport GRID_API_TOKEN_ID=$(jq -r .apiTokenId ~/.grid-credentials)
export GRID_API_CLIENT_SECRET=$(jq -r .apiClientSecret ~/.grid-credentials)
export GRID_BASE_URL=$(jq -r '.baseUrl // "https://api.lightspark.com/grid/2025-10-13"' ~/.grid-credentials)~/.grid-credentialshttps://api.lightspark.com/grid/2025-10-13~/.grid-credentialsbaseUrlhttps://grid.lightspark.com/llms.txthttps://grid.lightspark.com/llms-full.txthttps://raw.githubusercontent.com/lightsparkdev/grid-api/refs/heads/main/openapi.yamlhttps://grid.lightspark.com.mdcurl -ucurl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
"$GRID_BASE_URL/<endpoint>"curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X POST \
-H "Content-Type: application/json" \
-d '<json-body>' \
"$GRID_BASE_URL/<endpoint>"jq| jq .# Get platform config (currencies, limits)
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
"$GRID_BASE_URL/config" | jq .
# Update platform config (e.g., set webhook endpoint)
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X PATCH -H "Content-Type: application/json" \
-d '{"webhookEndpoint": "https://example.com/webhooks"}' \
"$GRID_BASE_URL/config" | jq .# List customers
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
"$GRID_BASE_URL/customers?limit=20" | jq .
# Get customer details
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
"$GRID_BASE_URL/customers/<customerId>" | jq .
# Create customer
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X POST -H "Content-Type: application/json" \
-d '{
"platformCustomerId": "<platform-id>",
"customerType": "INDIVIDUAL",
"fullName": "Name"
}' \
"$GRID_BASE_URL/customers" | jq .
# Update customer (customerType is required)
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X PATCH -H "Content-Type: application/json" \
-d '{"customerType": "INDIVIDUAL", "fullName": "New Name"}' \
"$GRID_BASE_URL/customers/<customerId>" | jq .
# Delete customer
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X DELETE \
"$GRID_BASE_URL/customers/<customerId>" | jq .
# Generate KYC link (GET with query params)
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
"$GRID_BASE_URL/customers/kyc-link?platformCustomerId=<platformCustomerId>&redirectUri=https://example.com/callback" | jq .# List customer internal accounts
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
"$GRID_BASE_URL/customers/internal-accounts?customerId=<customerId>" | jq .
# List platform internal accounts
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
"$GRID_BASE_URL/platform/internal-accounts" | jq .
# List customer external accounts
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
"$GRID_BASE_URL/customers/external-accounts?customerId=<customerId>" | jq .
# Create external account (example: Mexico CLABE - Individual)
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X POST -H "Content-Type: application/json" \
-d '{
"customerId": "<customerId>",
"currency": "MXN",
"accountInfo": {
"accountType": "CLABE",
"clabeNumber": "<18-digit-number>",
"beneficiary": {
"beneficiaryType": "INDIVIDUAL",
"fullName": "Full Name",
"birthDate": "1990-01-15",
"nationality": "MX"
}
}
}' \
"$GRID_BASE_URL/customers/external-accounts" | jq .references/account-types.md# Account-funded to UMA: Use when funds are already in an internal account
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X POST -H "Content-Type: application/json" \
-d '{
"source": {
"sourceType": "ACCOUNT",
"accountId": "<internalAccountId>"
},
"destination": {
"destinationType": "UMA_ADDRESS",
"umaAddress": "<address>",
"currency": "USD"
},
"lockedCurrencyAmount": 10000,
"lockedCurrencySide": "SENDING"
}' \
"$GRID_BASE_URL/quotes" | jq .
# Account-funded to external account: IMPORTANT - always include destination currency
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X POST -H "Content-Type: application/json" \
-d '{
"source": {
"sourceType": "ACCOUNT",
"accountId": "<internalAccountId>"
},
"destination": {
"destinationType": "ACCOUNT",
"accountId": "<externalAccountId>",
"currency": "<currency>"
},
"lockedCurrencyAmount": 10000,
"lockedCurrencySide": "SENDING"
}' \
"$GRID_BASE_URL/quotes" | jq .
# Real-time/JIT funded: Returns paymentInstructions for funding
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X POST -H "Content-Type: application/json" \
-d '{
"source": {
"sourceType": "REALTIME_FUNDING",
"customerId": "<customerId>",
"currency": "<sourceCurrency>"
},
"destination": {
"destinationType": "ACCOUNT",
"accountId": "<accountId>",
"currency": "<destCurrency>"
},
"lockedCurrencyAmount": 100000,
"lockedCurrencySide": "RECEIVING"
}' \
"$GRID_BASE_URL/quotes" | jq .
# Execute a quote
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X POST \
"$GRID_BASE_URL/quotes/<quoteId>/execute" | jq .
# List quotes
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
"$GRID_BASE_URL/quotes?status=PENDING" | jq .
# Get quote details
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
"$GRID_BASE_URL/quotes/<quoteId>" | jq .# Transfer in (external → internal, same currency)
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X POST -H "Content-Type: application/json" \
-d '{
"source": {"accountId": "<externalAccountId>"},
"destination": {"accountId": "<internalAccountId>"},
"amount": 10000
}' \
"$GRID_BASE_URL/transfer-in" | jq .
# Transfer out (internal → external, same currency)
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X POST -H "Content-Type: application/json" \
-d '{
"source": {"accountId": "<internalAccountId>"},
"destination": {"accountId": "<externalAccountId>"},
"amount": 10000
}' \
"$GRID_BASE_URL/transfer-out" | jq .# List transactions
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
"$GRID_BASE_URL/transactions?status=PENDING" | jq .
# Get transaction details
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
"$GRID_BASE_URL/transactions/<transactionId>" | jq .
# Approve incoming payment
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X POST \
"$GRID_BASE_URL/transactions/<transactionId>/approve" | jq .
# Reject incoming payment
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X POST -H "Content-Type: application/json" \
-d '{"reason": "Reason for rejection"}' \
"$GRID_BASE_URL/transactions/<transactionId>/reject" | jq .# Look up UMA address capabilities
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
"$GRID_BASE_URL/receiver/uma/%24alice%40example.com" | jq .
# Look up external account capabilities
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
"$GRID_BASE_URL/receiver/external-account/<accountId>" | jq .$%24# Fund an internal account in sandbox
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X POST -H "Content-Type: application/json" \
-d '{"amount": 100000}' \
"$GRID_BASE_URL/sandbox/internal-accounts/<internalAccountId>/fund" | jq .
# Simulate sending funds to a real-time quote
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X POST -H "Content-Type: application/json" \
-d '{"quoteId": "<quoteId>", "currencyCode": "<code>"}' \
"$GRID_BASE_URL/sandbox/send" | jq .
# Simulate receiving a UMA payment
curl -s -u "$GRID_API_TOKEN_ID:$GRID_API_CLIENT_SECRET" \
-X POST -H "Content-Type: application/json" \
-d '{
"senderUmaAddress": "$sender@sandbox.grid.uma.money",
"receiverUmaAddress": "<receiverAddress>",
"receivingCurrencyCode": "USD",
"receivingCurrencyAmount": 1000
}' \
"$GRID_BASE_URL/sandbox/uma/receive" | jq .Internal Account (USD) → Quote → External Account/UMA (EUR)sourceType: "ACCOUNT"paymentInstructionsCustomer sends crypto/fiat → Grid detects deposit → Auto-executes at locked ratesourceType: "REALTIME_FUNDING"External Account (USD) → Internal Account (USD) [transfer-in]
Internal Account (USD) → External Account (USD) [transfer-out]references/workflows.mdimmediatelyExecutesourceType: "REALTIME_FUNDING"paymentInstructionsACCOUNT_STATUSOUTGOING_PAYMENTGET /configdecimals| jq .| jq -r .field$%24currencybeneficiaryType: "INDIVIDUAL"fullNamebirthDatenationalitybeneficiarybankNamebankCodepurposeOfPaymentpixKeypixKeyTypetaxIdswiftBic{
"id": "...",
"status": "...",
...
}{
"code": "ERROR_CODE",
"message": "Human readable message"
}QUOTE_EXPIREDINSUFFICIENT_BALANCEINVALID_BANK_ACCOUNTQUOTE_EXECUTION_FAILEDPAYMENT_APPROVAL_TIMED_OUTPAYMENT_APPROVAL_WEBHOOK_ERRORINVALID_INPUTreasonMISSING_MANDATORY_USER_INFO