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

# Prepare account registration

> Returns a deposit address or the details needed to register the account.



## OpenAPI

````yaml https://raw.githubusercontent.com/rhinestonewtf/openapi/refs/heads/main/deposit-service.json post /setup-account
openapi: 3.1.0
info:
  title: Deposit Service API
  version: 1.0.0
  description: >-
    Rhinestone Deposits API: accept deposits from any chain, asset or payment
    method, and settle them as one token on one chain.
servers:
  - url: https://v1.orchestrator.rhinestone.dev/deposit-processor
security: []
paths:
  /setup-account:
    post:
      tags:
        - Accounts
      summary: Prepare account registration
      description: Returns a deposit address or the details needed to register the account.
      parameters:
        - schema:
            type: string
            description: API key for authentication
            example: your-api-key
          required: true
          description: API key for authentication
          name: x-api-key
          in: header
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}\.[a-z0-9]+$
            description: >-
              API version identifier (e.g. "2026-04.amazon"). Optional today,
              will become required in a future release.
            example: 2026-04.amazon
          required: false
          description: >-
            API version identifier (e.g. "2026-04.amazon"). Optional today, will
            become required in a future release.
          name: x-api-version
          in: header
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetupAccountRequestBody'
      responses:
        '200':
          description: Account setup result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetupAccountResponse'
        '400':
          description: Invalid request or unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: API key lacks required deposits scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Failed to derive account or build sessions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SetupAccountRequestBody:
      type: object
      properties:
        ownerAddress:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Ethereum address (0x followed by 40 hex characters)
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        sessionOwnerAddress:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Ethereum address (0x followed by 40 hex characters)
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        targetToken:
          type: string
          minLength: 1
        targetChain:
          type: string
          pattern: ^[a-z0-9]+:[a-zA-Z0-9]+$
          description: CAIP-2 chain identifier (e.g. "eip155:8453")
          example: eip155:8453
        recipient:
          type: string
        outputTokenRules:
          type: array
          items:
            $ref: '#/components/schemas/OutputTokenRule'
        rejectUnmapped:
          type: boolean
        postBridgeActions: {}
        sessionScopes:
          $ref: '#/components/schemas/SessionScopes'
        signerAddress:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Ethereum address (0x followed by 40 hex characters)
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        sessionChainIds:
          type: array
          items:
            type: integer
            exclusiveMinimum: 0
        forceRegister:
          type: boolean
      required:
        - ownerAddress
        - sessionOwnerAddress
        - targetToken
        - targetChain
    SetupAccountResponse:
      type: object
      properties:
        smartAccount:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Ethereum address (0x followed by 40 hex characters)
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        isRegistered:
          type: boolean
        targetChain:
          type: string
        targetToken:
          type: string
        needsRegistration:
          type: boolean
        solanaDepositAddress:
          type: string
        accountParams:
          type: object
          properties:
            factory:
              type: string
              pattern: ^0x[a-fA-F0-9]{40}$
              description: Ethereum address (0x followed by 40 hex characters)
              example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
            factoryData:
              type: string
              pattern: ^0x[a-fA-F0-9]+$
              description: Hex-encoded string (0x followed by hex characters)
              example: '0x1234abcd'
            sessionScopes:
              $ref: '#/components/schemas/SessionScopes'
          required:
            - factory
            - factoryData
        sessionDetailsUnsigned:
          type: object
          properties:
            hashesAndChainIds:
              type: array
              items:
                type: object
                properties:
                  chainId:
                    type: string
                  sessionDigest:
                    type: string
                    pattern: ^0x[a-fA-F0-9]+$
                    description: Hex-encoded string (0x followed by hex characters)
                    example: '0x1234abcd'
                required:
                  - chainId
                  - sessionDigest
            data:
              type: object
              additionalProperties: {}
          required:
            - hashesAndChainIds
            - data
      required:
        - smartAccount
        - isRegistered
        - needsRegistration
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: >-
            Deposit error code (e.g. `TOKEN-3`) when the refusal is one a
            deposit would also receive.
        details:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
              path:
                type: array
                items:
                  anyOf:
                    - type: string
                    - type: number
              code:
                type: string
            required:
              - message
      required:
        - error
    OutputTokenRule:
      type: object
      properties:
        match:
          $ref: '#/components/schemas/OutputTokenRuleMatch'
        outputToken:
          type: string
          minLength: 1
      required:
        - match
        - outputToken
      description: >-
        Destination token routing rule. Matches deposits by source token
        attributes and selects the target-chain output token.
      example:
        match:
          symbol: USDC
        outputToken: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
    SessionScopes:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/SessionScope'
    OutputTokenRuleMatch:
      type: object
      properties:
        chain:
          type: string
          pattern: ^[a-z0-9]+:[a-zA-Z0-9]+$
          description: CAIP-2 chain identifier (e.g. "eip155:8453")
          example: eip155:8453
        token:
          type: string
          minLength: 1
        symbol:
          type: string
      description: >-
        Source-token match criteria. Rules may match by source chain, source
        token address, source symbol, or a combination.
      example:
        chain: eip155:10
        symbol: USDC
    SessionScope:
      type: object
      properties:
        sellToken:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Token the deposit arrives in.
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        buyToken:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: >-
            Where value is allowed to end up — normally the account target
            token.
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        recipient:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: >-
            Pinned output recipient, so a compromised signer cannot redirect the
            swap.
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        settler:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: >-
            The 0x Settler this scope pins. Resolved server-side from 0x's
            registry and echoed back inside `accountParams`; re-send it
            unchanged on `/register`, because it is an input to the digest you
            signed.
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        maxSpend:
          type: string
          pattern: ^\d+$
          description: >-
            Optional cumulative ceiling on what may leave, in base units. The
            pinned Settler is what bounds the session, so a cap is only needed
            as a spend ceiling in its own right. It is a LIFETIME total: once
            reached the account stops converting deposits until it re-registers.
          example: '1000000000000000000'
      required:
        - sellToken
        - buyToken
        - recipient

````