With Global P2P you can send and receive payments in any supported fiat or crypto currency. This quickstart guides you through a regulated FI sending an individual customer payment from the US to a bank account in Mexico using USDC just-in-time funding. For examples funding with real time fiat rails, see the Sending Payments guide.
Understanding Entity Mapping for Remittances
In this guide, the entities map as follows:
| Entity Type | Who They Are | In This Example |
|---|
| Platform | Your remittance service | Your money transfer app |
| Customer | Both sender and recipient | Alice (sender in US), Carlos (recipient in Mexico) |
| External Account | Bank accounts for funding/receiving | Alice’s US bank (funding), Carlos’s Mexican bank (receiving funds) |
Flow: Alice (customer) funds a transfer from her external account → to Carlos (also a customer) → who receives funds in his external bank account. Alternatively, Alice could send directly to Carlos’s UMA address if he has one.
Get API credentials
Create Sandbox API credentials in the dashboard, then set environment variables for local use.
export GRID_BASE_URL="https://api.lightspark.com/grid/2025-10-13"
export GRID_CLIENT_ID="YOUR_SANDBOX_CLIENT_ID"
export GRID_CLIENT_SECRET="YOUR_SANDBOX_CLIENT_SECRET"
Use Basic Auth in cURL with -u "$GRID_CLIENT_ID:$GRID_CLIENT_SECRET".
Create a customer
Register a customer who will send the payment. You can provide your own UMA handle or let the system generate one.
curl -sS -X POST "https://api.lightspark.com/grid/2025-10-13/customers" \
-u "$GRID_CLIENT_ID:$GRID_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"platformCustomerId": "cust_7b3c5a89d2f1e0",
"customerType": "INDIVIDUAL",
"umaAddress": "$alice@yourapp.example",
"fullName": "Alice Smith",
"address": {
"line1": "123 Pine Street",
"city": "Seattle",
"state": "WA",
"postalCode": "98101",
"country": "US"
}
}'
Response:
{
"id": "Customer:019542f5-b3e7-1d02-0000-000000000001",
"customerType": "INDIVIDUAL",
"umaAddress": "$alice@yourapp.example",
"platformCustomerId": "cust_7b3c5a89d2f1e0"
}
Create an external receiving bank account (CLABE in MX)
Add a beneficiary account in Mexico using their CLABE. We attach it to the same customer for this example.
curl -sS -X POST "https://api.lightspark.com/grid/2025-10-13/customers/external-accounts" \
-u "$GRID_CLIENT_ID:$GRID_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"currency": "MXN",
"platformAccountId": "mx_beneficiary_001",
"customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",
"accountInfo": {
"accountType": "CLABE",
"clabeNumber": "123456789012345678",
"bankName": "BBVA Mexico",
"beneficiary": {
"beneficiaryType": "INDIVIDUAL",
"fullName": "Carlos Pérez",
"birthDate": "1985-03-15",
"nationality": "MX",
"address": {
"line1": "Av. Reforma 123",
"city": "Ciudad de México",
"state": "CDMX",
"postalCode": "06600",
"country": "MX"
}
}
}
}'
Response:
{
"id": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",
"customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",
"currency": "MXN",
"status": "ACTIVE",
"platformAccountId": "mx_beneficiary_001",
"accountInfo": {
"accountType": "CLABE",
"clabeNumber": "123456789012345678",
"bankName": "BBVA Mexico",
"beneficiary": {
"beneficiaryType": "INDIVIDUAL",
"fullName": "Carlos Pérez",
"birthDate": "1985-03-15",
"nationality": "MX",
"address": {
"line1": "Av. Reforma 123",
"city": "Ciudad de México",
"state": "CDMX",
"postalCode": "06600",
"country": "MX"
}
}
}
}
Create a quote (just‑in‑time funding)
Quote a transfer of 100 USD from the customer to the MXN CLABE account. The quote returns the exchange rate, fees, and paymentInstructions to fund in real time.
curl -sS -X POST "https://api.lightspark.com/grid/2025-10-13/quotes" \
-u "$GRID_CLIENT_ID:$GRID_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"source": {
"sourceType": "REALTIME_FUNDING",
"customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",
"currency": "USDC"
},
"destination": {
"destinationType": "ACCOUNT",
"accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"
},
"lockedCurrencySide": "SENDING",
"lockedCurrencyAmount": 10000,
"description": "Remittance to MX beneficiary"
}'
Response:
{
"id": "Quote:019542f5-b3e7-1d02-0000-000000000006",
"exchangeRate": 16.85,
"fees": { "amount": 50, "currency": { "code": "USD", "decimals": 2 } },
"paymentInstructions": [
{
"accountOrWalletInfo": {
"accountType": "SOLANA_WALLET",
"address": "0x1234567890123456789012345678901234567890",
"assetType": "USDC"
}
},
{
"accountOrWalletInfo": {
"accountType": "BASE_WALLET",
"address": "0x1234567890123456789012345678901234567890",
"assetType": "USDC"
}
}
],
"status": "PENDING"
}
Fund the quote (Sandbox simulation)
In production, you would trigger a payment on one of the supported blockchains to the provided address. In Sandbox, you can mock funding using the simulate send endpoint.
curl -sS -X POST "https://api.lightspark.com/grid/2025-10-13/sandbox/send" \
-u "$GRID_CLIENT_ID:$GRID_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"reference": "UMA-Q12345-REF",
"currencyCode": "USDC",
"currencyAmount": 10000
}'
Response:
{
"id": "Transaction:019542f5-b3e7-1d02-0000-000000000005",
"status": "PROCESSING",
"type": "OUTGOING",
"quoteId": "Quote:019542f5-b3e7-1d02-0000-000000000006"
}
Handle the outgoing payment webhook
Implement a webhook endpoint to receive status updates as the payment moves from pending to completed (or failed). Verify the X-Grid-Signature header using the public key provided during onboarding.
Webhook event:
{
"transaction": {
"id": "Transaction:019542f5-b3e7-1d02-0000-000000000005",
"status": "COMPLETED",
"type": "OUTGOING",
"senderUmaAddress": "$alice@yourapp.example",
"receivedAmount": { "amount": 9706, "currency": { "code": "MXN", "decimals": 2 } },
"customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",
"quoteId": "Quote:019542f5-b3e7-1d02-0000-000000000006",
},
"timestamp": "2025-01-15T14:32:00Z",
"webhookId": "Webhook:019542f5-b3e7-1d02-0000-000000000007",
"type": "OUTGOING_PAYMENT"
}