Skip to main content

Base URL

https://api.daimo.com

Authentication

Endpoints use Bearer token authentication with your API key:
Authorization: Bearer YOUR_API_KEY
Some endpoints accept a client secret instead, passed in the request body or query string. Each session has its own client secret, returned when you create or retrieve the session. Client secrets are safe for client-side use since they only grant access to their specific session.
CredentialFormatUse
API keyUUIDServer-side. Create sessions, retrieve full details.
Client secretUUIDClient-side, per-session. Set payment method, check status.

Error format

All errors return a JSON body:
{
  "error": {
    "type": "validation_error",
    "code": "invalid_parameter",
    "message": "invalid session create request",
    "param": "body"
  }
}
FieldTypeDescription
typestringError category (see below)
codestringMachine-readable error code
messagestringHuman-readable description
paramstring?The parameter that caused the error, if applicable

Error types

TypeDescription
authentication_errorMissing or invalid credentials
validation_errorInvalid request body or parameters
invalid_request_errorValid request but cannot be processed (e.g. resource not found)
api_errorInternal server error

HTTP status codes

CodeMeaning
200Success
201Created
400Bad request, validation error
401Unauthorized, missing or invalid API key
404Not found, session does not exist
500Internal server error

Session object

The full session object (returned with API key authentication):
{
  sessionId: string;        // 32-character hex ID
  status: SessionStatus;    // see below
  destination: {
    type: "evm";
    address: string;        // checksum-encoded destination address
    chainId: number;        // e.g. 8453
    chainName: string;      // e.g. "Base"
    tokenAddress: string;   // destination token address
    tokenSymbol: string;    // e.g. "USDC"
    amountUnits?: string;   // requested amount in token units
    calldata?: string;      // hex-encoded calldata for contract calls
    delivery?: {            // set once funds are delivered
      txHash: string;
      receivedUnits: string;
    };
  };
  display: {
    title: string;          // e.g. "Deposit to Acme"
    verb: string;           // e.g. "Deposit"
    themeCssUrl?: string;   // custom theme CSS URL
  };
  paymentMethod: PaymentMethod | null;
  metadata: Record<string, string> | null;
  clientSecret: string;     // per-session client credential
  createdAt: number;        // unix timestamp (seconds)
  expiresAt: number;        // unix timestamp (seconds)
}
Without an API key, metadata and clientSecret are omitted.

SessionStatus

ValueDescription
requires_payment_methodWaiting for user to choose how to deposit
waiting_paymentPayment method set, waiting for deposit transaction
processingDeposit detected, routing funds to destination
succeededFunds delivered to destination
bouncedDelivery failed, funds returned to refund address
expiredSession timed out

PaymentMethod

Three variants based on the source chain: EVM:
{
  "type": "evm",
  "receiverAddress": "0x...",
  "source": {
    "address": "0x...",
    "chainId": 1,
    "chainName": "Ethereum",
    "tokenAddress": "0x...",
    "tokenSymbol": "USDC",
    "sentUnits": "10.00",
    "txHash": "0x..."
  },
  "createdAt": 1700000000
}
Tron:
{
  "type": "tron",
  "receiverAddress": "T...",
  "source": {
    "address": "T...",
    "chainId": 728126428,
    "chainName": "tron",
    "tokenAddress": "T...",
    "tokenSymbol": "USDT",
    "sentUnits": "10.00",
    "txHash": "..."
  },
  "createdAt": 1700000000
}
Solana:
{
  "type": "solana",
  "source": {
    "address": "So1...",
    "chainId": 501,
    "chainName": "solana",
    "tokenAddress": "EPjF...",
    "tokenSymbol": "USDC",
    "sentUnits": "10.00",
    "txHash": "..."
  },
  "createdAt": 1700000000
}
The source field is populated once the user’s deposit transaction is detected. Before that, only type, receiverAddress (for EVM/Tron), and createdAt are present. EVM and Tron are receiver-address flows. Solana is a sign-and-send flow: instead of a receiverAddress, the response returns a transaction payload for the wallet to execute in one click.

Create payment method response

When creating a payment method, chain-specific fields are returned alongside the session:
  • Tron: tron.receiverAddress (the Tron USDT address to send to) and tron.expiresAt
  • Solana: solana.serializedTx (hex-encoded serialized transaction for the wallet to sign and submit)
  • EVM: no additional fields; the deposit address is the session’s EVM deposit address