Overview
Stablecoin Funding lets partners pre-fund payroll runs by transferring stablecoins (USDC, USDT, and others) on-chain to Toku’s custody. Toku then converts and disburses local-currency payments to employees. Your integration never handles fiat directly — you transfer tokens, Toku handles the rest. Key characteristics:- Contracts are denominated in local fiat (e.g., SGD, USD, EUR)
- You fund in stablecoins; the exchange rate is locked at settlement time
- Each payroll entity may have one or more custodial wallets; transfers are per-wallet
computePendingSettlementsalways shows the exact token amount required before you commit funds
End-to-End Funding Flow
1
Create a token payroll run
Call The response includes a
POST /createTokenPayroll to open a new run in draft state. Specify the pay period, tax currency, and the payroll entity.tokenPayrollID used in every subsequent call.2
Compute pending settlements
Call Review the
POST /computePendingSettlements with the payrollID. The response lists each custodial wallet that requires funding, along with the exact token amount, equivalent fiat amount, and the exchange rate that will be applied.pendingSettlements array carefully. Each entry shows:walletAddress— on-chain destination for your transfertokenAmount— exact amount to send (in token units)fiatAmount— fiat equivalent at current rateexchangeRate— rate locked at settlement approval
Do not send funds until you have reviewed pending settlements. The rate shown here is the rate that will be applied when you call
approveTokenPayrollSettlements.3
Transfer stablecoins on-chain
Using the wallet addresses and token amounts from Step 2, transfer stablecoins from your wallet(s) to Toku’s custody addresses. Use your own signing infrastructure for this on-chain step.Ensure transfers are confirmed on-chain before proceeding to the next step.
4
Approve the settlements
Call A successful response returns
POST /approveTokenPayrollSettlements with the tokenPayrollID and the walletReferenceIDs for each wallet you funded. Toku verifies on-chain receipt and locks in the exchange rates."success": true and the count of approved settlements.5
Toku disburses to employees
After approval, Toku converts the received tokens to local fiat and processes disbursements to each employee. The run transitions to
COMPLETED when all payments have been sent.Monitor state via POST /getTokenPayrollByID or webhook events for the token_payroll.completed event.Listing and Lookup
List all token payrolls
GET /getAllTokenPayrolls returns every token payroll run for your organization. You can filter by entity:
Fetch a single run
POST /getTokenPayrollByID returns the full payroll object including contributor details, settlement method, and current state.
payrollTypes array to filter by run type (e.g., ["REGULAR", "BONUS"]).
State Management
UsePOST /updateTokenPayrollState to advance or halt a run’s lifecycle.
Per-Employee Breakdown
POST /getTokenPayrollBreakdown returns the token distribution for a specific role in the organization. Pass roleInOrgID and the calculated netPay to see how the net pay maps to token amounts per employee.
The response includes:
tokenDistributions— list of token allocation rules appliedtokenAmounts— per-token amounts after applying distributionstotalTokenPercentage— percentage of net pay covered by tokensnetFiatPay— remainder paid in fiat after token allocation
Multi-Currency Notes
Contracts are always denominated in a local fiat currency set viafiatCurrency at run creation. Employees receive payment in their contract currency regardless of which stablecoin you use to fund.
Exchange rates are locked at settlement approval time — the rate shown in computePendingSettlements is indicative until approveTokenPayrollSettlements is called, at which point it is fixed for that run. Rate slippage between computation and approval is your responsibility to manage.
Next Steps
Create Token Payroll
Open a new stablecoin payroll run
Compute Pending Settlements
Get required token amounts before funding
Approve Settlements
Confirm on-chain transfers and lock rates
Get Payroll Breakdown
Per-employee token distribution details
