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

# Deposit SPL Tokens

> Wraps the SDK `delegateSpl(...)` flow. The API generates `shuttleId` server-side and pins `escrowIndex` to `0`.



## OpenAPI

````yaml /pages/private-ephemeral-rollups-pers/api-reference/per/openapi/deposit.openapi.json POST /v1/spl/deposit
openapi: 3.1.0
info:
  title: Private Payments API
  version: 0.1.0
  description: >-
    Build an unsigned transaction that deposits SPL tokens from Solana into an
    ephemeral rollup.
servers:
  - url: https://payments.magicblock.app
    description: Mainnet - Private Payments API
security: []
paths:
  /v1/spl/deposit:
    post:
      summary: Deposit SPL Tokens
      description: >-
        Wraps the SDK `delegateSpl(...)` flow. The API generates `shuttleId`
        server-side and pins `escrowIndex` to `0`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                owner:
                  type: string
                  example: 3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE
                cluster:
                  anyOf:
                    - type: string
                      enum:
                        - mainnet
                        - devnet
                    - type: string
                  example: mainnet
                  description: >-
                    Optional. Use `mainnet` for BASE_RPC_URL and
                    EPHEMERAL_RPC_URL, `devnet` for BASE_DEVNET_RPC_URL and
                    EPHEMERAL_DEVNET_RPC_URL, or provide a custom http(s) RPC
                    URL to override the base RPC while keeping the configured
                    ephemeral RPC.
                mint:
                  type: string
                  example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                  description: >-
                    Optional. Defaults to Solana USDC on mainnet:
                    `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`. On devnet it
                    defaults to devnet USDC:
                    `4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU`.
                amount:
                  type: integer
                  minimum: 1
                  example: 1
                  description: Base-unit amount as an integer JSON value with minimum 1.
                validator:
                  type: string
                  example: MAS1Dt9qreoRMQ14YQuhg8UTZMMzDdKhmkZMECCzk57
                  description: >-
                    Optional. Defaults to the selected ephemeral RPC identity
                    resolved via `getIdentity`.
                initIfMissing:
                  type: boolean
                  description: Optional. Initialize the transfer queue if missing.
                initVaultIfMissing:
                  type: boolean
                  description: Optional. Initialize the vault if missing.
                initAtasIfMissing:
                  type: boolean
                  description: Optional. Initialize associated token accounts if missing.
                idempotent:
                  type: boolean
                  description: >-
                    Optional. When `true`, the API uses idempotent variants for
                    any preparatory init instructions.
              required:
                - owner
                - amount
              example:
                owner: 3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE
                amount: 1
                initIfMissing: true
                initVaultIfMissing: true
                initAtasIfMissing: true
                idempotent: true
      responses:
        '200':
          description: Unsigned serialized transaction
          content:
            application/json:
              schema:
                type: object
                properties:
                  kind:
                    type: string
                    enum:
                      - deposit
                  version:
                    type: string
                    enum:
                      - legacy
                      - v0
                  transactionBase64:
                    type: string
                  sendTo:
                    type: string
                    enum:
                      - base
                      - ephemeral
                  recentBlockhash:
                    type: string
                  lastValidBlockHeight:
                    type: integer
                  instructionCount:
                    type: integer
                    minimum: 0
                  requiredSigners:
                    type: array
                    items:
                      type: string
                  validator:
                    type: string
                required:
                  - kind
                  - version
                  - transactionBase64
                  - sendTo
                  - recentBlockhash
                  - lastValidBlockHeight
                  - instructionCount
                  - requiredSigners
              example:
                kind: deposit
                version: legacy
                transactionBase64: >-
                  AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAIDKmcfsS5XfSOLaLlaBHJry50iH2Ufk2TMz4STC2fHzIcFKkerg3q2DD3Yn8TISmGeKoxSLz+BiP7iQ4pYqXYXsgu8D8C7R8ovdMQRLpSrE8+jxjTl3BfqywPNGiPNfnh8eS+smowIxqKDcCjw5liNXQkkCbBSDCBDFwtrgCKqoQ0DAgEBBAECAwQCAQEEAgIDBAIBAQQDAgME
                sendTo: base
                recentBlockhash: 9A4VhP8M8fQZxP4h7rB6mP6eM8w2pJkYh7QdZk7V4r2x
                lastValidBlockHeight: 284512337
                instructionCount: 3
                requiredSigners:
                  - 3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE
                validator: MAS1Dt9qreoRMQ14YQuhg8UTZMMzDdKhmkZMECCzk57
        '400':
          description: Build error
        '422':
          description: Validation error

````