> ## Documentation Index
> Fetch the complete documentation index at: https://magicblock-42-supermarioblock-patch-3.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Deposit SPL Tokens

> Deposit SPL tokens from Solana into an ephemeral rollup.



## OpenAPI

````yaml /privacy-openapi.json POST /v1/spl/deposit
openapi: 3.1.0
info:
  title: SPL Private Payments API
  version: 0.1.0
  description: >-
    REST API for building private SPL token transactions on Solana and
    MagicBlock ephemeral rollups.


    Documentation:
    https://docs.magicblock.gg/pages/private-ephemeral-rollups-pers/how-to-guide/quickstart
servers:
  - url: https://payments.magicblock.app
    description: Mainnet - SPL Private Payments API
security: []
paths:
  /v1/spl/deposit:
    post:
      tags:
        - SPL
      description: Deposit SPL tokens from Solana into an ephemeral rollup.
      requestBody:
        required: true
        description: Deposit request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DepositRequest'
      responses:
        '200':
          description: Unsigned serialized transaction
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnsignedTransactionResponse'
              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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
components:
  schemas:
    DepositRequest:
      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
        initVaultIfMissing:
          type: boolean
        initAtasIfMissing:
          type: boolean
        idempotent:
          type: boolean
      required:
        - owner
        - amount
      example:
        owner: 3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE
        amount: 1
        initIfMissing: true
        initVaultIfMissing: true
        initAtasIfMissing: true
        idempotent: true
    UnsignedTransactionResponse:
      type: object
      properties:
        kind:
          type: string
          enum:
            - deposit
            - withdraw
            - transfer
        version:
          type: string
          enum:
            - legacy
        transactionBase64:
          type: string
        sendTo:
          $ref: '#/components/schemas/BalanceLocation'
        recentBlockhash:
          type: string
        lastValidBlockHeight:
          type: integer
        instructionCount:
          type: integer
          minimum: 0
        requiredSigners:
          type: array
          items:
            type: string
            example: So11111111111111111111111111111111111111112
        validator:
          type: string
          example: So11111111111111111111111111111111111111112
      required:
        - kind
        - version
        - transactionBase64
        - sendTo
        - recentBlockhash
        - lastValidBlockHeight
        - instructionCount
        - requiredSigners
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details: {}
          required:
            - code
            - message
      required:
        - error
    ValidationErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - VALIDATION_ERROR
            message:
              type: string
            issues:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  path:
                    type: array
                    items:
                      anyOf:
                        - type: string
                        - type: number
                required:
                  - code
                  - message
                  - path
          required:
            - code
            - message
            - issues
      required:
        - error
    BalanceLocation:
      type: string
      enum:
        - base
        - ephemeral

````