---
title: "Prepare a gasless permit deposit"
method: POST
path: "/deposits/permit/prepare"
tags: ["Processing"]
---

# Prepare a gasless permit deposit

`POST /deposits/permit/prepare`

Experimental. Builds the EIP-712 token-authorization payload the owner signs to authorize their deposit smart account to pull `amount` of `token` from their wallet — no on-chain transfer needed. Selects ERC-3009, ERC-2612, then Permit2; validates the route, session coverage, domain, balance, and allowance before the user is asked to sign. The server chooses replay and deadline fields; submit the signature with the same fields via POST /deposits/permit. EVM source chains only; cross-chain routes only (v1).

## Headers

- `x-api-key` string — API key for authentication (omit when sending Authorization)
- `authorization` string — Bearer platform token (e.g. forwarded by user-service). Takes precedence over `x-api-key` when both are present.

## Request body

- PermitDepositPrepareRequest
  - `account` string, required — Ethereum address (0x followed by 40 hex characters)
  - `sourceChain` string, required — CAIP-2 chain identifier (e.g. "eip155:8453")
  - `token` string, required — Ethereum address (0x followed by 40 hex characters)
  - `amount` string, required — Numeric string representing a bigint value
  - `owner` string, required — Ethereum address (0x followed by 40 hex characters)
  - `kind` 'auto' | 'erc3009' | 'erc2612' | 'permit2' — Authorization scheme preference. Auto selects ERC-3009, then ERC-2612, then Permit2.

## Response `200`

Typed data to sign, with the server-chosen nonce and deadline

- union
  - object
    - `available` true, required
    - `authorization` union, required
      - object
        - `kind` 'erc3009', required
        - `typedData` PermitTypedData, required
          - `domain` unknown
          - `types` unknown
          - `primaryType` string, required
          - `message` unknown
        - `nonce` string, required — ERC-3009 bytes32 authorization nonce
        - `validAfter` string, required — Numeric string representing a bigint value
        - `validBefore` string, required — Numeric string representing a bigint value
      - object
        - `kind` 'erc2612' | 'permit2', required
        - `typedData` PermitTypedData, required
          - `domain` unknown
          - `types` unknown
          - `primaryType` string, required
          - `message` unknown
        - `nonce` string, required — Numeric string representing a bigint value
        - `deadline` string, required — Numeric string representing a bigint value
  - object
    - `available` false, required
    - `reason` 'permit2-approval-required' | 'unsupported-token' | 'unsupported-owner', required
    - `approval` object
      - `token` string, required — Ethereum address (0x followed by 40 hex characters)
      - `spender` string, required — Ethereum address (0x followed by 40 hex characters)
      - `minimumAmount` string, required — Numeric string representing a bigint value

## Other responses

- `400` — Malformed request, unsupported source chain, same-chain route, or owner funding insufficient (code PERMIT-4)
- `401` — Missing/invalid API key or expired platform bearer token
- `403` — API key lacks the deposits write scope, or permit deposits are disabled
- `404` — Account not found or not owned by the caller
- `422` — Route cannot settle (whitelist violation, unsupported token route, or no session for the source chain)

---

[API](https://skmtc.net/rhinestonewtf/apis/deposit-service-api.md) · [All operations](https://skmtc.net/rhinestonewtf/apis/deposit-service-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rhinestonewtf/deposit-service-api/revisions/c9aa3f252e4f/schema)
