import LightsparkGrid from '@lightsparkdev/grid';
const client = new LightsparkGrid({
username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted
password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted
});
const internalAccount = await client.sandbox.internalAccounts.fund(
'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',
{ amount: 100000 },
);
console.log(internalAccount.id);{
"id": "InternalAccount:12dcbd6-dced-4ec4-b756-3c3a9ea3d123",
"balance": {
"amount": 12550,
"currency": {
"code": "USD",
"name": "United States Dollar",
"symbol": "$",
"decimals": 2
}
},
"fundingPaymentInstructions": [
{
"accountOrWalletInfo": {
"accountType": "US_ACCOUNT",
"clabeNumber": "123456789012345678",
"reference": "UMA-Q12345-REF"
},
"instructionsNotes": "Please ensure the reference code is included in the payment memo/description field",
"isPlatformAccount": true
}
],
"createdAt": "2025-10-03T12:30:00Z",
"updatedAt": "2025-10-03T12:30:00Z",
"customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001"
}Simulate receiving funds into an internal account in the sandbox environment. This is useful for testing scenarios where you need to add funds to a customer’s or platform’s internal account without going through a real bank transfer or following payment instructions. This endpoint is only for the sandbox environment and will fail for production platforms/keys.
import LightsparkGrid from '@lightsparkdev/grid';
const client = new LightsparkGrid({
username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted
password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted
});
const internalAccount = await client.sandbox.internalAccounts.fund(
'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',
{ amount: 100000 },
);
console.log(internalAccount.id);{
"id": "InternalAccount:12dcbd6-dced-4ec4-b756-3c3a9ea3d123",
"balance": {
"amount": 12550,
"currency": {
"code": "USD",
"name": "United States Dollar",
"symbol": "$",
"decimals": 2
}
},
"fundingPaymentInstructions": [
{
"accountOrWalletInfo": {
"accountType": "US_ACCOUNT",
"clabeNumber": "123456789012345678",
"reference": "UMA-Q12345-REF"
},
"instructionsNotes": "Please ensure the reference code is included in the payment memo/description field",
"isPlatformAccount": true
}
],
"createdAt": "2025-10-03T12:30:00Z",
"updatedAt": "2025-10-03T12:30:00Z",
"customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001"
}API token authentication using format <api token id>:<api client secret>
The ID of the internal account to fund
Amount to add in the smallest unit of the account's currency (e.g., cents for USD/EUR, satoshis for BTC)
x <= 100000000000100000
Internal account funded successfully
The ID of the internal account
"InternalAccount:12dcbd6-dced-4ec4-b756-3c3a9ea3d123"
Show child attributes
Payment instructions for funding the account
Show child attributes
Timestamp when the internal account was created
"2025-10-03T12:30:00Z"
Timestamp when the internal account was last updated
"2025-10-03T12:30:00Z"
The ID of the customer associated with the internal account. If this field is empty, the internal account belongs to the platform.
"Customer:019542f5-b3e7-1d02-0000-000000000001"
Was this page helpful?