> ## 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.

# Transfer SPL Tokens

> Transfer SPL tokens publicly or privately through an ephemeral rollup.



## OpenAPI

````yaml /privacy-openapi.json POST /v1/spl/transfer
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/transfer:
    post:
      tags:
        - SPL
      description: Transfer SPL tokens publicly or privately through an ephemeral rollup.
      requestBody:
        required: true
        description: Transfer request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransferRequest'
      responses:
        '200':
          description: Unsigned serialized transaction
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnsignedTransactionResponse'
        '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:
    TransferRequest:
      type: object
      properties:
        from:
          type: string
          example: So11111111111111111111111111111111111111112
        to:
          type: string
          example: So11111111111111111111111111111111111111112
        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: So11111111111111111111111111111111111111112
        amount:
          type: integer
          minimum: 1
          example: 1000000
          description: Base-unit amount as an integer JSON value with minimum 1.
        visibility:
          $ref: '#/components/schemas/TransferVisibility'
        fromBalance:
          $ref: '#/components/schemas/BalanceLocation'
        toBalance:
          $ref: '#/components/schemas/BalanceLocation'
        validator:
          type: string
          example: MAS1Dt9qreoRMQ14YQuhg8UTZMMzDdKhmkZMECCzk57
          description: >-
            Optional. When this transfer route needs a validator and none is
            provided, the API resolves it from the selected ephemeral RPC via
            `getIdentity`.
        initIfMissing:
          type: boolean
        initAtasIfMissing:
          type: boolean
        initVaultIfMissing:
          type: boolean
        memo:
          type: string
          example: 'Order #1042'
          description: >-
            Optional. Appends a final Memo Program instruction with this UTF-8
            message.
        minDelayMs:
          type: string
          pattern: ^\d+$
          example: '0'
          description: Optional. Private transfer only. Defaults to 0.
        maxDelayMs:
          type: string
          pattern: ^\d+$
          example: '0'
          description: >-
            Optional. Private transfer only. Defaults to 0 when omitted, or to
            minDelayMs when minDelayMs is set.
        split:
          type: integer
          exclusiveMinimum: 0
          maximum: 15
          example: 1
          description: >-
            Optional. Private transfer only. Defaults to 1. Must be between 1
            and 15.
      required:
        - from
        - to
        - mint
        - amount
        - visibility
        - fromBalance
        - toBalance
      example:
        from: 3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE
        to: Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L
        mint: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
        amount: 1000000
        visibility: private
        fromBalance: base
        toBalance: base
        initIfMissing: true
        initAtasIfMissing: true
        initVaultIfMissing: true
        memo: 'Order #1042'
        minDelayMs: '0'
        maxDelayMs: '0'
        split: 1
    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
    TransferVisibility:
      type: string
      enum:
        - public
        - private
    BalanceLocation:
      type: string
      enum:
        - base
        - ephemeral

````