Tokens
Fungible-token routes follow an account-model wallet API against the peer’s configured chaincode (schema family account-model / fungible-token v2.0, multi-token).
Authenticate with X-Api-Key. Full OpenAPI: API reference.
Contract
| Method | Path | Purpose |
|---|---|---|
POST | /api/tokens/issue | Issue units to a wallet (default token) |
POST | /api/tokens/transfer | Transfer between wallets (default token) |
GET | /api/tokens/redeem/quote | Quote redemption for an amount |
POST | /api/tokens/redeem | Redeem units from a wallet |
GET | /api/tokens/stats | Network economics / supply snapshot |
GET | /api/tokens/{walletId}/balance | Wallet balance |
GET | /api/tokens/{walletId}/history | Wallet history |
These seven routes remain the primary Peer REST wallet surface (VPC-private). Integrators should treat them as the stable contract; see Upgrade & compatibility.
Multi-token
A single network can host many independent coins. The primary / deploy-time token uses tokenId=default and keeps legacy ledger keys for rollback safety. Additional tokens use explicit ids:
| Method | Path | Purpose |
|---|---|---|
GET | /api/tokens | List tokens on the network |
POST | /api/tokens/{tokenId}/issue | Issue for a specific token |
POST | /api/tokens/{tokenId}/transfer | Transfer for a specific token |
GET | /api/tokens/{tokenId}/{walletId}/balance | Balance for a specific token |
GET | /api/tokens/wallets/{walletId}/portfolio | Holdings across all tokens |
Creating tokens (POST /api/tokens) is admin-tagged on Peer REST; SaaS builders use the public token gateway with token:create instead.
Public token gateway
SaaS backends that cannot reach the VPC call the public token gateway (X-Api-Key, internet-reachable) instead of Peer REST:
| Method | Path | Scope |
|---|---|---|
GET | /token-gateway/whoami | Resolve networkId + URLs from the API key alone |
GET | /token-gateway/{networkId}/tokens | token:read |
POST | /token-gateway/{networkId}/tokens | token:create |
POST | /token-gateway/{networkId}/tokens/{tokenId}/issue | token:issue |
POST | /token-gateway/{networkId}/tokens/{tokenId}/transfer | token:transfer |
POST | /token-gateway/{networkId}/tokens/{tokenId}/redeem | token:redeem |
GET | /token-gateway/{networkId}/wallets/{walletId}/portfolio | token:read |
Deep-links: API reference → token-gateway. Mint keys with token:* scopes in the dashboard Developer → API Keys page.
Wallet operations
Issue
POST /api/tokens/issue
X-Api-Key: <key>
Content-Type: application/json
{
"walletId": "wallet-a",
"usdAmount": 10,
"coinUnits": 100
}
Transfer
{
"fromWalletId": "wallet-a",
"toWalletId": "wallet-b",
"amount": 25
}
Redeem quote
GET /api/tokens/redeem/quote?amount=10
X-Api-Key: <key>
Redeem
{
"walletId": "wallet-a",
"amount": 10
}
Admin routes (out of scope)
Routes such as /api/tokens/init, /distribute, /top-up-reserve, /reverse, and audit-export require X-Admin-Api-Key and are operator tooling, not the partner wallet contract. They may appear in OpenAPI for completeness but are not the primary integration path.
Success shape
Successful submits typically return:
{
"success": true,
"transactionId": "…"
}
Evaluates (quote, balance, history, stats) return { "success": true, "result": … }. Failures use the error envelope.