> For the complete documentation index, see [llms.txt](https://docs.anchored.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.anchored.finance/trading-api/guides/one-click-flow.md).

# One Click Flow

For API keys with a bound user wallet address. The server submits transactions after the user delegates once.

## Authorization

```mermaid
sequenceDiagram
    participant User
    participant Client
    participant API
    participant Chain

    Client->>API: GET /1ct/status
    API-->>Client: { status: "disabled" }
    Client->>API: POST /1ct/prepare { deadline }
    API-->>Client: signPayload (EIP-712)
    Client->>User: Request signature
    User->>Client: signature (65 bytes)
    Client->>API: POST /1ct/enable { signature, deadline }
    API->>Chain: delegateBySig
    API-->>Client: { status: "enable" }
```

## Steps

1. `GET /api/v1/1ct/status` — check delegation.
2. If not enabled: `POST /api/v1/1ct/prepare` → user signs EIP-712 → `POST /api/v1/1ct/enable`.
3. Call `/send` endpoints for orders and cash.

Details: [trading/one-click-delegated.md](/trading-api/trading/one-click-delegated.md). viem example: [demo-code.md](/trading-api/guides/demo-code.md).

## Send endpoints

| Operation    | Endpoint                               |
| ------------ | -------------------------------------- |
| Place order  | `POST /api/v1/orders/send`             |
| Cancel order | `DELETE /api/v1/orders/{orderId}/send` |
| Deposit      | `POST /api/v1/cash/deposits/send`      |
| Withdraw     | `POST /api/v1/cash/withdrawals/send`   |

## Deposit prerequisite

User wallet must `approve` the cash token spender before `/cash/deposits/send`.

Approval owner is the API key bound `userAddress`. See [cash/deposits.md](/trading-api/cash-operations/deposits.md) for spender addresses.
