# Accounts Source: https://docs.stablemint.io/api-reference/accounts/accounts /api-reference/openapi.json get /v1/accounts # Beneficiaries create Source: https://docs.stablemint.io/api-reference/beneficiaries/beneficiaries-create /api-reference/openapi.json post /v1/beneficiaries # Beneficiaries delete Source: https://docs.stablemint.io/api-reference/beneficiaries/beneficiaries-delete /api-reference/openapi.json delete /v1/beneficiaries/{id} # Beneficiaries external stablecoin delete Source: https://docs.stablemint.io/api-reference/beneficiaries/beneficiaries-external-stablecoin-delete /api-reference/openapi.json delete /v1/beneficiaries/{id}/external-stablecoin # Beneficiaries external stablecoin put Source: https://docs.stablemint.io/api-reference/beneficiaries/beneficiaries-external-stablecoin-put /api-reference/openapi.json put /v1/beneficiaries/{id}/external-stablecoin # Beneficiaries get Source: https://docs.stablemint.io/api-reference/beneficiaries/beneficiaries-get /api-reference/openapi.json get /v1/beneficiaries/{id} # Beneficiaries list Source: https://docs.stablemint.io/api-reference/beneficiaries/beneficiaries-list /api-reference/openapi.json get /v1/beneficiaries # Beneficiaries update Source: https://docs.stablemint.io/api-reference/beneficiaries/beneficiaries-update /api-reference/openapi.json put /v1/beneficiaries # Checkout hosted create Source: https://docs.stablemint.io/api-reference/checkout/checkout-hosted-create /api-reference/openapi.json post /v1/checkout/hosted # Customer account create Source: https://docs.stablemint.io/api-reference/customers/customer-account-create /api-reference/openapi.json post /v1/customers/{id}/account # Customer account get Source: https://docs.stablemint.io/api-reference/customers/customer-account-get /api-reference/openapi.json get /v1/customers/{id}/account # Customer deposit create Source: https://docs.stablemint.io/api-reference/customers/customer-deposit-create /api-reference/openapi.json post /v1/customers/{id}/deposit # Customer withdrawal create Source: https://docs.stablemint.io/api-reference/customers/customer-withdrawal-create /api-reference/openapi.json post /v1/customers/{id}/withdrawal # Customers create Source: https://docs.stablemint.io/api-reference/customers/customers-create /api-reference/openapi.json post /v1/customers # Customers get Source: https://docs.stablemint.io/api-reference/customers/customers-get /api-reference/openapi.json get /v1/customers/{id} # Customers list Source: https://docs.stablemint.io/api-reference/customers/customers-list /api-reference/openapi.json get /v1/customers # Customers update Source: https://docs.stablemint.io/api-reference/customers/customers-update /api-reference/openapi.json put /v1/customers/{id} # Fx execute Source: https://docs.stablemint.io/api-reference/fx/fx-execute /api-reference/openapi.json post /v1/fx/execute # Fx preview Source: https://docs.stablemint.io/api-reference/fx/fx-preview /api-reference/openapi.json post /v1/fx/preview # Payouts fiat create Source: https://docs.stablemint.io/api-reference/payouts/payouts-fiat-create /api-reference/openapi.json post /v1/payouts/fiat # Payouts token create Source: https://docs.stablemint.io/api-reference/payouts/payouts-token-create /api-reference/openapi.json post /v1/payouts/token # Reports account statement Source: https://docs.stablemint.io/api-reference/reports/reports-account-statement /api-reference/openapi.json get /v1/reports/account-statement # Reports transaction statement Source: https://docs.stablemint.io/api-reference/reports/reports-transaction-statement /api-reference/openapi.json get /v1/reports/transaction-statement # Banking simulations deposit Source: https://docs.stablemint.io/api-reference/simulations/banking-simulations-deposit /api-reference/openapi.json post /v1/simulations/deposit # Transactions get Source: https://docs.stablemint.io/api-reference/transactions/transactions-get /api-reference/openapi.json get /v1/transactions/{reference} # Transactions list Source: https://docs.stablemint.io/api-reference/transactions/transactions-list /api-reference/openapi.json get /v1/transactions # User invitations create Source: https://docs.stablemint.io/api-reference/users/user-invitations-create /api-reference/openapi.json post /v1/users/invitations # User invitations delete Source: https://docs.stablemint.io/api-reference/users/user-invitations-delete /api-reference/openapi.json delete /v1/users/invitations/{invitationId} # User invitations get Source: https://docs.stablemint.io/api-reference/users/user-invitations-get /api-reference/openapi.json get /v1/users/invitations/{invitationId} # User invitations list Source: https://docs.stablemint.io/api-reference/users/user-invitations-list /api-reference/openapi.json get /v1/users/invitations # User invitations resend Source: https://docs.stablemint.io/api-reference/users/user-invitations-resend /api-reference/openapi.json post /v1/users/invitations/{invitationId}/resend # Users delete Source: https://docs.stablemint.io/api-reference/users/users-delete /api-reference/openapi.json delete /v1/users/{userId} # Users list Source: https://docs.stablemint.io/api-reference/users/users-list /api-reference/openapi.json get /v1/users # Users set role Source: https://docs.stablemint.io/api-reference/users/users-set-role /api-reference/openapi.json put /v1/users/{userId}/role # Vasps search Source: https://docs.stablemint.io/api-reference/vasps/vasps-search /api-reference/openapi.json get /v1/vasps # Wallets Source: https://docs.stablemint.io/api-reference/wallets/wallets /api-reference/openapi.json get /v1/wallets # Webhooks create Source: https://docs.stablemint.io/api-reference/webhooks/webhooks-create /api-reference/openapi.json post /v1/webhooks # Webhooks delete Source: https://docs.stablemint.io/api-reference/webhooks/webhooks-delete /api-reference/openapi.json delete /v1/webhooks # Webhooks event retry Source: https://docs.stablemint.io/api-reference/webhooks/webhooks-event-retry /api-reference/openapi.json post /v1/webhooks/{webhookId}/event/{eventId}/retry # Webhooks event types Source: https://docs.stablemint.io/api-reference/webhooks/webhooks-event-types /api-reference/openapi.json get /v1/webhooks/event-types # Webhooks event types preview Source: https://docs.stablemint.io/api-reference/webhooks/webhooks-event-types-preview /api-reference/openapi.json post /v1/webhooks/event-types/preview # Webhooks event types test Source: https://docs.stablemint.io/api-reference/webhooks/webhooks-event-types-test /api-reference/openapi.json post /v1/webhooks/event-types/test # Webhooks events Source: https://docs.stablemint.io/api-reference/webhooks/webhooks-events /api-reference/openapi.json get /v1/webhooks/events # Webhooks list Source: https://docs.stablemint.io/api-reference/webhooks/webhooks-list /api-reference/openapi.json get /v1/webhooks # Webhooks preview Source: https://docs.stablemint.io/api-reference/webhooks/webhooks-preview /api-reference/openapi.json post /v1/webhooks/{webhookId}/preview # Webhooks test Source: https://docs.stablemint.io/api-reference/webhooks/webhooks-test /api-reference/openapi.json post /v1/webhooks/{webhookId}/test # Webhooks update Source: https://docs.stablemint.io/api-reference/webhooks/webhooks-update /api-reference/openapi.json put /v1/webhooks # Bridge USDSM Source: https://docs.stablemint.io/bridge/bridge-usdsm Bridge USDSM between chains programmatically. This guide shows how to bridge USDSM between chains programmatically. The process requires two transactions: an ERC-20 approval and a bridge send. ## Prerequisites * USDSM tokens on the source chain * Native gas token (ETH/XTZ) on the source chain for transaction fees + LayerZero messaging fee * The destination chain's [Endpoint ID](/bridge/overview#supported-chains) ## Quick Start (ethers.js v6) ### Step 1: Set up contracts ```javascript theme={null} import { ethers } from 'ethers'; // Connect to source chain (example: Ethereum) const provider = new ethers.JsonRpcProvider('YOUR_RPC_URL'); const signer = new ethers.Wallet('YOUR_PRIVATE_KEY', provider); // Contract addresses (Ethereum — see overview for other chains) const USDSM_ADDRESS = '0x399B29975CBE313C56269cD5097F5AE097Fa2741'; const ADAPTER_ADDRESS = '0x0aFa4BE6fA5ebAf5fFEe3AB9F88EAA3e16c37aDE'; const MINTER_BURNER_ADDRESS = '0x6A02e153bCbF9e6BE45C0b49F7F0ABc82859ebD5'; // Minimal ABIs const ERC20_ABI = ['function approve(address, uint256) returns (bool)']; const ADAPTER_ABI = [ 'function quoteSend((uint32,bytes32,uint256,uint256,bytes,bytes,bytes), bool) view returns ((uint256,uint256))', 'function send((uint32,bytes32,uint256,uint256,bytes,bytes,bytes), (uint256,uint256), address) payable returns ((bytes32,uint64,(uint256,uint256))' ]; const usdsm = new ethers.Contract(USDSM_ADDRESS, ERC20_ABI, signer); const adapter = new ethers.Contract(ADAPTER_ADDRESS, ADAPTER_ABI, signer); ``` ### Step 2: Build send parameters ```javascript theme={null} // Destination: Arbitrum (EID 30110) const DST_EID = 30110; const amount = ethers.parseEther('100'); // 100 USDSM // Encode recipient as bytes32 (pad address to 32 bytes) const recipientBytes32 = ethers.zeroPadValue(signer.address, 32); // Enforced options: 120k gas for lzReceive const extraOptions = '0x0003010011010000000000000000000000000001d4c0'; const sendParam = { dstEid: DST_EID, to: recipientBytes32, amountLD: amount, minAmountLD: amount, // Set slippage tolerance if needed extraOptions: extraOptions, composeMsg: '0x', // No composed message oftCmd: '0x', // No OFT command }; ``` ### Step 3: Quote the messaging fee ```javascript theme={null} const [nativeFee, lzTokenFee] = await adapter.quoteSend( [sendParam.dstEid, sendParam.to, sendParam.amountLD, sendParam.minAmountLD, sendParam.extraOptions, sendParam.composeMsg, sendParam.oftCmd], false // don't pay in LZ token ); console.log(`LayerZero fee: ${ethers.formatEther(nativeFee)} ETH`); ``` ### Step 4: Approve and send ```javascript theme={null} // IMPORTANT: Approve the MinterBurner, NOT the adapter const approveTx = await usdsm.approve(MINTER_BURNER_ADDRESS, amount); await approveTx.wait(); console.log('Approved MinterBurner'); // Send the bridge transaction const fee = { nativeFee, lzTokenFee: 0n }; const sendTx = await adapter.send( [sendParam.dstEid, sendParam.to, sendParam.amountLD, sendParam.minAmountLD, sendParam.extraOptions, sendParam.composeMsg, sendParam.oftCmd], fee, signer.address, // refund address for excess gas { value: nativeFee } ); const receipt = await sendTx.wait(); console.log(`Bridge TX: ${receipt.hash}`); ``` ### Step 5: Track delivery Monitor your transaction on [LayerZero Scan](https://layerzeroscan.com): ``` https://layerzeroscan.com/tx/YOUR_TX_HASH ``` Delivery typically takes 1–5 minutes depending on the source chain's block confirmations. ## Using viem ```typescript theme={null} import { createPublicClient, createWalletClient, http, parseEther, padHex } from 'viem'; import { mainnet } from 'viem/chains'; import { privateKeyToAccount } from 'viem/accounts'; const account = privateKeyToAccount('0xYOUR_PRIVATE_KEY'); const publicClient = createPublicClient({ chain: mainnet, transport: http() }); const walletClient = createWalletClient({ account, chain: mainnet, transport: http() }); const USDSM = '0x399B29975CBE313C56269cD5097F5AE097Fa2741'; const ADAPTER = '0x0aFa4BE6fA5ebAf5fFEe3AB9F88EAA3e16c37aDE'; const MINTER_BURNER = '0x6A02e153bCbF9e6BE45C0b49F7F0ABc82859ebD5'; const amount = parseEther('100'); const dstEid = 30110; // Arbitrum // 1. Approve MinterBurner await walletClient.writeContract({ address: USDSM, abi: [{ name: 'approve', type: 'function', inputs: [{ type: 'address' }, { type: 'uint256' }], outputs: [{ type: 'bool' }] }], functionName: 'approve', args: [MINTER_BURNER, amount], }); // 2. Quote fee const adapterAbi = [ { name: 'quoteSend', type: 'function', stateMutability: 'view', inputs: [ { name: '_sendParam', type: 'tuple', components: [ { name: 'dstEid', type: 'uint32' }, { name: 'to', type: 'bytes32' }, { name: 'amountLD', type: 'uint256' }, { name: 'minAmountLD', type: 'uint256' }, { name: 'extraOptions', type: 'bytes' }, { name: 'composeMsg', type: 'bytes' }, { name: 'oftCmd', type: 'bytes' }, ]}, { name: '_payInLzToken', type: 'bool' }, ], outputs: [ { name: 'msgFee', type: 'tuple', components: [ { name: 'nativeFee', type: 'uint256' }, { name: 'lzTokenFee', type: 'uint256' }, ]}, ], }, ]; const sendParam = { dstEid, to: padHex(account.address, { size: 32 }), amountLD: amount, minAmountLD: amount, extraOptions: '0x0003010011010000000000000000000000000001d4c0', composeMsg: '0x', oftCmd: '0x', }; const { nativeFee } = await publicClient.readContract({ address: ADAPTER, abi: adapterAbi, functionName: 'quoteSend', args: [sendParam, false], }); // 3. Send bridge tx // ... call adapter.send() with the quoted fee ``` ## Endpoint IDs Reference | Chain | Endpoint ID | Confirmations | | - | - | - | | Ethereum | 30101 | 15 blocks | | Base | 30184 | 10 blocks | | Arbitrum | 30110 | 20 blocks | | Etherlink | 30292 | 5 blocks | Higher confirmation counts mean longer wait before the message is attested by DVNs, but greater finality assurance. ## Worked Example: Bridge 10 USDSM from Ethereum to Arbitrum This is a real mainnet bridge transaction. Here's exactly what was called: ```javascript theme={null} import { ethers } from 'ethers'; const provider = new ethers.JsonRpcProvider('https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY'); const signer = new ethers.Wallet('YOUR_KEY', provider); // Ethereum mainnet addresses const USDSM = '0x399B29975CBE313C56269cD5097F5AE097Fa2741'; const ADAPTER = '0x0aFa4BE6fA5ebAf5fFEe3AB9F88EAA3e16c37aDE'; const MINTER_BURNER = '0x6A02e153bCbF9e6BE45C0b49F7F0ABc82859ebD5'; const amount = ethers.parseEther('10'); // 10 USDSM const DST_EID = 30110; // Arbitrum const sendParam = { dstEid: DST_EID, to: ethers.zeroPadValue(signer.address, 32), amountLD: amount, minAmountLD: amount, extraOptions: '0x0003010011010000000000000000000000000001d4c0', // 120k gas composeMsg: '0x', oftCmd: '0x', }; // 1. Quote the LZ fee const adapter = new ethers.Contract(ADAPTER, ADAPTER_ABI, signer); const { nativeFee } = await adapter.quoteSend(sendParam, false); // Result: 0.000117 ETH // 2. Approve MinterBurner (NOT the adapter) const usdsm = new ethers.Contract(USDSM, ERC20_ABI, signer); await (await usdsm.approve(MINTER_BURNER, amount)).wait(); // 3. Send const tx = await adapter.send( sendParam, { nativeFee, lzTokenFee: 0n }, signer.address, { value: nativeFee } ); // TX: 0xc3752bf55496509c38ae94fc94139a3a2e6e1de76f0db02800701197aac06493 ``` **Result:** 10 USDSM burned on Ethereum, 10 USDSM minted on Arbitrum. Delivered in \~3 minutes. Track on LayerZero Scan: [View transaction](https://layerzeroscan.com/tx/0xc3752bf55496509c38ae94fc94139a3a2e6e1de76f0db02800701197aac06493) ## Partner Integration If you're integrating USDSM bridging into a bridge aggregator or dApp: 1. **Approval target is MinterBurner** — not the OFT Adapter. Your router/facet must approve the MinterBurner contract on each chain. See the [overview](/bridge/overview#important-approval-target) for addresses. 2. **Standard OFT interface** — The `adapter.send()` call, parameters, fee quoting, and options encoding are all standard LayerZero V2 OFT. The only non-standard aspect is the approval target. 3. **Token registration data** — Contact the Stable Mint team for integration support and token registry configuration. # Overview Source: https://docs.stablemint.io/bridge/overview Bridge USDSM across chains with LayerZero V2 OFT. USDSM can be bridged across supported chains using [LayerZero V2](https://layerzero.network/) OFT (Omnichain Fungible Token). Transfers use a **burn-and-mint** model — tokens are burned on the source chain and minted on the destination chain. Total supply is always conserved. ## Supported Chains | Chain | USDSM Token | OFT Adapter | MinterBurner | LZ Endpoint ID | | - | - | - | - | - | | Ethereum | `0x399B29975CBE313C56269cD5097F5AE097Fa2741` | `0x0aFa4BE6fA5ebAf5fFEe3AB9F88EAA3e16c37aDE` | `0x6A02e153bCbF9e6BE45C0b49F7F0ABc82859ebD5` | 30101 | | Base | `0x26C358F7c5fEdB20a6ddEf108cD91Efb6B8Da0Cb` | `0x1053BaF5964b82859F6aa140ED2C02f2975075eB` | `0x6bDE51212203aE5d592Cc5180DA2ABBd41c922dE` | 30184 | | Arbitrum | `0x26C358F7c5fEdB20a6ddEf108cD91Efb6B8Da0Cb` | `0x1053BaF5964b82859F6aa140ED2C02f2975075eB` | `0x6bDE51212203aE5d592Cc5180DA2ABBd41c922dE` | 30110 | | Etherlink | `0x6bDE51212203aE5d592Cc5180DA2ABBd41c922dE` | `0xe7F117F87fa650350c3E363ca2C644951d273d1F` | `0x28DA1dFaF5DCa1AF226a2e56B834E8Ec3C495C5A` | 30292 | ## Architecture Each chain has three contracts: * **USDSM** — The ERC-20 token (TransparentUpgradeableProxy) * **USDSMMintBurnOFTAdapter** — LayerZero V2 OFT adapter that handles cross-chain send/receive * **USDSMMinterBurner** — Intermediary that translates between LayerZero's standard interface and USDSM's mint/burn signatures ### How a bridge transfer works ``` Source Chain Destination Chain ──────────── ───────────────── 1. User approves MinterBurner 2. User calls adapter.send() 3. MinterBurner burns USDSM 4. LayerZero sends message ──────────► 5. LayerZero delivers message 6. MinterBurner mints USDSM to user ``` ## Security * **2/2 DVN verification** — Every message is verified by two independent Decentralized Verifier Networks (LZ Labs + Horizen) before delivery * **Explicit library pinning** — Send and receive message libraries are pinned to specific versions per pathway * **Enforced gas options** — Minimum 120,000 gas enforced for `lzReceive` on all pathways ## Important: Approval Target > [!WARNING] > > When bridging USDSM, you must approve the **MinterBurner** contract — not the OFT Adapter. This is because USDSM uses a non-standard mint/burn signature with a deduplication ID, and the MinterBurner handles the `transferFrom` during the burn flow. | Chain | Approve this address (MinterBurner) | | - | - | | Ethereum | `0x6A02e153bCbF9e6BE45C0b49F7F0ABc82859ebD5` | | Base | `0x6bDE51212203aE5d592Cc5180DA2ABBd41c922dE` | | Arbitrum | `0x6bDE51212203aE5d592Cc5180DA2ABBd41c922dE` | | Etherlink | `0x28DA1dFaF5DCa1AF226a2e56B834E8Ec3C495C5A` | This applies to both direct user interactions and partner integrations (e.g., bridge aggregators like LiFi/Jumper). # Price feed Source: https://docs.stablemint.io/feed/price Signed, real-time pricing for Stable Mint tokens. The Price Feed API provides real-time pricing information for Stable Mint tokens. ## API Format ``` GET /v1/price/{chain}/{token} ``` ### Path Parameters | Parameter | Type | Description | Values | | - | - | - | - | | `chain` | string | Blockchain network | `etherlink` | | `token` | string | Token symbol | `usdsm`, `eursm` | ## Response Format ### Example Response ```json theme={null} { "symbol": "USDSM", "contractAddress": "0x6bDE51212203aE5d592Cc5180DA2ABBd41c922dE", "price": "1.00", "priceCurrency": "USD", "timestamp": "2025-11-20T09:02:04.972", "version": "1.0", "signature": "WyAEj75t6D3i5lolnxsvcjF3oIZD0ElB0YbtCnsevvVpz4pofFTx1U0ZNBcZXUx7..." } ``` > [!TIP] > > The signature field contains a base64-encoded RSA signature. Full signature examples are shown in the validation section below. ## Signature Validation The `signature` field in the response is generated from the following payload components concatenated with pipe (`|`) separators: ``` symbol|price|priceCurrency|timestamp|version ``` ### JavaScript Validation Example ```javascript theme={null} const crypto = require('crypto'); function validateSignature(response, publicKey) { // Construct the payload string const payload = `${response.symbol}|${response.price}|${response.priceCurrency}|${response.timestamp}|${response.version}`; // Create verifier const verifier = crypto.createVerify('RSA-SHA256'); verifier.update(payload); // Verify signature const isValid = verifier.verify( publicKey, response.signature, 'base64' ); return isValid; } // Example usage const response = { symbol: "EURSM", price: "1.00", priceCurrency: "EUR", timestamp: "2025-11-20T08:43:45.908", version: "1.0", signature: "cat1nQMbTZL1HrXuLoFSQNIMmf/bLLmdRS/L9fZkUPjHUZ+wHr+UOveX09QO4OIZjFmAQSlRUsJUeQ8DA/MTBb8klrh1YbnoulkrfHWtvKHwurRUY8WH/WhzdaT7bnaymOtRZIugO0utizlPezuVcUgodVOx9MCSW8Bv6wyuQ+LzHSwaE78jhGb6KyPW15avUtRnboGtSsBV/Hpvnly3CXpoFDyREguCoi2v209EG9JufVeIIhPZx3YiNsgsSCq9U2Z+/Wxn1VtkXs7er9jlZ1PnDchYjoMKybGJ9yGpxgpDqja7ps0LtCdbeO+4jubosl+RWo6T/BtdqLUtilB7bg==" }; const publicKey = `-----BEGIN PUBLIC KEY----- [PUBLIC KEY HERE] -----END PUBLIC KEY-----`; const isValid = validateSignature(response, publicKey); console.log('Signature valid:', isValid); ``` ## Production Environment Base URL: `https://feed.stablemint.io` ### Public Key The following public key should be used to validate the payload signature: ``` -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtoGE5deMyvfEalpKsndv bn7EWr9XAkQwkIK4X7877bMhk59+STQU5wFDjIRhnwePb2VqmGEFj0ddPDj4jPx7 cBxB0l0tC4bozP7YTbrEyvgGGVIhtGDm+PidQwnfTzJIu6n622zyeA0cakuzVTNK 7c2BELtsdyJoGTohQURZ/4A2hVnryfN3p641sLLwllA7D9Qme5f3JRhigGOI/MbU UTPfz6GDxrEoyl3w8MNn5nO7h2yWjek0a2oCc9KxW4ENnjL8h2WQjYWMJCVKnvCn 7nA3GuJxMipHIm/ROtVsQ9ISBNGK7KynEpP1saaTApd5aSeYlTPex1IPTMYxxK80 HwIDAQAB -----END PUBLIC KEY----- ``` ### Available Endpoints **USDSM on Etherlink** ``` GET https://feed.stablemint.io/v1/price/etherlink/usdsm ``` **EURSM on Etherlink** ``` GET https://feed.stablemint.io/v1/price/etherlink/eursm ``` ### Example Request ```bash theme={null} curl https://feed.stablemint.io/v1/price/etherlink/eursm ``` ## Staging Environment Base URL: `https://feed.stablemint.net` ### Public Key The following public key should be used to validate the payload signature: ``` -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmRqV2da+VTB8tC6wIr+G uEtCHrRkkDgG8V+VseT+LYSMz0NKzYVM1ArRQ6Iod0d3A+4D13HanB8Z6bPYHR3a keGkVAJ5L5n8lIIjoME3ol+PGSl0CpmYrva8Q56kNHgUtNa6lztzoOnaWlYD9bgB UY3ye1eVBuDg6mF1UFQgAWsIRbR+IvYuN9SVSI/sI0U5vdBc1HwwgF4CHuPJCcnO mE09SdnSrEA7Uz/JFYydiJ7Dg4vxAhCpNnRW89fSbcBZjRbVTWQPcMWjgz71KcdL 0/lXICCNmro1P2F/yZGqz8xUK8MvnzJFdXIyH9PCzX7NQEnpfxeTxGHeHuoNg5XB WQIDAQAB -----END PUBLIC KEY----- ``` ### Available Endpoints **USDSM on Etherlink** ``` GET https://feed.stablemint.net/v1/price/etherlink/usdsm ``` **EURSM on Etherlink** ``` GET https://feed.stablemint.net/v1/price/etherlink/eursm ``` ### Example Request ```bash theme={null} curl https://feed.stablemint.net/v1/price/etherlink/eursm ``` # Supply Source: https://docs.stablemint.io/feed/supply Total and circulating supply, aggregated across every chain. The Supply API reports the **total** and **circulating** supply of Stable Mint tokens, aggregated across every chain the token is deployed on. Values are returned as `{"result":""}`, the format that listing services such as CoinGecko and CoinMarketCap expect, and every response is signed (RSA-SHA256) so consumers can verify authenticity — see [Signature Validation](#signature-validation). ## API Format ### Total supply ``` GET /v1/supply/{token}/total-supply ``` ### Circulating supply ``` GET /v1/supply/{token}/circulating-supply ``` ### Per-chain breakdown ``` GET /v1/supply/{token} ``` ### Path Parameters | Parameter | Type | Description | Values | | - | - | - | - | | `token` | string | Token symbol | `usdsm` | > [!TIP] > > A token is served only while it is configured for the running environment. `eursm` is reserved but not yet deployed, so requesting it returns `400 Bad Request` until it is configured. ## Response Format ### Total / circulating supply Both endpoints return a JSON object with the supply as a string under `result`, matching CoinGecko's documented supply API example (`https://api.coingecko.com/api/v3/supply/eth`), with `Content-Type: application/json`: ```json theme={null} {"result":"28168334.1"} ``` Circulating supply is always equal to total supply: every minted token is in circulation. There is no locked, vested, or treasury-held supply. So the body stays the minimal `{"result":"..."}` shape that listing services can parse, the signature is returned out-of-band in response headers: | Header | Description | | - | - | | `X-Signature` | Base64-encoded RSA-SHA256 signature | | `X-Signature-Timestamp` | UTC timestamp the figures were read on-chain (`yyyy-MM-ddTHH:mm:ss.fff`) | | `X-Signature-Version` | Signature payload version (e.g. `1.0`) | ### Per-chain breakdown The breakdown endpoint returns the aggregate plus the supply on each chain, with the signature inline. Use it for transparency dashboards or reconciliation. ```json theme={null} { "token": "USDSM", "totalSupply": 28168334.1, "circulatingSupply": 28168334.1, "chains": [ { "chain": "Etherlink", "address": "0x6bDE51212203aE5d592Cc5180DA2ABBd41c922dE", "supply": 21955893.95 }, { "chain": "Ethereum", "address": "0x399B29975CBE313C56269cD5097F5AE097Fa2741", "supply": 5456187.38 }, { "chain": "Base", "address": "0x26C358F7c5fEdB20a6ddEf108cD91Efb6B8Da0Cb", "supply": 386158.64 }, { "chain": "Arbitrum", "address": "0x26C358F7c5fEdB20a6ddEf108cD91Efb6B8Da0Cb", "supply": 370094.14 } ], "timestamp": "2026-06-03T15:13:39.123", "version": "1.0", "signature": "WyAEj75t6D3i5lolnxsvcjF3oIZD0ElB0YbtCnsevvVpz4pofFTx1U0ZNBcZXUx7..." } ``` | Field | Description | | - | - | | `token` | Token symbol | | `totalSupply` | Total supply across all chains, in whole tokens | | `circulatingSupply` | Equal to `totalSupply` | | `chains[]` | Per-chain detail: chain name, contract `address`, and that chain's `supply` | | `timestamp` | UTC timestamp the supply figures were read (`yyyy-MM-ddTHH:mm:ss.fff`) | | `version` | Signature payload version | | `signature` | Base64-encoded RSA-SHA256 signature — see [Signature Validation](#signature-validation) | > [!TIP] > > Supply figures are live on-chain values and change over time. The numbers above are illustrative. ## Signature Validation Every response is signed with RSA-SHA256 over the following payload, concatenated with pipe (`|`) separators: ``` symbol|totalSupply|circulatingSupply|timestamp|version ``` `circulatingSupply` always equals `totalSupply`; for the scalar `/total-supply` and `/circulating-supply` endpoints the returned number is used for both figures. Example signed string: ``` USDSM|28168334.1|28168334.1|2026-06-03T15:13:39.123|1.0 ``` Supply responses are signed with the **same RSA key as the [Price Feed API](/feed/price)** — use the public key published there for your environment (production or staging). ### JavaScript Validation Example The scalar endpoints are the most reliable to validate, because the body is the exact signed value as text (no floating-point rounding): ```javascript theme={null} const crypto = require('crypto'); async function validateSupply(url, token, publicKey) { const res = await fetch(url); // The body is the exact numeric string that was signed — read it as text. const value = (await res.text()).trim(); const timestamp = res.headers.get('X-Signature-Timestamp'); const version = res.headers.get('X-Signature-Version'); const signature = res.headers.get('X-Signature'); // circulatingSupply === totalSupply === value const payload = `${token.toUpperCase()}|${value}|${value}|${timestamp}|${version}`; const verifier = crypto.createVerify('RSA-SHA256'); verifier.update(payload); return verifier.verify(publicKey, signature, 'base64'); } // Example usage (publicKey: see the Price Feed API page for your environment) (async () => { const isValid = await validateSupply( 'https://feed.stablemint.io/v1/supply/usdsm/total-supply', 'usdsm', publicKey ); console.log('Signature valid:', isValid); })(); ``` The breakdown endpoint returns the same signature inline (`signature` field); reconstruct the payload from its `token`, `totalSupply`, `circulatingSupply`, `timestamp`, and `version` fields. > [!WARNING] > > Supply figures can carry up to 18 decimal places. JavaScript's `JSON.parse()` represents numbers as 64-bit floats and may silently lose precision on high-decimal values, which would break breakdown signature validation. For exact validation, prefer a scalar endpoint (its body is the precise string) or parse the breakdown with a precision-preserving JSON / big-decimal library. ## Production Environment Base URL: `https://feed.stablemint.io` ### Available Endpoints **USDSM total supply** ``` GET https://feed.stablemint.io/v1/supply/usdsm/total-supply ``` **USDSM circulating supply** ``` GET https://feed.stablemint.io/v1/supply/usdsm/circulating-supply ``` **USDSM per-chain breakdown** ``` GET https://feed.stablemint.io/v1/supply/usdsm ``` ### Example Request ```bash theme={null} curl https://feed.stablemint.io/v1/supply/usdsm/circulating-supply ``` ## Staging Environment Base URL: `https://feed.stablemint.net` ### Example Request ```bash theme={null} curl https://feed.stablemint.net/v1/supply/usdsm/circulating-supply ``` ## Errors | Status | When | | - | - | | `400 Bad Request` | Unsupported token — only configured tokens are served (currently `usdsm`; `eursm` is not yet deployed) | | `503 Service Unavailable` | Supply for the requested token is temporarily unavailable | # Accounts and balances Source: https://docs.stablemint.io/guides/accounts-and-balances Where your money sits, and what the balance figures actually mean. An **account** is a currency-denominated place your money sits with Stable Mint. You hold one per currency — today EUR and USD. Each account carries an IBAN, the bank behind it, its balance, and a summary of your customers' activity on it. ```bash theme={null} curl "https://api.stablemint.net/v1/accounts?startDate=2026-08-01T00:00:00Z&endDate=2026-09-01T00:00:00Z" \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" ``` **startDate** `string` Optional ISO 8601 timestamp. Bounds the activity window. Omit both to get the default window. **endDate** `string` Optional ISO 8601 timestamp. The response is an array — one entry per currency account you hold. ```json theme={null} [ { "currency": "EUR", "accountHolder": "Acme Payments Ltd", "bankName": "Example Bank", "iban": "MT00XXXX00000000000000000000", "totalBalance": 184320.55, "balance": { "businessBalance": 42180.55, "customerBalance": 142140.00, "totalDeposits": 903412.00, "totalWithdrawals": 761272.00, "netDeposit": 142140.00 }, "customerActivity": { "customerBalance": 142140.00, "depositTotal": 903412.00, "depositAverage": 214.60, "depositTrend": 4.2, "withdrawalTotal": 761272.00, "withdrawalAverage": 188.30, "withdrawalTrend": -1.8, "netDepositTrend": 6.0, "depositWithdrawalRatio": 1.19 } } ] ``` > [!NOTE] > > **One call gives you the account, its balance and the activity summary.** There is no separate > balance endpoint — `balance` and `customerActivity` are nested on each account, so you never have > to make a second call to find out what the account is worth. ## The account itself | Field | Meaning | | - | - | | `currency` | The currency this account is denominated in. | | `accountHolder` | The registered name on the account. | | `bankName` | The bank holding it. | | `iban` | The account's own IBAN. See [virtual IBANs](#virtual-ibans-do-not-hold-balance) below. | | `totalBalance` | Everything on the account: `businessBalance` + `customerBalance`. | ## Reading `balance` You hold **one balance per currency**. `businessBalance` and `customerBalance` split that single pool by who the money is attributable to — they are an accounting view over one balance, not two separate pots. > [card] businessBalance > > Money attributable to you. Fees you have earned, float you have funded, working capital. > [card] customerBalance > > The sum of what your customers hold with you, in aggregate. > [!WARNING] > > **Payouts and conversions draw on `totalBalance`, not on `businessBalance`.** There is no > technical control stopping you from spending past your own funds: a payout is admitted whenever > `totalBalance` covers it, and `businessBalance` will go **negative** when it does not. A negative > `businessBalance` is a real signal — it means your own outflows are being funded by money > attributable to your customers. Track it yourself if that matters to you; the API will not stop > you. | Field | Meaning | | - | - | | `businessBalance` | Money attributable to you. Can go negative — see above. | | `customerBalance` | Money attributable to your customers, in aggregate. | | `totalDeposits` | Completed deposits **into your own funds** — your fundings and conversions in. Deposits made by your customers are **not** counted here; they land in `customerBalance`. | | `totalWithdrawals` | **Completed** withdrawals and conversions out of your own funds, on the same basis. Pending ones are already deducted from `businessBalance` but are not counted here. | | `netDeposit` | `totalDeposits` − `totalWithdrawals`, so also business-scoped. | > [!WARNING] > > **Reconcile against `totalBalance`, never against `netDeposit`.** `netDeposit` is a business-scoped > lifetime flow figure, so it will not agree with a balance that also holds customer money — and it > goes negative as soon as you pay out more than you funded. It is a reporting number, not an > accounting one. ## Reading `customerActivity` `customerActivity` is a **reporting summary**, not a ledger. It describes how your customers have behaved on this account over the requested window. | Field | Meaning | | - | - | | `customerBalance` | Aggregate customer holdings. Same figure as `balance.customerBalance`. | | `depositTotal` | Value deposited by customers in the window. | | `depositAverage` | `depositTotal` divided by the **number of days in the window** — a daily rate, not the size of a typical deposit. | | `depositTrend` | `depositTotal` as a **percentage of** the preceding window, not the change between them. `100` means flat, `0` when the preceding window was empty. | | `withdrawalTotal` | Value withdrawn by customers in the window. | | `withdrawalAverage` | `withdrawalTotal` divided by the number of days in the window, as `depositAverage`. | | `withdrawalTrend` | `withdrawalTotal` as a percentage of the preceding window, as `depositTrend`. | | `netDepositTrend` | Net flow as a percentage of the preceding window's net flow. `0` when that nets to zero. | | `depositWithdrawalRatio` | Deposits divided by withdrawals, **as a percentage**. `100` when there were no withdrawals — not infinity, and not an error. | > [!WARNING] > > **Do not reconcile against these figures.** They are shaped for dashboards — trends, averages and > ratios over a window you chose. Use [Transactions](/guides/transactions) when you need the > individual movements that make up a number. ## Virtual IBANs do not hold balance You may have several IBANs pointing at one account — a partner IBAN, and a virtual IBAN for each customer you provision one for. These are **entry points, not accounts**. Money arriving at any of them lands on the same underlying currency account. This matters when you reconcile: a virtual IBAN tells you *who sent it*, not *where it is held*. There is one balance per currency, regardless of how many IBANs feed it. See [Customers](/guides/customers) for how virtual IBANs attribute an incoming payment to a specific customer. ## What is not here yet > [!NOTE] > > There is no per-customer spendable balance. You can see deposit, withdrawal and net figures in > aggregate, but Stable Mint does not compute an authoritative balance for an individual customer. > If you credit or debit your customers for anything that is not a deposit or a withdrawal — > yield, winnings, losses, fees — that movement is invisible to us and you must hold the balance > yourself. [Customers](/guides/customers) covers this in full. # Authentication Source: https://docs.stablemint.io/guides/authentication Sign every request with your service account's RSA key. Every call to the Stable Mint API is signed. There are no bearer tokens, no OAuth client-credentials flow, and no plain API-key header. You send four headers and an RSA signature computed over a canonical string. > [!WARNING] > > **Never send an `Authorization` header on a signed request.** Any `Bearer` token is rejected with > `401` `jwt_not_accepted` before the request reaches a handler — whether or not the token is valid, > and whether or not you also sent correct signature headers. The token is never parsed; its mere > presence is the rejection. If your HTTP client sets an `Authorization` header globally, remove it > for Stable Mint calls. ## The four headers | Header | Value | | - | - | | `ApiKey` | Your service account's API key. | | `Timestamp` | Unix epoch **seconds**. Rejected outside a 60-second window. | | `Nonce` | A UUID, unique per request. Replays are rejected. | | `Signature` | Base64 RSA-SHA256 (PKCS#1 v1.5) over the canonical string. | All four are required. Sending some but not all returns `401` with `code: signature_required`. Sending a dashboard session token returns `401` with `code: jwt_not_accepted`. > [!NOTE] > > Some operations additionally require a permission on your service account. A **valid signature > without the required permission returns `403`, not `401`** — if you are getting `403`, your > signing is fine and the fix is a permission grant, not a code change. See > [Service accounts](/guides/service-accounts). ## The canonical string Seven fields, joined with a single line feed (`\n`, U+000A), in exactly this order. **No trailing newline.** ``` {HTTP_METHOD}\n {PATH}\n {CANONICAL_QUERY}\n {TIMESTAMP}\n {NONCE}\n {API_SECRET}\n {BODY_SHA256_HEX} ``` **HTTP\_METHOD** `string` Uppercase verb — `GET`, `POST`, `PUT`, `DELETE`. **PATH** `string` The request path only — no scheme, host or query — with its leading slash, and byte-identical to the path you actually send, including casing. Sign the **decoded** form: if your URL contains percent-encoded segments, `/x/a%20b` is signed as `/x/a b`. **CANONICAL\_QUERY** `string` Empty string when there is no query. Otherwise: split into key/value pairs; sort by key in **byte order**, ties broken by value; re-encode keys and values with RFC 3986 percent-encoding (uppercase hex, space as `%20`, never `+`); join as `key=value` with `&`. Byte order puts uppercase before lowercase — `Z` sorts before `a`. A locale-aware or case-insensitive sort will produce a different string and fail verification. **TIMESTAMP** `string` Byte-identical to the `Timestamp` header. Seconds, not milliseconds. **NONCE** `string` Byte-identical to the `Nonce` header. Must parse as a UUID; use lowercase `8-4-4-4-12`. **API\_SECRET** `string` Your service account's API secret. It is part of the signed content — it is **never** sent as a header. **BODY\_SHA256\_HEX** `string` Lowercase hex SHA-256 of the raw request body bytes. An empty body hashes to `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`. Sign the UTF-8 bytes of that string with `RSASSA-PKCS1-v1_5` over SHA-256, then base64-encode the result. > [!TIP] > > **Sign the path you send.** The gateway rewrites paths internally before forwarding, and it > carries the path you signed across that rewrite for you. So you always sign the public `/v1/...` > path — never an internal one. ## A worked example ```javascript Node.js theme={null} import crypto from 'node:crypto'; const API_KEY = process.env.STABLEMINT_API_KEY; const API_SECRET = process.env.STABLEMINT_API_SECRET; const PRIVATE_KEY = process.env.STABLEMINT_PRIVATE_KEY; // PEM, matches the uploaded public key const BASE_URL = 'https://api.stablemint.net'; // encodeURIComponent leaves !'()* unescaped; RFC 3986 requires them escaped. function encodeRfc3986(value) { return encodeURIComponent(value).replace( /[!'()*]/g, (c) => '%' + c.charCodeAt(0).toString(16).toUpperCase(), ); } // Plain < / > on strings compares by code unit, which is the byte order the // server expects. Do not use localeCompare — it is case-insensitive by default // and will sort 'a' before 'Z'. function canonicalQuery(searchParams) { const pairs = [...searchParams.entries()].sort( (a, b) => (a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0), ); return pairs.map(([k, v]) => `${encodeRfc3986(k)}=${encodeRfc3986(v)}`).join('&'); } export async function call(method, path, body) { const url = new URL(path, BASE_URL); const rawBody = body === undefined ? '' : JSON.stringify(body); const timestamp = Math.floor(Date.now() / 1000).toString(); const nonce = crypto.randomUUID(); const bodyHash = crypto.createHash('sha256').update(rawBody, 'utf8').digest('hex'); const canonical = [ method.toUpperCase(), url.pathname, canonicalQuery(url.searchParams), timestamp, nonce, API_SECRET, bodyHash, ].join('\n'); const signature = crypto .sign('sha256', Buffer.from(canonical, 'utf8'), { key: PRIVATE_KEY, padding: crypto.constants.RSA_PKCS1_PADDING, }) .toString('base64'); const response = await fetch(url, { method, headers: { 'Content-Type': 'application/json', ApiKey: API_KEY, Timestamp: timestamp, Nonce: nonce, Signature: signature, // Do not set Authorization. }, // Send exactly the bytes you hashed — do not re-serialise. body: rawBody === '' ? undefined : rawBody, }); if (!response.ok) { throw new Error(`${response.status} ${await response.text()}`); } return response.json(); } ``` ```python Python theme={null} import base64, hashlib, json, os, time, uuid from urllib.parse import quote, urlsplit, parse_qsl import requests from cryptography.hazmat.primitives import hashes, serialization from cryptography.hazmat.primitives.asymmetric import padding API_KEY = os.environ["STABLEMINT_API_KEY"] API_SECRET = os.environ["STABLEMINT_API_SECRET"] BASE_URL = "https://api.stablemint.net" private_key = serialization.load_pem_private_key( os.environ["STABLEMINT_PRIVATE_KEY"].encode(), password=None ) def canonical_query(query: str) -> str: pairs = sorted(parse_qsl(query, keep_blank_values=True)) return "&".join(f"{quote(k, safe='')}={quote(v, safe='')}" for k, v in pairs) def call(method: str, path: str, body=None): parts = urlsplit(path) raw_body = "" if body is None else json.dumps(body, separators=(",", ":")) timestamp = str(int(time.time())) nonce = str(uuid.uuid4()) body_hash = hashlib.sha256(raw_body.encode()).hexdigest() canonical = "\n".join( [ method.upper(), parts.path, canonical_query(parts.query), timestamp, nonce, API_SECRET, body_hash, ] ) signature = base64.b64encode( private_key.sign(canonical.encode(), padding.PKCS1v15(), hashes.SHA256()) ).decode() response = requests.request( method, BASE_URL + path, headers={ "Content-Type": "application/json", "ApiKey": API_KEY, "Timestamp": timestamp, "Nonce": nonce, "Signature": signature, }, data=raw_body or None, ) response.raise_for_status() return response.json() ``` ## What a signed request looks like on the wire ```http theme={null} GET /v1/accounts HTTP/1.1 Host: api.stablemint.net ApiKey: your-api-key Timestamp: 1789000000 Nonce: 7c1a2f4e-9c1b-4d5e-8b0a-1f2c3d4e5f60 Signature: TWlu…base64…dA== ``` ## Troubleshooting Every rejection carries a `code` in its [problem+json body](/guides/errors). Branch on that, never on `detail`. > [accordion] 401 signature\_required > > One or more of the four headers is missing. Partial header sets are treated the same as no > credentials at all. > [accordion] 401 jwt\_not\_accepted > > You sent an `Authorization: Bearer …` header. The public API does not accept dashboard session > tokens, and sending one alongside correct signature headers is rejected just the same — the > token is never parsed, so whether it is valid makes no difference. Remove the header and sign > the request. > [accordion] 401 signature\_invalid > > All four headers were present, but the signature did not verify. In order of likelihood: the > body you hashed is not byte-identical to the body you sent (re-serialising JSON between > hashing and sending is the usual cause); the query string was not canonicalised; you signed a > different path than you sent; or your clock is more than 60 seconds out. > [accordion] 401 signature\_invalid on a retry > > Nonces are single-use, so a replayed one fails exactly like a bad signature. Generate a fresh > UUID for every attempt, including retries. > [accordion] 403 permission\_denied > > The signature verified — this is never a signing problem. Your service account lacks the > permission the operation requires; grant it in the > [Developer Hub](https://dashboard.stablemint.net/) and retry. See > [Service accounts](/guides/service-accounts). > [accordion] 403 feature\_not\_enabled > > The signature and the permissions are both fine. The operation belongs to a feature that is not > provisioned for your account, so no permission grant will open it — ask your Stable Mint contact > to enable it. ## Next > [card] [Service accounts](/guides/service-accounts) > > Create credentials and grant permissions. > [card] [Quickstart](/quickstart) > > Make your first call. # Beneficiaries Source: https://docs.stablemint.io/guides/beneficiaries Register a destination once, then pay it by id. A beneficiary is a saved destination — a bank account or a wallet address — that you pay by id. A payout cannot go to a raw account number or wallet address, so registering a beneficiary is the first step of every [payout](/guides/payouts). Withdrawals to your customers' bank accounts do not use beneficiaries — see [Customers](/guides/customers#withdraw-to-a-customers-bank-account). > [!NOTE] > > Every example on this page is a signed request. `$SIGNATURE` is computed per request over a > canonical string — see [Authentication](/guides/authentication). Bearer tokens are not accepted. ## Create a beneficiary ```bash theme={null} curl -X POST https://api.stablemint.net/v1/beneficiaries \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "beneficiaryName": "Acme Oy", "type": "Business", "isAccountOwner": false, "rail": "Sepa", "railDetails": { "iban": "FI2112345600000785" }, "countryCode": "FI", "alias": "acme-treasury" }' ``` ### Required fields **beneficiaryName** `string` *required* The registered name on the destination account. This is the name checked against the account on the fiat rails. **type** `string` *required* `Business` or `Personal`. The API reference marks this optional because older clients omit it — **partners must send it**, and a request without it is rejected. **isAccountOwner** `boolean` *required* Whether the account belongs to you. Send `false` when paying a third party. **rail** `string` *required* `Sepa`, `Swift` or `Wallet`. The rail fixes what the beneficiary can receive and cannot be changed afterwards. **railDetails** `object` *required* The identifiers for that rail. Which subfields are required depends on `rail` — see below. ### `railDetails` per rail | `rail` | Required | Also accepted | Notes | | - | - | - | - | | `Sepa` | `iban` | `bic` | The IBAN is validated and normalised before it is stored. | | `Swift` | `iban` **and** `bic` | — | Both are required; an absent or malformed BIC is rejected. | | `Wallet` | `walletAddress` | — | Must be a valid EVM address. It is stored checksummed, so the casing you get back may differ from the casing you sent. | ### Optional fields **alias** `string` Your own label for this destination. Handy when one counterparty has several accounts. **countryCode** `string` ISO 3166-1 alpha-2, exactly two characters. **accountVerificationId** `string` The id of a completed payee-verification check, where your flow runs one first. > [!NOTE] > > The API reference also lists `accountType` and `account` as an alternative to `rail` and > `railDetails`. That pair is a legacy shape kept working for older clients — use `rail` and > `railDetails` for anything new. ### Response `201 Created`. The response carries the `id` you pay against, and `accountMasked` alongside the full `account`. ```json theme={null} { "id": "3f2a9c14-7b5e-4d21-9c6a-8e0f1d2b3c45", "beneficiaryName": "Acme Oy", "type": "Business", "isAccountOwner": false, "rail": "Sepa", "railDetails": { "iban": "FI2112345600000785", "bic": null }, "accountMasked": "FI21********0785", "alias": "acme-treasury", "countryCode": "FI", "createdAt": "2026-09-15T09:12:44Z" } ``` > [!WARNING] > > **The rail decides which payout endpoint accepts it.** A `Sepa` or `Swift` beneficiary is paid > with `POST /v1/payouts/fiat`; a `Wallet` beneficiary with `POST /v1/payouts/token`. Sending one > to the wrong endpoint fails with `400`, not `404` — see [Payouts](/guides/payouts). ## List beneficiaries ```bash theme={null} curl "https://api.stablemint.net/v1/beneficiaries?rail=Wallet&page=1&pageSize=50" \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" ``` Filter with `rail`, `accountType`, `beneficiaryName`, `alias`, `name`, `isAccountOwner`, `id` and `createdAt`; page with `page` and `pageSize`; order with `sortBy` and `sortDirection`. The `externalStablecoinStatus` filter and the `externalStablecoin` field on a beneficiary belong to USDC payouts, which are enabled per account — see [USDC to external wallets](/guides/payouts-stablecoin#usdc-to-external-wallets). Until then the field is absent from responses. > [!WARNING] > > **A query string is part of the signature.** Sort and percent-encode it exactly as > [the canonical string](/guides/authentication#the-canonical-string) requires, or the request > fails with `401` `signature_invalid` — the filters themselves are fine. ## Read one ```bash theme={null} curl https://api.stablemint.net/v1/beneficiaries/3f2a9c14-7b5e-4d21-9c6a-8e0f1d2b3c45 \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" ``` A beneficiary belonging to another partner returns `404`, not `403`. ## Update Only the label is editable. **The id goes in the body, not the path.** ```bash theme={null} curl -X PUT https://api.stablemint.net/v1/beneficiaries \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "id": "3f2a9c14-7b5e-4d21-9c6a-8e0f1d2b3c45", "alias": "acme-treasury-eur", "name": "Acme Oy" }' ``` **id** `string` *required* The beneficiary to rename. **alias** `string` *required* The new alias. **name** `string` An optional display name. > [!NOTE] > > **Account details are immutable.** There is no way to repoint a beneficiary at a different IBAN > or wallet address — create a new one and delete the old. That is deliberate: a destination that > can be edited is a destination that can be edited by mistake. ## Delete ```bash theme={null} curl -X DELETE https://api.stablemint.net/v1/beneficiaries/3f2a9c14-7b5e-4d21-9c6a-8e0f1d2b3c45 \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" ``` `204 No Content`. Past payouts to the beneficiary are unaffected — deleting it removes the destination, not the history. ## Errors | Status | Meaning | | - | - | | `400` | Failed validation — a bad IBAN or BIC, an invalid wallet address, a missing `type`, or neither `rail`+`railDetails` nor the legacy pair. | | `401` | Signature, timestamp or nonce failed. See [Authentication](/guides/authentication). | | `403` | Valid signature, but the service account lacks the beneficiary permission. | | `404` | No such beneficiary, or it is not yours. | | `409` | On create, a beneficiary with those account details already exists. On delete, another request changed the beneficiary at the same moment — read it again, then retry. | ## Next > [card] [Fiat payouts](/guides/payouts-fiat) > > Pay a `Sepa` or `Swift` beneficiary. > [card] [Stablecoin payouts](/guides/payouts-stablecoin) > > Pay a `Wallet` beneficiary. # Customers Source: https://docs.stablemint.io/guides/customers Hold and attribute money for your own end users. A **customer** is one of your end users. You create them, you own the relationship, and Stable Mint never contacts them. What Stable Mint does is hold and attribute their money: incoming payments are reconciled to the right customer, and their deposits and withdrawals are tracked separately from your own. In the API they are simply `customers`. Internally you may see them called customers. ## Two ways to attribute an incoming payment This is the first decision to make, and it has a cost attached. > [card] A virtual IBAN per customer > > Provision each customer their own IBAN. Anything arriving at it is attributed to that customer > automatically — no reference needed, nothing for the payer to get wrong. > [card] A shared IBAN plus a reference > > Customers pay into your account and quote a reference you generated. You call the deposit > endpoint first to mint that reference, then reconcile on it. > [!WARNING] > > **Virtual IBANs are chargeable.** Each one carries a cost that Stable Mint passes through to you. > A reference-based deposit does not. For a customer who pays once, the reference is usually right; > for one who pays repeatedly, the dedicated IBAN pays for itself in reconciliation you no longer > have to do. You can mix both across your customer base, and a customer with a virtual IBAN can still be sent a reference-based deposit. ## Create a customer ```bash theme={null} curl -X POST https://api.stablemint.net/v1/customers \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "partnerCustomerIdentifier": "acct_88213", "email": "maria@example.com", "kyc": { "customerType": "Individual", "fullName": "Maria Silva", "residenceAddress": "Rua Augusta 12, 1100-048 Lisboa, Portugal", "citizenshipCountryCode": "PT", "dateOfBirth": "1988-04-02" } }' ``` `partnerCustomerIdentifier` is **your** identifier for this person. Pass the primary key you already use and every Stable Mint record stays joinable to your own database. Stable Mint returns its own `guid`, which is what the rest of the API takes. | Field | Required | Notes | | - | - | - | | `partnerCustomerIdentifier` | Yes | Your id for the customer. | | `email` | No | | | `kyc.customerType` | Yes | `Individual` or `Business`. | | `kyc.fullName` | Yes | Legal name for an individual, registered name for a business. | | `kyc.residenceAddress` | Yes | | | `kyc.citizenshipCountryCode` | Yes | ISO 3166-1 alpha-2. | | `kyc.dateOfBirth` | No | Individuals. | | `kyc.mobilePhone` | No | | | `kyc.personalIdentificationNumber` | No | | | `kyc.uboFirstName1–5` / `uboLastName1–5` | No | Beneficial owners, for `Business` customers. Up to five. | > [!NOTE] > > Send only what you are asked for. Every additional identity field you pass is personal data > Stable Mint then holds on your behalf, and it widens your obligations under GDPR without widening > what the platform can do for you. ## Provision a virtual IBAN ```bash theme={null} curl -X POST https://api.stablemint.net/v1/customers/{id}/account \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" ``` The account is opened in the customer's name. The response carries an `iban` and `country`, plus an `ibans` array — a customer may end up with more than one IBAN, in different countries, all feeding the same underlying balance. Check the customer before you call it. Every customer response carries `canRequestPobo`, which is `true` once the KYC details are complete enough to open an account in the customer's name, and `missingFields`, which lists the fields still blocking it (for example `kyc.residenceAddress`, or `kyc.uboFirstName1` for a business with no beneficial owner). Provisioning a customer whose `canRequestPobo` is `false` fails with `422` and the same `missingFields` list, so update the customer first. > [!WARNING] > > **Get the identity right before you provision.** The virtual IBAN is opened using the customer's > KYC details, so changing those details afterwards does not re-issue the account. Updating a > customer who already holds a virtual IBAN is restricted for this reason — treat the identity as > settled at the point you call this endpoint. ## Create a reference-based deposit For customers without their own IBAN. You tell Stable Mint a payment is expected; it returns the reference and the account to pay into. ```bash theme={null} curl -X POST https://api.stablemint.net/v1/customers/{id}/deposit \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "amount": 2500.00, "currency": "EUR", "idempotencyKey": "dep-2026-09-14-001" }' ``` ```json theme={null} { "customerGuid": "8f2c...", "customerId": "8f2c...", "amount": 2500.00, "currency": "EUR", "reference": "SM-4K2P-9QX7", "publicReference": "SM-4K2P-9QX7", "status": "Pending", "expiresAt": "2026-09-21T23:59:59Z", "fundingInstructions": { "beneficiaryName": "Acme Payments Ltd", "bankName": "Example Bank", "iban": "MT00XXXX00000000000000000000", "bic": "XXXXMTMT" } } ``` Show `fundingInstructions` and `publicReference` to your customer verbatim. A payment that arrives without the reference, or after `expiresAt`, has nothing to match against and needs manual reconciliation. Always send an `idempotencyKey` — a retried call with the same key returns the original deposit instead of creating a second one. ## Withdraw to a customer's bank account Pays one of your customers from your balance, straight to their bank account. You send the IBAN and the account holder's details on the call itself — unlike a [payout](/guides/payouts), there is no beneficiary to register first. ```bash theme={null} curl -X POST https://api.stablemint.net/v1/customers/{id}/withdrawal \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "amount": 750.00, "currency": "EUR", "creditorAccount": "PT50000201231234567890154", "creditorName": "Maria Silva", "creditorCountryCode": "PT", "remittanceInformation": "Cash-out acct 88213", "idempotencyKey": "wd-2026-09-14-001" }' ``` `{id}` is the customer's `guid`, the same id the deposit endpoint takes. The money leaves your balance in `currency`, so you must hold an account in that currency with enough in it. | Field | Required | Notes | | - | - | - | | `amount` | Yes | Greater than zero. | | `currency` | Yes | `EUR` or `USD`. | | `creditorAccount` | Yes | The IBAN to pay into. | | `creditorName` | Yes | The account holder's name. Up to 140 characters. | | `creditorCountryCode` | Yes | The account holder's country. ISO 3166-1 alpha-2. | | `remittanceInformation` | No | Shown to your customer on the bank transfer. Up to 140 characters — see below. | | `creditorBic` | No | 8 or 11 characters. | | `creditorAddress` | No | The account holder's address. Up to 255 characters. | | `withdrawalReason` | No | `CashOut` (the default) or `Refund`. | | `idempotencyKey` | No | Optional on the wire, but always send one. | `remittanceInformation` must pass the banks' rules for a payment reference: letters, digits, spaces and `/ - ? : ( ) . , ' +` only, not starting with `:` or `-`, and never containing `//`. Anything else fails with `400` before any money moves. ```json theme={null} { "reference": "SM-2026-0000004502", "publicReference": "Cash-out acct 88213", "customerId": "8f2c...", "status": "Pending", "amount": 750.00, "currency": "EUR" } ``` `201 Created` on first submission, `200 OK` with the same body on an idempotent replay. `publicReference` echoes the `remittanceInformation` you sent, or is `null` if you sent none. Use `reference` to look the withdrawal up in [Transactions](/guides/transactions). > [!WARNING] > > A `201` means the withdrawal was **accepted**, not that it was paid. `status` is `Pending` on > creation, and stays `Pending` while the withdrawal is under compliance review. Treat `status` as > an open set of strings, as for [payouts](/guides/payouts#status-is-the-outcome-not-the-http-code). | Status | Meaning | | - | - | | `400` | Failed validation, or you hold no account in `currency`. | | `401` | Signature, timestamp or nonce failed. See [Authentication](/guides/authentication). | | `402` | Insufficient balance, with `code: insufficient_balance`. Nothing is created. | | `403` | Valid signature, but the service account is not allowed to make this call. | | `404` | No such customer, or the customer is not yours. | | `409` | `idempotency_key_reuse` — same key, different request. | > [!NOTE] > > A withdrawal created through this endpoint sends `partner.customer.withdrawal.accepted` and then > `partner.customer.withdrawal.sent`. It does **not** send `partner.customer.withdrawal.requested`: > the call is the request, and its response is your confirmation. See > [Event types](/guides/event-types). Always send an `idempotencyKey` — a retried call with the same key and the same request returns the original withdrawal instead of paying your customer twice. Reusing a key with a different request returns `409`. Generate the key from something stable in your own system, such as the id of the cash-out request, so that a retry sends the same key. ## Customer balances are not spendable balances > [!WARNING] > > The `customerActivity` figures on [`GET /v1/accounts`](/guides/accounts-and-balances) are > **deposit, withdrawal and net figures** — not an authoritative balance, and they are aggregate > across your customers rather than per customer. > > Stable Mint knows what came in and what went out. It does not know about anything that changed a > customer's position without moving through the platform: winnings, losses, yield you pay, fees you > charge. If your product does any of those, `customerBalance` is **not** what your customer can > spend, and you must keep that figure yourself. There is no per-customer balance endpoint. To reconstruct one customer's position, list their transactions and sum them yourself — see [below](#listing-a-customers-transactions). For a straightforward pass-through model — money in, money out, nothing else — net deposits and the spendable balance are the same number, and you can use it directly. Confirm that describes your product before you rely on it. ## Listing a customer's transactions Use the transactions endpoint with a filter rather than a customer-scoped path: ```bash theme={null} # every customer's completed transactions curl "https://api.stablemint.net/v1/transactions?scope=Customer&status=Completed" \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" ``` For a single customer, add `partnerCustomerGuid`: ```bash theme={null} curl "https://api.stablemint.net/v1/transactions?scope=Customer&partnerCustomerGuid=3f2a9c14-7b5e-4d21-9c6a-8e0f1d2b3c45" \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" ``` See [Transactions](/guides/transactions) for the full filter set. # Errors Source: https://docs.stablemint.io/guides/errors Error shape, status codes, and why a payment failed. Errors come back as [RFC 9457 problem details](https://www.rfc-editor.org/rfc/rfc9457) with a `Content-Type` of `application/problem+json`. ```json theme={null} { "type": "https://tools.ietf.org/html/rfc9110#section-15.5.4", "title": "Forbidden", "status": 403, "detail": "Your service account is authenticated but lacks the permission this operation requires. Grant it in the Developer Hub and retry.", "code": "permission_denied", "instance": "/v1/beneficiaries" } ``` | Field | Use | | - | - | | `status` | The HTTP status, repeated in the body. | | `title` | Short, stable category. | | `code` | Stable machine-readable identifier for the failure. **This is the field to branch on.** | | `detail` | Human-readable specifics. **Log it, do not branch on it** — wording can change. | | `instance` | The path that produced the error. | | `type` | URI identifying the error class. | > [!WARNING] > > Branch on `status` and `code`, and on `errorKey` where a transaction carries one. Never parse > `detail`. ## Authentication and access codes These separate three problems that look identical from the outside: a signing bug, a missing permission, and a feature you have not been provisioned. Each needs a different response from you, and only the first is a bug in your integration. | `code` | Status | Meaning | | - | - | - | | `signature_required` | `401` | One or more of the four signature headers is missing. | | `jwt_not_accepted` | `401` | You sent an `Authorization: Bearer` header. This API never accepts one. | | `signature_invalid` | `401` | All four headers were present, but the signature did not verify — or the nonce was replayed. | | `permission_denied` | `403` | The signature verified; the service account lacks the permission. Never a signing problem. | | `feature_not_enabled` | `403` | The signature and permissions are fine; the feature is not provisioned for your account. Granting a permission will not fix it — ask your Stable Mint contact to enable it. | See [Authentication](/guides/authentication#troubleshooting) for what to change in each case. ## Status codes | Status | Meaning | What to do | | - | - | - | | `400` | Malformed request — bad field, wrong shape, failed validation. | Fix the request. Retrying unchanged will not help. | | `401` | Authentication failed — missing, expired or invalid credentials, or a signature that did not verify. | Check the token or signature. See [Authentication](/guides/authentication). | | `403` | Authenticated, but not permitted. | The service account lacks the permission the operation requires. Grant it in the [Developer Hub](https://dashboard.stablemint.net/) — see [Service accounts](/guides/service-accounts). | | `404` | No such resource, or not yours. | Check the identifier. Stable Mint returns `404` rather than `403` for resources belonging to another partner. | | `409` | Conflict with current state — for example an already-consumed FX preview. | Re-read the resource before retrying. | | `422` | Well-formed, but a business rule refused it — an unsupported report format or currency. | Read `code`. | | `429` | Rate limited. | Back off exponentially and retry. | | `500` | Server error. | Safe to retry idempotent reads. For writes, verify before retrying. | > [!NOTE] > > A `401` on a call that used to work most often means a service-account credential was rotated or an environment was crossed — sandbox credentials do not work against production, and vice versa. > [!WARNING] > > **Insufficient balance is not one status across the API.** A payout answers `402`; an FX preview > answers `400` with a full quote and a `failureReason` of `NoBalance` rather than a problem > document — see [FX conversion](/guides/fx#when-a-preview-is-refused); an FX execute answers `400` > with the title `Not enough balance` — see [Execute](/guides/fx#execute). Branch per endpoint rather > than assuming a status means the same thing everywhere. ## Why a payment failed A failed transaction carries an `errorKey` on `GET /v1/transactions/{reference}`. This is the field to surface to your own support team. | `errorKey` | Meaning | Recoverable | | - | - | - | | `InvalidAccountDetails` | IBAN, BIC or account details rejected. | Yes — correct and resubmit. | | `InvalidWalletAddress` | Destination wallet address invalid for the asset or chain. | Yes — correct and resubmit. | | `CurrencyNotAccepted` | Receiving side will not take that currency. | Yes — use a different currency or beneficiary. | | `BankRejection` | The beneficiary bank declined it. | Sometimes — the reason sits with that bank. | | `BankUnreachable` | The beneficiary bank could not be reached. | Yes — usually transient, retry later. | | `RecipientBlocked` | Recipient is blocked by a compliance control. | **No.** Do not retry. Escalate to your compliance contact. | | `Expired` | Lapsed before completing — typically an unpaid deposit reference. | Yes — create a new one. | | `Failed` | Generic failure with no more specific cause. | Investigate the `timeline`. | > [!WARNING] > > **`RecipientBlocked` is not a technical error.** Retrying it, or routing around it with different details, may constitute circumventing a sanctions or AML control. Stop and escalate. ## Retrying safely > [card] Reads > > `GET` requests are safe to retry. Back off exponentially on `429` and `5xx`. > [card] Writes > > Send an `idempotencyKey` where the endpoint accepts one. Without it, a retry after an ambiguous failure risks creating a duplicate. When a write fails and you cannot tell whether it landed, query [Transactions](/guides/transactions) before retrying rather than assuming either outcome. # Event types Source: https://docs.stablemint.io/guides/event-types Every event you can subscribe to, and its payload. These are the events you can subscribe a webhook to. Each marks a stage in the deposit or withdrawal lifecycle, or a change to a transaction. Every payload uses the [Version 2 webhook format](/guides/webhooks#version-2): the event data is wrapped in an envelope carrying an `eventId` and a `data` object. > [!NOTE] > > **Event names are wire values.** They read `partner.customer.*` because that is the identifier the > platform emits — subscribe with exactly the string shown here. Elsewhere in these docs the people > they describe are simply called your customers. ## Available events | Event | Fires when | | - | - | | [`partner.customer.deposit.created`](#customer-deposit-created) | A deposit has been created for your customer and is waiting to be paid. | | [`partner.customer.deposit.initiated`](#customer-deposit-initiated) | Your customer has started the payment. | | [`partner.customer.deposit.submitted`](#customer-deposit-submitted) | The payment has been submitted to the bank. | | [`partner.customer.deposit.accepted`](#customer-deposit-accepted) | The incoming payment has been accepted and reconciled against the bank. | | [`partner.customer.deposit.failed`](#customer-deposit-failed) | The deposit could not be processed. | | [`partner.customer.deposit.completed`](#customer-deposit-completed) | Funds have settled and the balance is credited. | | [`partner.customer.deposit.expired`](#customer-deposit-expired) | The deposit was not funded in time and will not complete. | | [`partner.customer.withdrawal.requested`](#customer-withdrawal-requested) | A withdrawal has been requested for your customer. Not sent for withdrawals you create with `POST /v1/customers/{id}/withdrawal`. | | [`partner.customer.withdrawal.accepted`](#customer-withdrawal-accepted) | The withdrawal has been accepted for processing. | | [`partner.customer.withdrawal.sent`](#customer-withdrawal-sent) | The withdrawal has been sent to the beneficiary's bank. | | [`partner.customer.withdrawal.failed`](#customer-withdrawal-failed) | The withdrawal could not be completed. | | [`transaction.status.changed`](#transaction-status-changed) | A transaction moves to a new status. | > [!TIP] > > `GET /v1/webhooks/event-types` returns the subscribable event types live, along with the > properties carried by each one. It is the platform's own list, so it can name an event that is > registered but not yet emitted — **this page is the published set**. Subscribe to something that > appears only there and you will simply never be called. ## Deposit events ### partner.customer.deposit.created A deposit has been created for your customer and is waiting to be paid. ```json theme={null} { "eventId": "uuid", "data": { "eventType": "partner.customer.deposit.created", "timestamp": "2026-01-01T00:00:00Z", "amount": 0.0, "currency": "string", "customFields": {}, "customerCitizenshipCountryCode": "string | null", "customerEmail": "string", "customerFullName": "string | null", "customerGuid": "string | null", "customerId": "string", "customerResidenceAddress": "string | null", "endToEndId": "string", "idempotencyKey": "string | null", "partnerCustomerId": "string | null", "partnerName": "string", "paymentCountryCode": "string | null", "paymentMethod": "string", "reference": "string", "sessionId": "string", "websiteReference": "string | null" } } ``` *** ### partner.customer.deposit.initiated Your customer has started the payment. ```json theme={null} { "eventId": "uuid", "data": { "eventType": "partner.customer.deposit.initiated", "timestamp": "2026-01-01T00:00:00Z", "amount": 0.0, "currency": "string", "customFields": {}, "customerEmail": "string", "customerGuid": "string | null", "customerId": "string", "endToEndId": "string", "idempotencyKey": "string | null", "partnerCustomerId": "string | null", "paymentCountryCode": "string", "paymentMethod": "string", "reference": "string", "sessionId": "string", "userIpAddress": "string", "websiteReference": "string | null" } } ``` *** ### partner.customer.deposit.submitted The payment has been submitted to the bank. ```json theme={null} { "eventId": "uuid", "data": { "eventType": "partner.customer.deposit.submitted", "timestamp": "2026-01-01T00:00:00Z", "amount": 0.0, "currency": "string", "customFields": {}, "customerEmail": "string", "customerGuid": "string | null", "customerId": "string", "customerIpAddress": "string", "endToEndId": "string", "idempotencyKey": "string | null", "partnerCustomerId": "string | null", "paymentCountryCode": "string", "paymentMethod": "string", "reference": "string", "sessionId": "string", "websiteReference": "string | null" } } ``` *** ### partner.customer.deposit.accepted The incoming payment has been accepted and reconciled against the bank. ```json theme={null} { "eventId": "uuid", "data": { "eventType": "partner.customer.deposit.accepted", "timestamp": "2026-01-01T00:00:00Z", "amount": 0.0, "currency": "string", "customFields": {}, "customerEmail": "string | null", "customerGuid": "string | null", "customerId": "string", "debtorAccount": "string", "debtorAddress": "string | null", "debtorBic": "string", "debtorCountryCode": "string", "debtorName": "string", "endToEndId": "string", "idempotencyKey": "string | null", "partnerCustomerId": "string | null", "paymentCountryCode": "string | null", "paymentMethod": "string", "reference": "string", "sessionId": "string", "websiteReference": "string | null" } } ``` *** ### partner.customer.deposit.failed The deposit could not be processed. ```json theme={null} { "eventId": "uuid", "data": { "eventType": "partner.customer.deposit.failed", "timestamp": "2026-01-01T00:00:00Z", "amount": 0.0, "currency": "string", "customFields": {}, "customerEmail": "string", "customerGuid": "string | null", "customerId": "string", "customerIpAddress": "string", "endToEndId": "string", "errorDetails": "string | null", "idempotencyKey": "string | null", "partnerCustomerId": "string | null", "paymentCountryCode": "string", "paymentMethod": "string", "reference": "string", "sessionId": "string", "websiteReference": "string | null" } } ``` *** ### partner.customer.deposit.completed Funds have settled and the balance is credited. **This is the event to credit your customer on.** ```json theme={null} { "eventId": "uuid", "data": { "eventType": "partner.customer.deposit.completed", "timestamp": "2026-01-01T00:00:00Z", "amount": 0.0, "blockchainTransactionHash": "string | null", "currency": "string", "customFields": {}, "customerEmail": "string | null", "customerGuid": "string | null", "customerId": "string", "debtorAccount": "string", "debtorAddress": "string | null", "debtorBic": "string", "debtorCountryCode": "string", "debtorName": "string", "endToEndId": "string", "idempotencyKey": "string | null", "partnerCustomerId": "string | null", "paymentCountryCode": "string | null", "paymentMethod": "string", "reference": "string", "sessionId": "string", "websiteReference": "string | null" } } ``` *** ### partner.customer.deposit.expired The deposit was not funded in time and will not complete. Terminal — there will be no later `completed` for this reference, so release anything you were holding against it. ```json theme={null} { "eventId": "uuid", "data": { "eventType": "partner.customer.deposit.expired", "timestamp": "2026-01-01T00:00:00Z", "amount": 0.0, "createdAt": "2026-01-01T00:00:00Z | null", "currency": "string | null", "customFields": {}, "customerGuid": "string | null", "customerId": "string", "endToEndId": "string | null", "expiryDate": "2026-01-01T00:00:00Z | null", "idempotencyKey": "string | null", "partnerCustomerId": "string | null", "reference": "string", "websiteReference": "string | null" } } ``` *** ## Withdrawal events ### partner.customer.withdrawal.requested A withdrawal has been requested for your customer. > [!NOTE] > > Not sent for a withdrawal you create with > [`POST /v1/customers/{id}/withdrawal`](/guides/customers#withdraw-to-a-customers-bank-account). > The response to that call is your confirmation; the first event you receive for it is > `partner.customer.withdrawal.accepted`. ```json theme={null} { "eventId": "uuid", "data": { "eventType": "partner.customer.withdrawal.requested", "timestamp": "2026-01-01T00:00:00Z", "amount": 0.0, "creditorAccount": "string", "creditorAddress": "string | null", "creditorBic": "string | null", "creditorCountryCode": "string", "creditorName": "string", "currency": "string", "customFields": {}, "customerEmail": "string", "customerGuid": "string | null", "customerId": "string", "customerIpAddress": "string", "customerIpCountryCode": "string", "idempotencyKey": "string | null", "partnerCustomerId": "string | null", "reference": "string", "websiteReference": "string | null", "withdrawalReason": "string" } } ``` *** ### partner.customer.withdrawal.accepted The withdrawal has been accepted for processing. ```json theme={null} { "eventId": "uuid", "data": { "eventType": "partner.customer.withdrawal.accepted", "timestamp": "2026-01-01T00:00:00Z", "amount": 0.0, "creditorAccount": "string", "creditorAddress": "string | null", "creditorBic": "string | null", "creditorCountryCode": "string", "creditorName": "string", "currency": "string", "customFields": {}, "customerEmail": "string", "customerGuid": "string | null", "customerId": "string", "customerIpAddress": "string", "customerIpCountryCode": "string", "idempotencyKey": "string | null", "partnerCustomerId": "string | null", "reference": "string", "websiteReference": "string | null", "withdrawalReason": "string" } } ``` *** ### partner.customer.withdrawal.sent The withdrawal has been sent to the beneficiary's bank. ```json theme={null} { "eventId": "uuid", "data": { "eventType": "partner.customer.withdrawal.sent", "timestamp": "2026-01-01T00:00:00Z", "amount": 0.0, "creditorAccount": "string", "creditorAddress": "string | null", "creditorBic": "string | null", "creditorCountryCode": "string", "creditorName": "string", "currency": "string", "customFields": {}, "customerEmail": "string", "customerGuid": "string | null", "customerId": "string", "customerIpAddress": "string", "customerIpCountryCode": "string", "idempotencyKey": "string | null", "partnerCustomerId": "string | null", "reference": "string", "websiteReference": "string | null", "withdrawalReason": "string" } } ``` *** ### partner.customer.withdrawal.failed The withdrawal could not be completed. ```json theme={null} { "eventId": "uuid", "data": { "eventType": "partner.customer.withdrawal.failed", "timestamp": "2026-01-01T00:00:00Z", "amount": 0.0, "creditorAccount": "string", "creditorAddress": "string | null", "creditorBic": "string | null", "creditorCountryCode": "string", "creditorName": "string", "currency": "string", "customFields": {}, "customerEmail": "string", "customerGuid": "string | null", "customerId": "string", "customerIpAddress": "string", "customerIpCountryCode": "string", "errorDetails": "string | null", "idempotencyKey": "string | null", "partnerCustomerId": "string | null", "reference": "string", "websiteReference": "string | null", "withdrawalReason": "string" } } ``` *** ## Transaction events ### transaction.status.changed A transaction moved to a new status. Covers deposits and withdrawals alike, and is the lightest way to track settlement. ```json theme={null} { "eventId": "uuid", "data": { "eventType": "transaction.status.changed", "timestamp": "2026-01-01T00:00:00Z", "amount": 0.0, "currency": "string", "customFields": {}, "customerGuid": "string | null", "idempotencyKey": "string | null", "originatingTransactionReference": "string | null", "partnerGuid": "string | null", "reference": "string", "status": "string", "transactionHash": "string | null", "transactionType": "string", "websiteReference": "string | null" } } ``` ## Common Fields ### Envelope Fields The Version 2 envelope wraps every event: | Field | Type | Description | | - | - | - | | `eventId` | string | Unique identifier for this webhook delivery, useful for idempotency checks | | `data` | object | The event payload containing the fields described in each event section | ### Base Fields All event payloads include these fields in the `data` object: | Field | Type | Description | | - | - | - | | `eventType` | string | The type of event (e.g., `partner.customer.deposit.completed`) | | `timestamp` | string | ISO 8601 UTC timestamp of when the event occurred | ### Customer event fields Every `partner.customer.*` event includes these in its `data` object: | Field | Type | Description | | - | - | - | | `customerId` | string | The unique identifier for the customer | | `reference` | string | The unique reference for the transaction | | `amount` | decimal | The transaction amount | | `currency` | string | The currency code (e.g., EUR, USD) | ### Optional Fields Many events include these optional fields when provided in the original request: | Field | Type | Description | | - | - | - | | `idempotencyKey` | string \| null | A key to ensure idempotent processing | | `websiteReference` | string \| null | Your reference for this transaction | | `customFields` | object \| null | Any additional custom JSON data | ## Testing Webhook Events You can test your webhook implementation by using the Stable Mint sandbox environment. This allows you to simulate different event types and ensure your application handles them correctly. For more information on how to set up and handle webhooks, please refer to our [Receiving Webhooks](/guides/webhooks) guide. For any questions or assistance with webhook events, please contact us at [contact@stablemint.io](mailto:contact@stablemint.io). # FX conversion Source: https://docs.stablemint.io/guides/fx Quote a rate, show it, then execute on it. Converting between two currencies you hold is a two-call flow. You **preview** to get a rate and a `previewId`, then you **execute** against that id. The rate you were shown is the rate you get. This exists because a quote you cannot act on is not useful. Splitting the call lets you show a number to a customer, let them think about it, and settle on that number rather than on whatever the market has moved to by the time they answer. ## Preview Specify **either** `fromAmount` or `toAmount`, not both. `fromAmount` sells a fixed amount; `toAmount` buys a fixed amount and tells you what it will cost. ```bash theme={null} curl -X POST https://api.stablemint.net/v1/fx/preview \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "fromCurrency": "USD", "toCurrency": "EUR", "fromAmount": 100000 }' ``` ```json theme={null} { "previewId": "3f1b9c44-7e2a-4c81-9f0d-2b6a5e8d1c33", "fxRate": 0.9132, "fromCurrency": "USD", "fromAmount": 100000, "toCurrency": "EUR", "toAmount": 91320, "fromCurrencyPreviousBalance": 284500.12, "expiryTime": "2026-09-14T15:32:10Z" } ``` | Field | Meaning | | - | - | | `previewId` | The handle you execute against. | | `fxRate` | All-in rate. Any spread is already in this number — there is no separate fee to add. | | `toAmount` | What you receive. This is the figure to show a customer. | | `fromCurrencyPreviousBalance` | Your balance in the sell currency before the conversion, so you can show the effect without a second call. | | `expiryTime` | After this instant the `previewId` is dead. | Previewing moves no money and has no side effects. Quote as often as you need. ## When a preview is refused A preview Stable Mint will not book comes back as `400` — including when the only thing wrong is that you cannot afford it. The body is **not** a problem document: it is the quote you asked for, plus a `failureReason` saying why it will not be booked, and no `previewId`. ```json theme={null} { "fromCurrency": "USD", "fromAmount": 500000, "toCurrency": "EUR", "toAmount": 456600, "fxRate": 0.9132, "fromCurrencyPreviousBalance": 284500.12, "expiryTime": "2026-09-14T15:32:10Z", "notes": "Insufficient balance: 500000 USD -> 456600 EUR", "failureReason": "NoBalance", "minFromAmount": 1.00, "maxFromAmount": 1000000.00, "minToAmount": 1.00, "maxToAmount": 1000000.00 } ``` | `failureReason` | Meaning | | - | - | | `NoBalance` | Your balance in `fromCurrency` is below `fromAmount`. Compare it against `fromCurrencyPreviousBalance`, which is returned on the same body. | | `AmountOutOfRange` | The amount falls outside the limits, which come back on the response so you can correct it in one step. Read them rather than hard-coding them. | | `InvalidCurrency` | The pair is not convertible. | | `InsufficientMasterLiquidity` | Stable Mint cannot fund a conversion of that size right now. | > [!WARNING] > > **A `400` here does not mean your request was malformed.** `NoBalance` and > `InsufficientMasterLiquidity` are both worth retrying — the first once the account is funded, the > second after a wait — even though [Errors](/guides/errors) treats `400` as "retrying unchanged > will not help" everywhere else. Read `failureReason` before deciding. Check `failureReason` before reaching for `previewId`: a refused preview has no id to execute against. ## Execute ```bash theme={null} curl -X POST https://api.stablemint.net/v1/fx/execute \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "previewId": "3f1b9c44-7e2a-4c81-9f0d-2b6a5e8d1c33" }' ``` > [!WARNING] > > **A `previewId` is single-use.** It is consumed on the first successful execute. Replaying the > same id does not book a second conversion — but it is not an idempotent read either, so treat a > non-success response as an unknown outcome and check > [Transactions](/guides/transactions) for a `Conversion` before retrying with a fresh preview. Execute checks your balance again. If it has fallen below the preview's `fromAmount` since you previewed — a payout or another conversion landed in between — execute fails with `400` and the title `Not enough balance`. The preview is not consumed: once your balance covers it, you can execute the same `previewId` again before `expiryTime`, or re-preview. The response restates the rate and amounts that were booked. It may also carry `scaOperationId` and `maxAttemptCount`, which indicate the conversion requires a strong customer authentication step before it settles; handle those fields if your flow can produce them rather than assuming every execute completes inline. ## Handling expiry **1. Preview, and record expiryTime** Treat it as a hard deadline, not a guideline. **2. Show the rate for less time than you have** Leave yourself enough margin to make the execute call and handle a retry. **3. Re-preview rather than chase** If the quote lapses, get a new one and show the new number. There is no extension mechanism, and executing an expired id fails. > [!NOTE] > > **A conversion is two transactions, not one.** It appears in > [Transactions](/guides/transactions) as a pair sharing `category: "Conversion"` — an `Outward` > leg debiting the sell currency and an `Inward` leg crediting the buy currency. Nothing leaves > Stable Mint, but do not expect a single row, and do not filter on a `transactionDirection` of > `Internal`: conversions never carry it. ## Currencies EUR and USD today, in either direction, between accounts you already hold. You cannot convert into a currency you have no account in. # Glossary Source: https://docs.stablemint.io/guides/glossary Terms used across the Stable Mint platform. The terms below appear throughout these docs and in the API reference. ## Partner A **partner** is the business integrating with Stable Mint — you. You hold the accounts, the balances and the credentials, and you own the relationship with the people paying you. * Authenticates with a [service account](/guides/service-accounts) and an RSA signature on every request * Holds one [account](/guides/accounts-and-balances) per currency * Receives [webhooks](/guides/webhooks) for events on its own and its customers' money * Manages credentials and configuration from the dashboard ## Customer A **customer** is one of your end users. You create them, you own the relationship, and Stable Mint never contacts them — what Stable Mint does is hold and attribute their money. * Identified by a `userId` that you choose and reuse across sessions * Requires an email address and a country code * May be given a virtual IBAN so incoming payments are attributed automatically * May carry KYC or KYB details, supplied by you > [!NOTE] > > Internally, and on the wire, customers appear as **partner customers** — you will see it in event > names like `partner.customer.deposit.completed` and in parameters like `partnerCustomerGuid`. It is > the same thing. Send those identifiers exactly as the reference spells them. See [Customers](/guides/customers). ## Account A currency-denominated place your money sits. One per currency, each with its own IBAN and balance. See [Accounts and balances](/guides/accounts-and-balances). ## Beneficiary A destination you have registered to pay out to — either a bank account or a wallet address. Your own payouts go to a `beneficiaryId`, never to a raw account number. See [Payouts](/guides/payouts). A withdrawal to one of your customers is the exception: it takes the customer's IBAN directly — see [Customers](/guides/customers#withdraw-to-a-customers-bank-account). ## Session A time-limited context for collecting one payment from a customer. Every incoming payment belongs to exactly one session. Created with `POST /v1/checkout/hosted`, and expires at `expiresAt`. See [Payment sessions](/guides/payment-sessions). ## Webhook An HTTP callback Stable Mint sends to notify you about events on your account. Deliveries are signed; verify the signature before acting on one. See [Receiving webhooks](/guides/webhooks). ## Idempotency key A key you generate to make a retry safe. Sending the same key twice returns the original result rather than creating a second session, payout or deposit. ## KYC (Know Your Customer) Identification data for a customer who is an **individual**. Supplied by the partner, not collected by Stable Mint. Typically the person's full name, citizenship and residential address, with date of birth, an identification number and a contact number as supporting detail. ## KYB (Know Your Business) The counterpart to KYC for a customer that is a **business** rather than a person. Set `customerType` to `Business` on the customer's KYC object, and the same fields carry the company's identity rather than an individual's — `fullName` is the registered legal name, `residenceAddress` the registered address. Businesses additionally carry their **ultimate beneficial owners**. Up to five can be supplied, as `uboFirstName1`–`uboFirstName5` and `uboLastName1`–`uboLastName5`. > [!NOTE] > > A richer business record — registration number, country of incorporation, nature of business, legal form, LEI and tax identifier as first-class fields — is specified but not yet live. Today the fields above are what the API accepts. > [!NOTE] > > Both KYC and KYB are **passed to Stable Mint by you**. Stable Mint does not collect them from your customers directly, and does not verify them in the sandbox — see [Customer](#customer) and [Sandbox](/guides/sandbox). ## Virtual IBAN An IBAN that routes to your account but identifies a specific customer. It is an entry point, not a separate balance. See [Accounts and balances](/guides/accounts-and-balances#virtual-ibans-do-not-hold-balance). # Payment sessions Source: https://docs.stablemint.io/guides/payment-sessions Create a hosted checkout, redirect your customer, and act on the webhook. A **payment session** is how you collect money from one of your customers. Every incoming payment belongs to exactly one session: you create it with `POST /v1/checkout/hosted`, redirect your customer to the `url` it returns, and Stable Mint tells you by webhook what happened. > [!WARNING] > > **Accepting payments is enabled per partner, and is off by default.** It is not provisioned > automatically with your account, so this flow does not work out of the box — until it is switched > on for you, `POST /v1/checkout/hosted` answers `403` with `code: feature_not_enabled`, however > correct your credentials are. Request it from your Stable Mint contact before building against > this page. > [!NOTE] > > Every example on this page is a signed request. `$SIGNATURE` is computed per request over a > canonical string — see [Authentication](/guides/authentication). Bearer tokens are not accepted. ## How a session runs **1. You create the session** Send the amount, the currency, who the customer is, and the four URLs you want them returned to. You get back a `url`, a `reference` and an `expiresAt`. **2. Your customer pays** Redirect them to `url`. The checkout is hosted by Stable Mint — it handles the payment method, the bank redirect and the result screens, so none of that lives in your application. **3. They come back to you** The customer lands on whichever of your URLs matches the outcome: success, exit, or error. **4. You act on the webhook** **The redirect is not the source of truth.** Credit the customer when the deposit event arrives — see [Event types](/guides/event-types). > [!WARNING] > > **Never treat a redirect to your `successUrl` as proof of payment.** A browser redirect is under > the customer's control and says only that they reached the end of the flow. The money is confirmed > by `partner.customer.deposit.completed`, and that is the event to act on. ## Create a session ```bash theme={null} curl -X POST https://api.stablemint.net/v1/checkout/hosted \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "userId": "your-customer-8412", "userEmail": "customer@example.com", "userCountryCode": "FI", "currency": "EUR", "amount": 100.00, "successUrl": "https://yourapp.example/pay/success", "exitUrl": "https://yourapp.example/pay/cancelled", "errorUrl": "https://yourapp.example/pay/error", "supportUrl": "https://yourapp.example/support", "userKyc": { "fullName": "Aino Virtanen", "citizenshipCountryCode": "FI", "residenceAddress": "Mannerheimintie 1, 00100 Helsinki" }, "idempotencyKey": "order-8412-attempt-1", "websiteReference": "order-8412" }' ``` ### Required fields **userId** `string` *required* Your own identifier for the customer paying. Reuse it across sessions to keep one identity — see [You identify the customer](#you-identify-the-customer). **userEmail** `string` *required* The customer's email address. **userCountryCode** `string` *required* ISO 3166-1 alpha-2, e.g. `FI`. **currency** `string` *required* The currency to collect, e.g. `EUR`. **amount** `number` *required* The amount to collect. **successUrl** `string` *required* Where the customer lands after paying. Proof of payment is the webhook, not this redirect. **exitUrl** `string` *required* Where the customer lands if they abandon the flow. **errorUrl** `string` *required* Where the customer lands if the payment fails. **supportUrl** `string` *required* Your support page, linked from the checkout. **userKyc** `object` *required* The paying customer's KYC details. Three subfields are required: * `fullName`: the customer's legal name. * `citizenshipCountryCode`: ISO 3166-1 alpha-2 in upper case, e.g. `FI`. * `residenceAddress`: where the customer lives. The rest are optional: `dateOfBirth` (`YYYY-MM-DD`), `placeOfBirth`, `gender`, `mobilePhone`, `personalIdentificationNumber`. A session with a required subfield missing or malformed is refused — see [Missing KYC details](#missing-kyc-details). ### Optional fields **idempotencyKey** `string` Retrying with the same key returns the original session instead of creating a second one — see [Idempotency](#idempotency). **websiteReference** `string` Your own reference. Echoed back on the webhook payloads for this payment. **customFields** `object` Arbitrary JSON carried through to the webhook payloads untouched. **widgetConfigurationSlug** `string` Selects which saved checkout configuration to apply — theming, labels and behaviour. Set these up in the dashboard. Omit it to use your default. ## Response ```json theme={null} { "url": "https://checkout.stablemint.io/s/550e8400-e29b-41d4-a716-446655440000", "expiresAt": 1790123456, "reference": "ref_session_xyz789" } ``` | Field | Meaning | | - | - | | `url` | The hosted checkout. Redirect your customer here. | | `expiresAt` | Unix timestamp in seconds. After this the URL no longer starts a payment. | | `reference` | The session's reference. Store it — it ties the webhooks back to this payment. | > [!TIP] > > Store `reference` against your order before you redirect. It is how you match the deposit events > to the thing the customer was buying. ## What happens next The customer pays, returns to one of your URLs, and the deposit events arrive: `partner.customer.deposit.initiated`, then `accepted`, then `completed` — or `expired` if the session is never funded. Credit your customer on `completed`. See [Event types](/guides/event-types) for the payloads and [Receiving webhooks](/guides/webhooks) for registering an endpoint and verifying signatures. ## You identify the customer You own the customer relationship; Stable Mint never contacts them. That means every session carries your own identification of who is paying — `userId`, `userEmail` and `userCountryCode` — and the payment is attributed to that customer. Pass the same `userId` each time and the customer's payments accumulate under one identity, which is what makes their transaction history and balance meaningful. See [Customers](/guides/customers). Every session also carries the customer's KYC details in `userKyc`. Stable Mint uses them to register the customer the first time they pay, so a session without them is refused before anything is created. ## Missing KYC details A session whose `userKyc` is missing or incomplete is refused with `400`, and no session or customer is created. The `code` names the first problem found; fix it and send the request again. | `code` | Cause | | - | - | | `UserKycRequired` | `userKyc` was omitted. | | `UserKycFullNameRequired` | `userKyc.fullName` is missing or empty. | | `UserKycCitizenshipCountryCodeRequired` | `userKyc.citizenshipCountryCode` is missing or empty. | | `UserKycCitizenshipCountryCodeInvalid` | `userKyc.citizenshipCountryCode` is not two upper-case letters, such as `fi` or `FIN`. | | `UserKycResidenceAddressRequired` | `userKyc.residenceAddress` is missing or empty. | ## Sessions expire `expiresAt` is a Unix timestamp in seconds. After it passes, the `url` no longer starts a payment and the customer must be sent through a fresh session. A session that is never funded ends as `partner.customer.deposit.expired`. That event is terminal — it is your signal to release anything you were holding against the pending payment. ## Idempotency Send an `idempotencyKey` and a retried create returns the original session instead of opening a second one. Generate it from something stable in your own system — an order id — rather than a random value that changes on retry. # Payouts Source: https://docs.stablemint.io/guides/payouts Send money out of your balance, to a bank account or a wallet. A payout moves money out of your balance to a **beneficiary** you have already registered. It is a single, idempotent, unattended call: no step-up authentication, no multi-call preview-then-confirm. There are two rails, and they behave the same way in every respect except where the money lands. | Rail | Operation | Money arrives as | | - | - | - | | [Fiat](/guides/payouts-fiat) | `POST /v1/payouts/fiat` | A bank transfer to an account | | [Stablecoin](/guides/payouts-stablecoin) | `POST /v1/payouts/token` | An on-chain transfer to a wallet address | Both take the **same request body**. The rail you call, and the beneficiary you name, decide everything else — there is no rail field, no network field and no token field to set. This page covers what the two rails share. The per-rail pages cover what differs. ## You pay a beneficiary, not an address A payout cannot go to a raw account number or wallet address. You [register a beneficiary](/guides/beneficiaries) first, and then pay out to its `beneficiaryId`. > [!NOTE] > > This applies to payouts. To pay one of your customers to their own bank account, use the > customer withdrawal instead, which takes the IBAN on the call — see [Customers](/guides/customers#withdraw-to-a-customers-bank-account). ```bash theme={null} curl https://api.stablemint.net/v1/beneficiaries \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" ``` A beneficiary is bound to one rail. A bank-rail beneficiary cannot receive a stablecoin payout and a wallet-rail beneficiary cannot receive a fiat one. > [!WARNING] > > **A wrong-rail beneficiary fails with `400`, not `404`.** The beneficiary is yours, so it > resolves; the call then fails on the rail details it does not carry — sending a bank-rail > beneficiary to `POST /v1/payouts/token` returns `400` with `errorKey: InvalidWalletAddress`. > A `404` here means the id is unknown or belongs to another partner, which is a different fix. > Check `rail` on the beneficiary before you pay it. ## Idempotency Every payout requires an `idempotencyKey`, and it is the mechanism that makes a retry safe. * **The key namespace is shared across both rails.** A key used for a fiat payout cannot be reused for a stablecoin payout. * **Replay detection hashes the mapped request, not the raw bytes.** Whitespace or field ordering in your JSON cannot cause a spurious conflict. * **Reusing a key with a different payload returns `409`** with `idempotency_key_reuse`. * A blank key is treated as absent rather than as a value, so blanks do not collide with one another. Send a real key. > [!TIP] > > Generate the key from something stable in your own system — an invoice or order id — rather than > a random value. A random key regenerated on retry defeats the protection entirely. ## `status` is the outcome, not the HTTP code > [!WARNING] > > A `201` means the payout was **accepted**, not that it settled. Treat `status` as an **open set of > strings**, not a fixed enum — new values can be added without a breaking version change, so match > on the values you know and handle the rest gracefully rather than failing closed. > > Settlement is asynchronous on both rails. The terminal state arrives by webhook, never in the > response to the call that created the payout. ## Errors | Status | Meaning | | - | - | | `400` | Malformed request, failed validation, or a beneficiary on the other rail. | | `401` | Signature, timestamp or nonce failed. See [Authentication](/guides/authentication). | | `402` | Insufficient balance. | | `403` | Valid signature, but the service account is not allowed to make this call. | | `404` | No such beneficiary, or it is not yours. | | `409` | `idempotency_key_reuse` — same key, different payload. | ## Tracking a payout The `reference` on the response is the business reference. Use it to look the payout up in [Transactions](/guides/transactions), and subscribe to `transaction.status.changed` to be told when it settles rather than polling. See [Receiving webhooks](/guides/webhooks). # Fiat payouts Source: https://docs.stablemint.io/guides/payouts-fiat Send money from your balance to a bank account. A fiat payout sends money from your balance to a bank-rail beneficiary. Read [Payouts](/guides/payouts) first — idempotency, beneficiaries, error codes and how `status` behaves are shared with the stablecoin rail and are not repeated here. > [!NOTE] > > Every example on this page is a signed request. `$SIGNATURE` is computed per request over a > canonical string — see [Authentication](/guides/authentication). Bearer tokens are not accepted. ## Create a payout ```bash theme={null} curl -X POST https://api.stablemint.net/v1/payouts/fiat \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "idempotencyKey": "invoice-4471", "beneficiaryId": "3f2a9c14-7b5e-4d21-9c6a-8e0f1d2b3c45", "currency": "EUR", "amount": 2500.00, "reference": "invoice-4471" }' ``` **idempotencyKey** `string` *required* Your own unique key for this payout. See [Idempotency](/guides/payouts#idempotency). **beneficiaryId** `string` *required* A bank-rail beneficiary you own. **currency** `string` *required* There is no FX on this rail — `currency` and `amount` apply to both sides of the transfer. To pay out in a currency you do not hold, [convert first](/guides/fx). **amount** `number` *required* The amount to send. **reference** `string` Optional. Echoed back on the response and surfaced on the transaction. Up to 140 characters, which is the scheme ceiling for unstructured remittance information. ## Response `201 Created` on first submission, `200 OK` on an idempotent replay. ```json theme={null} { "reference": "SM-2026-0000004471", "status": "Pending", "amount": 2500.00, "currency": "EUR", "beneficiaryName": "Acme Oy", "beneficiaryAccount": "FI21 1234 5600 0007 85", "idempotencyKey": "invoice-4471" } ``` | Field | Meaning | | - | - | | `reference` | The business reference for this payout. Use it to track settlement. | | `status` | Where the payout is now. An open set of strings — see [Payouts](/guides/payouts#status-is-the-outcome-not-the-http-code). | | `beneficiaryName` | The registered name on the beneficiary you paid. | | `beneficiaryAccount` | The account the money is going to. | | `idempotencyKey` | Echoed back, so a replayed response is self-identifying. | > [!WARNING] > > `201` means accepted for processing. A fiat payout settles on banking-rail timescales, not API > timescales, and can still fail after acceptance — a closed account, a rejected transfer. Subscribe > to `transaction.status.changed` rather than treating the response as final. ## Replacing the old withdrawal endpoint > [!NOTE] > > This endpoint replaces the partner-managed withdrawal call, which was published on a service host > rather than on the public API and took the destination bank details inline on every request. > > The shape is different in one way worth planning for: you no longer send `creditorAccount`, > `creditorName` and the rest of the bank details with the payout. You register the destination once > as a beneficiary and then send its `beneficiaryId`. Migrating means creating beneficiaries for > your existing destinations before you switch the call over. > > If the old call paid your customers rather than your own destinations, move it to the > [customer withdrawal](/guides/customers#withdraw-to-a-customers-bank-account) instead. That call > still takes the bank details inline. # Stablecoin payouts Source: https://docs.stablemint.io/guides/payouts-stablecoin Send tokens from your balance to a wallet address. A stablecoin payout sends tokens from your balance to a wallet-rail beneficiary. Read [Payouts](/guides/payouts) first — idempotency, beneficiaries, error codes and how `status` behaves are shared with the fiat rail and are not repeated here. > [!NOTE] > > Every example on this page is a signed request. `$SIGNATURE` is computed per request over a > canonical string — see [Authentication](/guides/authentication). Bearer tokens are not accepted. ## Create a payout ```bash theme={null} curl -X POST https://api.stablemint.net/v1/payouts/token \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "idempotencyKey": "settlement-2026-09-15-0001", "beneficiaryId": "9c6a8e0f-1d2b-3c45-7b5e-3f2a9c147b5e", "currency": "USD", "amount": 2500.00, "reference": "settlement-4471" }' ``` **idempotencyKey** `string` *required* Your own unique key for this payout. See [Idempotency](/guides/payouts#idempotency). **beneficiaryId** `string` *required* A wallet-rail beneficiary you own. The destination address is taken from the beneficiary — you do not send an address on the payout. **currency** `string` *required* The ISO-4217 code of the currency to send — `USD` or `EUR`. Exactly three characters. **amount** `number` *required* The amount to send. **reference** `string` Optional. Echoed back on the response and surfaced on the transaction. **token** `string` Optional. The token to send — `USDSM` with `USD`, `EURSM` with `EUR`. Omit it and you send the Stable Mint stablecoin for `currency`, exactly as before. A token that does not belong to `currency` is refused with `400` (`The payout token does not match the payout currency`), and an unrecognised one with `400` (`The requested payout token is not supported`). Values are case-sensitive. > [!NOTE] > > **Send the currency code, not the token symbol, in `currency`.** `USD` sends the Stable Mint > stablecoin for US dollars; `USDSM` in `currency` is rejected — `'Currency' must be 3 characters in > length`. If you want to name the token, put it in `token` alongside the currency code. The > response echoes back the code you sent. > [!NOTE] > > **There is no network or chain field.** The chain is selected for you from the beneficiary. If you > need the same token on a different chain, that is a [bridge](/bridge/overview) operation, not a > payout parameter. ## Response `201 Created` on first submission, `200 OK` on an idempotent replay. ```json theme={null} { "reference": "SM-2026-0000004472", "status": "Pending", "amount": 2500.00, "currency": "USD", "token": "USDSM", "beneficiaryName": "Acme Treasury", "destinationAddress": "0xYourBeneficiaryAddress", "idempotencyKey": "settlement-2026-09-15-0001" } ``` The response mirrors the fiat rail, with `destinationAddress` in place of `beneficiaryAccount`, and `token` naming the token that was sent. > [!WARNING] > > **`status` never implies on-chain finality at creation time.** The payout is accepted before it is > broadcast, and confirmation is established by watching the chain afterwards — not by the > submission succeeding. > > Treat the payout as settled only when `transaction.status.changed` says so. An address typo cannot > be undone once the transfer confirms, so verify the beneficiary, not the response. ## USDC to external wallets > [!NOTE] > > **USDC payouts are enabled per account, on request.** The API reference lists the calls involved — > `GET /v1/vasps`, `PUT` and `DELETE /v1/beneficiaries/{id}/external-stablecoin`, the > `externalStablecoin` block on a new beneficiary, and `token: "USDC"` on this endpoint. Until your > account is enabled, preparing a beneficiary for USDC or sending USDC answers `400` with > `USDC payouts are not enabled for this partner`. Talk to your Stable Mint contact before you build > against them. # Reports Source: https://docs.stablemint.io/guides/reports Download an account or transaction statement as CSV. Two endpoints return a statement as a CSV file: a point-in-time view of your balances, and a transaction listing over a period you choose. | Report | Operation | Covers | | - | - | - | | Account statement | `GET /v1/reports/account-statement` | Balances now, one row per currency | | Transaction statement | `GET /v1/reports/transaction-statement` | Settled transactions between two dates | Both respond with `text/csv` as a file download, not JSON. Both require the same permission as reading transactions. > [!NOTE] > > Every example on this page is a signed request. `$SIGNATURE` is computed per request over a > canonical string — see [Authentication](/guides/authentication). Bearer tokens are not accepted. > [!WARNING] > > **The query string is signed.** Both reports take every parameter in the query, including > repeated `currencies`. Sort and percent-encode it exactly as > [the canonical string](/guides/authentication#the-canonical-string) requires, or you get `401` > `signature_invalid` before any of this is evaluated. ## Parameters **format** `string` *required* The only accepted value is `Csv`, matched case-insensitively. The API reference marks this optional — **it is not**. Omitting it fails the request, and any other value returns `422` with `code: ReportFormatNotAllowed`. **currencies** `string[]` *required* Repeat the parameter once per currency: `?currencies=EUR¤cies=USD`. The reference does not mark it required, but an empty list returns `422` with `code: ReportCurrencyNotAllowed`, as does any currency you do not hold an account in. **from** `string` Transaction statement only. UTC date, inclusive. **to** `string` Transaction statement only. UTC date, inclusive. > [!WARNING] > > **Always send `from` and `to` on a transaction statement.** They are not rejected when absent — > they default to the zero date, and you get a CSV headed `Period from,0001-01-01` containing > nothing. The period must not run backwards and cannot exceed 365 days; either returns `422` with > `code: ReportPeriodNotAllowed`. ## Account statement Balances as at the moment you call it. There is no period — `from` and `to` are not read. ```bash theme={null} curl "https://api.stablemint.net/v1/reports/account-statement?currencies=EUR¤cies=USD&format=Csv" \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" \ -o account-statement.csv ``` One row per currency, carrying the total balance alongside the business and customer split. > [!NOTE] > > Total balance is the full account balance, including both business and customer funds. Total > deposits and withdrawals cover business fiat and conversions only, so they do not net to the > total balance — the CSV repeats this in a note line. ## Transaction statement Settled transactions over a period, for the currencies you name. ```bash theme={null} curl "https://api.stablemint.net/v1/reports/transaction-statement?currencies=EUR&format=Csv&from=2026-08-01&to=2026-08-31" \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" \ -o transaction-statement.csv ``` Columns: Transaction ID, Date (UTC), Value Date (UTC), Type, Direction, Status, Description, Counterparty, Counterparty Account, Amount. Dates are inclusive UTC days — `to=2026-08-31` includes everything up to `23:59:59.999` on the 31st. A currency with nothing in the period is still sectioned, marked `No transactions in this period`. > [!NOTE] > > Only settled transactions appear. Something still in flight is in > [Transactions](/guides/transactions) before it is in a statement, so use that endpoint to track a > payout and a statement to reconcile a closed period. ## Errors | Status | `code` | Meaning | | - | - | - | | `422` | `ReportFormatNotAllowed` | `format` was missing or was not `Csv`. | | `422` | `ReportCurrencyNotAllowed` | `currencies` was empty, or named a currency you hold no account in. | | `422` | `ReportPeriodNotAllowed` | The period runs backwards or is longer than 365 days. | | `401` | `signature_invalid` | The signature did not verify — most often the query string was not canonicalised. | | `403` | `permission_denied` | The service account lacks the transaction-read permission. | # Sandbox Source: https://docs.stablemint.io/guides/sandbox A full-parity environment where only the fiat legs are simulated. The sandbox runs the same code as production and exposes the same operations. Accounts, balances, transactions, minting, webhooks and payouts all behave as they do live. ``` https://api.stablemint.net ``` ## What is real and what is not > [card] Real > > Account provisioning, the reconciliation and minting pipeline, balances, transaction records, > webhook delivery and signing, payout submission, and FX quoting. > [card] Simulated > > The two fiat legs only — money coming in over the bank rail, and money going out to a bank > account. Nothing settles at a real bank. Because only the fiat legs are simulated, a sandbox deposit runs through the same reconciliation and mint path as a production one rather than being injected at the end. What you exercise is the real pipeline. ## Boundaries | | Sandbox | | - | - | | Currencies | EUR and USD | | Data | Not verified, and need not be real | | Compliance checks | Not performed on sandbox identities | | Reset | Not supported — create new records rather than clearing old ones | | Credentials | Separate from production and not interchangeable | ## Getting access Sandbox sign-up is self-serve and takes a few minutes. Go to [dashboard.stablemint.net](https://dashboard.stablemint.net/), sign up with your work email address and confirm the code sent to it. A sandbox partner and a dashboard login are provisioned at the end of it — no Stable Mint contact is involved. > [!WARNING] > > **Two-factor authentication is mandatory and cannot be deferred.** Sign-up enrols an > authenticator app (TOTP) before it completes, so have one to hand. Store the recovery codes: > losing them locks you out of the dashboard, and with it the Developer Hub where service-account > keys are managed. Once you are in: **1. Create a service account** In the [Developer Hub](https://dashboard.stablemint.net/), generate an RSA key pair and register the public key. See [Service accounts](/guides/service-accounts). **2. Sign your first request** Call `GET /v1/accounts` to confirm your signing implementation is correct before writing anything else. See [Authentication](/guides/authentication). **3. Create a customer** `POST /v1/customers`, then `POST /v1/customers/{id}/account` to provision their account details. **4. Simulate a deposit** Fabricate an inbound payment against those account details, and watch it reconcile and mint. **5. Receive the webhook** Register a subscription and verify the signature on the delivery. > [!WARNING] > > **Sandbox API keys carry an `sk_live_` prefix.** It is not an environment marker and does not > mean you are holding a production credential. Sandbox and production are separate estates with > separate credentials, and neither works against the other — but the prefix will not tell you > which one is in your hand, so key your own configuration on the base URL, never on the shape of > the key. ## Simulating a deposit Simulating a deposit is how you drive the rest of a flow without moving real money: it credits your sandbox account exactly as an inbound bank transfer would, and everything downstream — minting, balances, transactions, webhooks — happens for real. ```bash theme={null} curl -X POST https://api.stablemint.net/v1/simulations/deposit \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "amount": 100.00, "currency": "EUR", "iban": "SE4330000000000123459485" }' ``` > [!WARNING] > > **`POST /v1/simulations/deposit` exists only outside production.** It is absent from the > production route map entirely, so calling it against `https://api.stablemint.io` returns `404` — > not a permission error. Never make it part of a code path that also runs in production. **amount** `number` *required* Must be greater than zero. **currency** `string` *required* `EUR` or `USD`. **iban** `string` Required when `reference` is not supplied. Targets one of your own provisioned accounts. The example above uses this form, which is the one to reach for when you just want funds to arrive. **reference** `string` Targets a **pending deposit that already exists** and is still unpaid. > [!WARNING] > > **`reference` is not a free-text label, and sending one commits you to it.** When both are > supplied, the reference is resolved first and the IBAN is used only to confirm it points at the > same account — there is no fallback to the IBAN if the reference matches nothing. A reference > with no pending deposit behind it fails with `400`, however valid the IBAN is. > > So send a reference only to fund a deposit you created earlier with > `POST /v1/customers/{id}/deposit` (see [Customers](/guides/customers#create-a-reference-based-deposit)), > and send back the reference that call returned. To simulate money simply landing on an account, > send `iban` alone. To control who the simulated payment appears to come from, describe the sender. Each field is optional; any you leave out is filled with a placeholder value. **debtorName** `string` Name of the sender. Up to 140 characters. **debtorAccount** `string` Sender's IBAN. Must be a valid IBAN. **debtorBic** `string` BIC of the sender's bank, 8 or 11 characters. **debtorAddress** `string` Sender's address. Up to 255 characters. **debtorCountryCode** `string` ISO 3166-1 alpha-2. A request that resolves neither a pending deposit nor an account you own returns a single generic error — no detail about other partners' records is returned. > [!WARNING] > > You can only simulate deposits against account details you own. There is no way to target another > partner's account. ## Payouts and payee verification Outbound payouts complete against the bank's own sandbox, so payee verification, FX and settlement behave like the real thing. Any well-formed IBAN is accepted; malformed ones are rejected at validation. > [!NOTE] > > A documented set of test account details that drive payee verification to each outcome — match, > close match, no match, unavailable — is being published. Ask your Stable Mint contact for the > current list in the meantime. ## Going to production When you move across, three things change and nothing else does: 1. The base URL becomes `https://api.stablemint.io`. 2. You use production credentials from a production service account. 3. Deposit simulation is gone — money arrives over the real rail. Because the surfaces are otherwise identical, a working sandbox integration is a working production integration. # Service accounts Source: https://docs.stablemint.io/guides/service-accounts Machine credentials, RSA keys and permission scopes. A service account is the identity your server uses to call the API. It holds an API key, an API secret, the RSA public key your signatures are verified against, and a set of permissions that decide which operations it may perform. Service accounts are created and managed from the **Developer Hub** in your [dashboard](https://dashboard.stablemint.net/). They cannot be created through the public API — a service account cannot mint, revoke or re-scope another service account, by design. ## You generate the key pair, not us Stable Mint never holds your private key. You generate an RSA key pair, upload the **public** half when you create the service account, and keep the private half on your own infrastructure. ```bash theme={null} # Generate a 2048-bit RSA key pair openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out stablemint-private.pem # Derive the public key to upload openssl rsa -in stablemint-private.pem -pubout -out stablemint-public.pem ``` Upload the contents of `stablemint-public.pem` when creating the service account. Store `stablemint-private.pem` in your secret manager — if you lose it, you cannot sign requests and must create a new service account with a fresh key. > [!WARNING] > > Treat the **API secret** as a credential of the same weight as the private key. It is part of > every canonical string you sign, so anyone holding both it and your private key can sign requests > as you. If it is exposed, revoke the service account and create a new one. ## Limits > [card] Five per partner > > You may hold up to five active service accounts at a time. > [card] Empty by default > > A new service account has no permissions. Grant only what it needs. ## Permissions Permissions are granted per service account from the dashboard, and they are what separates a service account that can read from one that can move money. A call made without the permission it needs returns `403` — a valid signature is not enough on its own. > [!NOTE] > > **A service account cannot widen its own access.** Reading and changing permissions requires a > signed-in dashboard user; those endpoints reject signed service-account requests. This is what > stops a leaked credential from escalating itself. ## Rotating without downtime Because you can hold five service accounts at once, rotation does not require a maintenance window: **1. Create a second service account** Generate a new key pair and register the new public key. Grant it the same permissions as the one you are replacing. **2. Deploy the new credentials** Roll the new API key, API secret and private key out to your services. Both accounts are valid at once, so there is no cutover moment. **3. Confirm traffic has moved** Check that calls are arriving under the new API key before going further. **4. Revoke the old account** Delete the previous service account from the [Developer Hub](https://dashboard.stablemint.net/). Signatures made with its key stop verifying immediately. ## Sandbox and production are separate Sandbox and production credentials are issued independently and are not interchangeable. A sandbox service account cannot call production, and vice versa. > [!WARNING] > > Sandbox and production API keys currently share the same prefix, so the key string alone does not > tell you which environment it belongs to. Keep them in separate secret stores and key your > configuration off the base URL rather than off the credential. ## Next > [card] [Authentication](/guides/authentication) > > How to sign a request with these credentials. > [card] [Sandbox](/guides/sandbox) > > Exercise the full flow without moving real money. # Transactions Source: https://docs.stablemint.io/guides/transactions One endpoint, filtered. Every movement of value on your account. Every movement of value on your account is a transaction — deposits, withdrawals, payouts, conversions and token transfers, yours and your customers'. They all come from **one endpoint**, narrowed with filters. ```bash theme={null} # Your own transactions, most recent first curl "https://api.stablemint.net/v1/transactions?scope=Partner&sortBy=Date&sortDirection=Descending" \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" ``` > [!NOTE] > > **`scope` is how you separate your money from your customers'.** `Partner` returns your own > transactions, `Customer` returns your customers', and `All` returns both — which is rarely what > you want on a reconciliation run. ## Narrowing to one customer Pass `partnerCustomerGuid` to get a single customer's transactions. ```bash theme={null} curl "https://api.stablemint.net/v1/transactions?scope=Customer&partnerCustomerGuid=3f2a9c14-7b5e-4d21-9c6a-8e0f1d2b3c45" \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" ``` > [!NOTE] > > This replaces the separate per-customer transaction endpoints that used to exist. Everything is > now a filter on `/v1/transactions`, so one code path and one response shape covers every case. > > The parameter keeps its wire name, `partnerCustomerGuid` — send it exactly as spelled here. ## Filters All parameters are optional and combine with AND. | Parameter | Type | Notes | | - | - | - | | `page` | integer | 1-based. Defaults to 1. | | `pageSize` | integer | Items per page. | | `scope` | string | `Partner`, `Customer` or `All`. | | `partnerCustomerGuid` | string | A single customer's id. Pair with `scope=Customer`. | | `partyType` | string | `Partner` or `Customer`. | | `direction` | string | `Internal`, `Inward` or `Outward`. | | `category` | string | `Deposit`, `Withdrawal` or `Conversion`. | | `type` | string | The specific transaction type — see the table below. | | `method` | string | `Fiat` or `Token`. | | `status` | string | `Pending`, `Completed`, `Unsuccessful`, `Cancelled` or `Expired`. | | `currency` | string | ISO 4217, e.g. `EUR`. | | `from` / `to` | string | ISO 8601 date-time bounds on the transaction date. | | `minAmount` / `maxAmount` | number | Inclusive amount bounds. | | `sortBy` | string | `Date`, `Amount`, `Status`, `Type`, `MonitorResultStatus`, `UpdatedDate`. | | `sortDirection` | string | `Ascending` or `Descending`. | The response is paginated: ```json theme={null} { "items": [ /* ... */ ], "pageNumber": 1, "pageSize": 50, "totalCount": 412, "totalPages": 9, "hasNextPage": true, "hasPreviousPage": false } ``` ## The four ways a transaction is classified These are independent axes, not a hierarchy. A single transaction has a value for each. | Axis | Values | Answers | | - | - | - | | `category` | `Deposit`, `Withdrawal`, `Conversion` | What kind of movement? | | `transactionDirection` | `Inward`, `Outward`, `Internal` | Which way relative to Stable Mint? | | `method` | `Fiat`, `Token` | Bank rail or blockchain? | | `partyType` | `Partner`, `Customer` | Whose money? | Use `scope` to filter; `partyType` is the value you read back on each item. An outgoing token transfer also carries `token`, naming the token sent — `USDSM` or `EURSM`. Fiat movements and incoming token transfers have no `token`, so read it only when `method` is `Token` and `transactionDirection` is `Outward`, and treat it as absent otherwise. `transactionType` is the precise label, and is the one to switch on in code: | Value | Meaning | | - | - | | `PartnerDeposit` / `PartnerWithdraw` | Your own money in or out. | | `PartnerCustomerDeposit` / `PartnerCustomerWithdraw` | A customer's money in or out. | | `PartnerCustomerRefund` | A customer deposit returned. | | `TokenTransferIn` / `TokenTransferOut` | Stablecoin arriving at or leaving your wallet. | | `Conversion` | An FX conversion between two of your currencies. | | `CustomerDeposit` / `CustomerWithdraw` / `CustomerRefund` | Legacy direct-customer types. | | `NotDefined` | Unclassified. Treat as a data issue and report it. | ## List items are trimmed The list returns enough to render a table. Fetching one transaction returns considerably more — including the fields you need to investigate a failure. Look it up by its `reference`. ```bash theme={null} curl https://api.stablemint.net/v1/transactions/QJ7XKDMZRTPW \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" ``` Only on the single-transaction response: | Field | Why you want it | | - | - | | `timeline` | Ordered `{ step, status, createdAt }` entries: `Created`, `Initiated`, `Submitted`, `Processing`, `Received`, `Completed`, `Failed`. This is how you find out *where* something stalled. | | `errorKey` | Why it failed — see [Errors](/guides/errors). | | `debtorDetails` / `creditorDetails` | Both sides in full: name, IBAN, BIC, country, wallet address. When the creditor is a wallet it has no `iban` — read `walletAddress`. | | `hasFx`, `userAmount`, `userCurrency`, `fxQuoteExpiryTime` | The FX leg, when there was one. | | `rail` | `Sepa`, `Swift` or `Wallet`. | | `idempotencyKey`, `endToEndId`, `sessionId` | Your correlation handles. | > [!NOTE] > > **`reference` is the transaction's id.** It is the value the dashboard shows as the ID, the > string that travels on the payment, and what your customer quotes on a bank transfer — so it is > the one you already have. Every row of the list response carries it. > [!WARNING] > > **This path used to take a numeric `id`, and no longer does.** The list response also carries an > `id`, which is Stable Mint's internal identifier. It is not the key this endpoint takes, and > passing it now returns `404`. > > If your integration passes `id` today, switch to `reference` from the same row. Nothing else > about the call changes. ## Reconciling a deposit **1. Filter to what settled** `?scope=Customer&category=Deposit&status=Completed&from=2026-09-01&to=2026-09-30` **2. Match on reference or counterparty** If you provisioned the customer a virtual IBAN, the transaction is already attributed. If you are sharing one IBAN across customers, match on `reference` — see [Customers](/guides/customers). **3. Investigate anything Pending** Fetch it by `id` and read the `timeline`. The last entry tells you which step it is sitting on. > [!NOTE] > > Prefer webhooks to polling. Subscribe to transaction status events and you will be told when > something reaches a terminal state — see [Receiving webhooks](/guides/webhooks). # Wallets Source: https://docs.stablemint.io/guides/wallets Your on-chain settlement addresses. A **wallet** is an on-chain address associated with your partner account. Tokens sent to it are credited to your balance automatically; tokens you pay out leave from it. > [!NOTE] > > Every example on this page is a signed request. `$SIGNATURE` is computed per request over a canonical string — see [Authentication](/guides/authentication). Bearer tokens are not accepted. ```bash theme={null} curl https://api.stablemint.net/v1/wallets \ -H "ApiKey: $STABLEMINT_API_KEY" \ -H "Timestamp: $TIMESTAMP" \ -H "Nonce: $NONCE" \ -H "Signature: $SIGNATURE" ``` ```json theme={null} [ { "asset": "USDSM", "chain": "Etherlink", "address": "0xYourWalletAddress" }, { "asset": "EURSM", "chain": "Etherlink", "address": "0xYourWalletAddress" } ] ``` | Field | Meaning | | - | - | | `asset` | The token this entry describes — `USDSM` or `EURSM`. | | `chain` | The network the address lives on. `Etherlink` today. | | `address` | The on-chain address. | ## One address, two assets USDSM and EURSM are both Etherlink tokens, and your account holds them at the **same address**. The endpoint returns an entry per asset because that is what will stay true as more assets and chains are added — not because the addresses differ today. > [!WARNING] > > **Do not assume that will always hold.** Read the entry whose `asset` and `chain` match what you are about to send, and use the `address` from that entry. An integration that caches one address and reuses it for everything works today and breaks silently the first time an asset is added on different terms — and a transfer sent to the wrong address cannot be reversed by Stable Mint. ## Inbound tokens credit automatically When tokens arrive at your wallet, Stable Mint records the transfer and credits your balance without any further call from you. The transaction appears in [Transactions](/guides/transactions) with `method: "Token"` and `transactionType: "TokenTransferIn"`. Subscribe to [`transaction.status.changed`](/guides/event-types) if you want to be told when it lands rather than polling — see [Receiving webhooks](/guides/webhooks). There is no inbound-transfer-specific event. > [!NOTE] > > This endpoint was previously published as `GET /v1/details`, which returned a single address alongside your company name. It was renamed because "details" described the shape of the response rather than the resource, and because one address could not represent a partner holding more than one asset. # Receiving webhooks Source: https://docs.stablemint.io/guides/webhooks Register an endpoint and verify the signature on every delivery. Webhooks are a crucial part of the Stable Mint payment flow, providing real-time notifications about payment initiation or withdrawal request status changes. ## Overview Webhooks allow your application to receive automatic notifications when certain events occur, eliminating the need to poll the API for updates. These notifications are sent as HTTP POST requests to a URL you specify. ## Configuring Webhooks ### Setting Up Your Webhook URL To configure your webhook endpoint in the Stable Mint platform: 1. Log in to the Stable Mint customer dashboard at [dashboard.stablemint.net](https://dashboard.stablemint.net/) 2. Navigate to the **Developer Hub** section and go to the **Webhook Handlers** tab 3. Click on the Create Webhook button (note that there can only be one webhook endpoint per Event Type, therefore the button might be grayed out if there is no available endpoints) 4. Enter the URL where you want to receive webhook notifications Your webhook endpoint should be a dedicated URL that is capable of processing incoming webhook events securely and reliably. ### Best Practices for Webhook URLs * Use HTTPS for your webhook endpoint to ensure secure data transmission * Ensure your webhook endpoint is publicly accessible * Consider using a dedicated endpoint specifically for handling Stable Mint webhooks ## Webhook Security ### Signature Verification All webhooks sent by Stable Mint include signature headers that allow you to verify the authenticity of the webhook. This ensures that the webhook was indeed sent by Stable Mint and that the payload has not been tampered with. Each webhook request includes these headers: ```http theme={null} StableMint-Timestamp: StableMint-Signature: ``` #### Verifying the Signature To verify the webhook signature: 1. Extract the `StableMint-Timestamp` and `StableMint-Signature` headers from the request 2. Construct the signature payload by concatenating: `,` * `` is the value from the StableMint-Timestamp header * `` is the raw JSON request body 3. Use Stable Mint's public RSA key to verify the signature against the constructed payload 4. The signature uses RSA-SHA256 with PKCS1 padding Example signature verification (pseudocode): ``` payload = timestamp + "," + requestBody signature = base64Decode(signatureHeader) isValid = rsaVerify(payload, signature, publicKey, SHA256, PKCS1) ``` ### Public Keys for Signature Verification Use the following public keys to verify webhook signatures: ```pem [Sandbox] theme={null} -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqeqrieRg9f1hWqw6Y9I6 fh0T+R22pWIP4CkYmgaKSXmZ9jBVtWaoVeeLr3JdLIWjM4P5PSMx2CReygegKzxf tOnh5uXXeKbQUtYqGWArRZyFb3p0sasG/U43AGjBqn4iRPejuAy8e3hYQMqKtFuO TyXSk9g+O9ZzSn6xuJumY2tnNwJtXrNPrJVVB6zyckcMeBAP99QeMORsCTWBRE6k sqgPmGxUSOmK5IahDtyMNg7bEpB5ODA7+K232gRCadzQwhJC5MiYtbucjziJhbZ4 yrMNVBM5qs7C9Kpx2DwXfuA3/ynQ2Xh3IQp6CC+UEbjCasCDdquwt8lgew7YbOpG 3QIDAQAB -----END PUBLIC KEY----- ``` ```pem [Production] theme={null} -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAj9nFL5jAcQS5bbTJHUP3 msnNQCax+SSEXC3am+GddydFli3IUXeqIJQqrmwJgfVRRseSLCaDH1+45fe0XxdV hDn3jtux+XZTEvGwtadmT1bT4TGrfiLYMo8P4Bbp1Vb3AUl3zM6mV8ytmAIop+au k80FLZpzSYHk3i4QntzY1+/Bm0AcYL1cDU4k9ukb6tT9vqz20PvcFAhrr2RIt6GQ lfxs5Ft0Kp9mZ+JxCj/vvYCLjZ8B3gH1V0UljzhAc/QizJw/y75FEYC/qeAifoyf piwMcwuu634Vx6AKDw4tVA6YtgLb8Kwm6aIki8YfAkGRVawsm5JlzmZXF1c3xI9w EwIDAQAB -----END PUBLIC KEY----- ``` > [!WARNING] > > Always verify the webhook signature before processing the webhook payload to ensure the request is legitimate. ## Handling Webhook Notifications ### Response Requirements When Stable Mint sends a webhook to your endpoint, your server must respond with any **2xx** status code (e.g., 200, 201, 202, etc.) to acknowledge receipt. This response informs our system that the webhook was successfully delivered and processed. ### Retry Mechanism If your endpoint fails to respond with a 2xx status code, Stable Mint will reattempt to send the notification following a structured retry policy: | Attempt | Delay Before Retry | | - | - | | 1st retry | 5 minutes | | 2nd retry | 10 minutes | | 3rd retry | 30 minutes | | 4th retry | 60 minutes | | 5th retry | 90 minutes | After the 5th unsuccessful retry attempt, the webhook delivery will be marked as failed, and no further attempts will be made. ## Webhook Payload Format ### Version 2 (Default) All new webhook integrations use **Version 2** by default. In this format, the event payload is wrapped in an envelope containing an `eventId` for tracking and a `data` object with the event-specific fields: ```json theme={null} { "eventId": "evt_abc123def456", "data": { "eventType": "partner.customer.deposit.created", "timestamp": "2025-01-15T10:30:00Z", "customerId": "customer_123456789", "reference": "DEP123456789", "amount": 100.00, "currency": "EUR", "sessionId": "session_123456789", "endToEndId": "E2E123456789", "paymentCountryCode": "DE", "paymentMethod": "bank_transfer", "partnerName": "Partner Company", "customerEmail": "customer@example.com", "idempotencyKey": "idem_123456789", "websiteReference": "order_123456789", "customFields": { "key1": "value1" } } } ``` | Field | Type | Description | | - | - | - | | `eventId` | string | Unique identifier for this webhook delivery, useful for idempotency checks | | `data` | object | The event payload — see [Event Types](/guides/event-types) for the full structure of each event | ### Version 1 (Deprecated) > [!WARNING] > > **Deprecation Notice** > Version 1 is deprecated and will be removed in a future release. All new integrations should use Version 2. If you are currently using Version 1, we recommend migrating to Version 2. In Version 1, the event payload is sent directly as the request body with the `eventId` injected as a top-level field alongside the event data: ```json theme={null} { "eventId": "evt_abc123def456", "eventType": "partner.customer.deposit.created", "timestamp": "2025-01-15T10:30:00Z", "customerId": "customer_123456789", "reference": "DEP123456789", "amount": 100.00, "currency": "EUR", "sessionId": "session_123456789", "endToEndId": "E2E123456789", "paymentCountryCode": "DE", "paymentMethod": "bank_transfer", "partnerName": "Partner Company", "customerEmail": "customer@example.com", "idempotencyKey": "idem_123456789", "websiteReference": "order_123456789", "customFields": { "key1": "value1" } } ``` The key difference is that Version 1 flattens all fields into a single JSON object, whereas Version 2 nests the event data inside the `data` field. ## Further Considerations 1. Due to the nature of HTTP requests, you must implement idempotency logic to handle potential duplicate webhook notifications. Use the `eventId` field to deduplicate deliveries. 2. Process webhooks asynchronously without long-running processes to avoid timeouts. ## Event Types Stable Mint sends webhooks for various events, including: ### Deposit Events * `partner.customer.deposit.created`: A new deposit request has been created * `partner.customer.deposit.initiated`: A deposit has been initiated by the customer * `partner.customer.deposit.submitted`: A deposit has been submitted to the payment processor * `partner.customer.deposit.accepted`: A deposit has been accepted and reconciled * `partner.customer.deposit.failed`: A deposit has failed to process * `partner.customer.deposit.completed`: A deposit has been completed and funds are settled ### Withdrawal Events * `partner.customer.withdrawal.requested`: A withdrawal request has been created (not sent for withdrawals created with `POST /v1/customers/{id}/withdrawal`) * `partner.customer.withdrawal.accepted`: A withdrawal has been accepted for processing * `partner.customer.withdrawal.sent`: A withdrawal has been successfully sent to the beneficiary * `partner.customer.withdrawal.failed`: A withdrawal has failed to process ### Transaction Events * `transaction.status.changed`: A transaction status has changed For detailed payload structures of each event, see the [Event Types](/guides/event-types) documentation. For any questions or assistance with webhooks, please contact us at [contact@stablemint.io](mailto:contact@stablemint.io). # Stable Mint API Source: https://docs.stablemint.io/index Move money between bank rails and stablecoins through one signed API. Stable Mint is banking-as-a-service infrastructure for stablecoins. You collect fiat from your customers, it settles on-chain as a regulated stablecoin, and you pay out in fiat or tokens — through one API, without holding banking licences or custody infrastructure yourself. > [card] [Quickstart](/quickstart) > > Sign your first request and read your account balance. > [card] [Sandbox](/guides/sandbox) > > A full-parity environment with simulated fiat legs. > [card] [Authentication](/guides/authentication) > > Service accounts and RSA request signing. > [card] [Service accounts](/guides/service-accounts) > > Credentials, permissions and rotation. ## The model There are two kinds of account, and the distinction runs through the whole API. **Partner** `you` Your own organisation. You hold accounts and balances, you make payouts, and you manage service accounts and team members. **Customer** `your end users` A customer you create and operate on behalf of. Each one can be provisioned its own account details, receive deposits, and hold a balance that is segregated from yours. If you are moving your own treasury, you only need partner-level operations. If you are embedding accounts and payments into your own product, you will create customers. ## What a full cycle looks like **1. Create a customer** `POST /v1/customers`, then provision their account details with `POST /v1/customers/{id}/account`. **2. They fund it** Money arrives on the bank rail against their account details. Stable Mint reconciles the inbound payment and mints the corresponding stablecoin. **3. You are notified** A signed `partner.customer.deposit.completed` webhook fires, carrying the amount, currency and blockchain transaction hash. **4. You pay out** `POST /v1/payouts/fiat` to a bank beneficiary, or `POST /v1/payouts/token` to a wallet. Both are single, idempotent, unattended calls. ## Base URLs | Environment | Base URL | Notes | | - | - | - | | Production | `https://api.stablemint.io` | Partner accounts are provisioned by Stable Mint. | | Sandbox | `https://api.stablemint.net` | Fiat legs are simulated. | Both environments run the same code and expose the same operations. The only deliberate differences are how you get in and that sandbox money is not real — see [Sandbox](/guides/sandbox). ## Before you start > [!NOTE] > > The API accepts **service-account signed requests only**. There is no bearer-token access, no > OAuth client-credentials flow, and no API-key-in-a-header shortcut. Every request carries four > headers and an RSA signature over a canonical string. Start at > [Authentication](/guides/authentication). # Quickstart Source: https://docs.stablemint.io/quickstart Sign your first request in about ten minutes. By the end of this page you will have made an authenticated call to the Stable Mint API. Start here before writing any integration code — if your signing implementation is wrong, every other call fails the same way, and it is much easier to debug against a `GET` with no body. ## What you need **1. Sandbox access** A sandbox partner account and a dashboard login. See [Sandbox](/guides/sandbox). **2. An RSA key pair** Generate one and upload the public half when you create a service account: ```bash theme={null} openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out stablemint-private.pem openssl rsa -in stablemint-private.pem -pubout -out stablemint-public.pem ``` **3. A service account** Create one in the [Developer Hub](https://dashboard.stablemint.net/), register `stablemint-public.pem`, and note the API key and API secret. Grant it permission to read transactions so it can do something once it authenticates. See [Service accounts](/guides/service-accounts). ## Make the call Set your credentials: ```bash theme={null} export STABLEMINT_API_KEY="your-api-key" export STABLEMINT_API_SECRET="your-api-secret" export STABLEMINT_PRIVATE_KEY="$(cat stablemint-private.pem)" ``` Then sign and send a request for your accounts: ```bash cURL theme={null} #!/usr/bin/env bash set -euo pipefail BASE_URL="https://api.stablemint.net" METHOD="GET" PATH_ONLY="/v1/accounts" TIMESTAMP=$(date +%s) NONCE=$(uuidgen | tr '[:upper:]' '[:lower:]') # SHA-256 of an empty body. BODY_HASH="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" # Seven fields, LF-joined. printf gives us real newlines, not literal \n. CANONICAL=$(printf '%s\n%s\n%s\n%s\n%s\n%s\n%s' \ "$METHOD" "$PATH_ONLY" "" "$TIMESTAMP" "$NONCE" "$STABLEMINT_API_SECRET" "$BODY_HASH") SIGNATURE=$(printf '%s' "$CANONICAL" \ | openssl dgst -sha256 -sign <(printf '%s' "$STABLEMINT_PRIVATE_KEY") \ | openssl base64 -A) curl -sS "${BASE_URL}${PATH_ONLY}" \ -H "ApiKey: ${STABLEMINT_API_KEY}" \ -H "Timestamp: ${TIMESTAMP}" \ -H "Nonce: ${NONCE}" \ -H "Signature: ${SIGNATURE}" ``` ```javascript Node.js theme={null} import crypto from 'node:crypto'; const BASE_URL = 'https://api.stablemint.net'; const path = '/v1/accounts'; const timestamp = Math.floor(Date.now() / 1000).toString(); const nonce = crypto.randomUUID(); const bodyHash = crypto.createHash('sha256').update('', 'utf8').digest('hex'); const canonical = [ 'GET', path, '', // no query string timestamp, nonce, process.env.STABLEMINT_API_SECRET, bodyHash, ].join('\n'); const signature = crypto .sign('sha256', Buffer.from(canonical, 'utf8'), { key: process.env.STABLEMINT_PRIVATE_KEY, padding: crypto.constants.RSA_PKCS1_PADDING, }) .toString('base64'); const response = await fetch(BASE_URL + path, { headers: { ApiKey: process.env.STABLEMINT_API_KEY, Timestamp: timestamp, Nonce: nonce, Signature: signature, }, }); console.log(response.status, await response.json()); ``` A `200` means your signing is correct and you can move on. Anything else is worth fixing now. ## If it did not work > [accordion] 401 signature\_required > > One of the four headers is missing or empty. Check that `STABLEMINT_API_KEY` is actually set — > an unset variable expands to an empty header, which counts as missing. > [accordion] 401 jwt\_not\_accepted > > Something added an `Authorization` header. The public API takes signed requests only. > [accordion] 401 with all four headers set > > The signature did not verify. The two most common causes are a canonical string joined with > literal `\n` characters instead of real line feeds, and a clock more than 60 seconds out of > step. Check both before looking anywhere else. ## Next > [card] [Authentication](/guides/authentication) > > The full signing contract, including bodies and query strings. > [card] [Sandbox](/guides/sandbox) > > Simulate a deposit and watch it mint.