> ## Documentation Index
> Fetch the complete documentation index at: https://docs.midasprotocol.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Payment

> Transfer funds to another agent — internal ledger or on-chain USDC

## Request

<ParamField body="toAgentId" type="string" required>
  UUID of the recipient agent.
</ParamField>

<ParamField body="amount" type="number" required>
  Amount to send. Must be positive.
</ParamField>

<ParamField body="currency" type="string" required>
  Currency code (e.g. `"USDC"`, `"EUR"`).
</ParamField>

<ParamField body="paymentMethod" type="string" default="auto">
  Payment rail to use:

  * `"auto"` — protocol selects the best method (default)
  * `"internal"` — internal ledger transfer
  * `"crypto"` — direct on-chain USDC transfer (requires ETH for gas)
  * `"onchain"` — on-chain USDC via **Circle Paymaster** (gas paid in USDC, no ETH needed)
</ParamField>

<ParamField body="reason" type="string">
  Optional description for the payment.
</ParamField>

<ParamField body="metadata" type="object">
  Optional key-value metadata.
</ParamField>

### Internal Payment

```bash theme={null}
curl -X POST https://api.midasprotocol.org/payments/send \
  -H "Authorization: Bearer pp_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "toAgentId": "recipient-uuid",
    "amount": 25,
    "currency": "USDC",
    "reason": "Service payment"
  }'
```

### On-Chain Payment (Circle Paymaster)

```bash theme={null}
curl -X POST https://api.midasprotocol.org/payments/send \
  -H "Authorization: Bearer pp_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "toAgentId": "recipient-uuid",
    "amount": 25,
    "currency": "USDC",
    "paymentMethod": "onchain",
    "reason": "Service payment"
  }'
```

## Response (internal)

```json theme={null}
{
  "transactionId": "uuid",
  "status": "COMPLETED",
  "amount": "25.00",
  "currency": "USDC",
  "fees": "0.50",
  "rail": "INTERNAL",
  "recipient": { "id": "uuid", "name": "RecipientAgent" },
  "completedAt": "2026-01-01T00:00:00.000Z"
}
```

## Response (onchain)

```json theme={null}
{
  "transactionId": "uuid",
  "status": "COMPLETED",
  "amount": "25.00",
  "currency": "USDC",
  "fees": "0.375",
  "rail": "ONCHAIN",
  "txHash": "0xabc123...",
  "network": "base",
  "gasPayment": "USDC (Circle Paymaster)",
  "explorer": "https://basescan.org/tx/0xabc123...",
  "recipient": { "id": "uuid", "name": "RecipientAgent" },
  "completedAt": "2026-01-01T00:00:00.000Z"
}
```

<Note>
  On-chain payments require `currency: "USDC"` and both sender and recipient must have blockchain wallets. Gas is paid in USDC via [Circle Paymaster](https://developers.circle.com/paymaster) — no ETH needed.
</Note>
