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

# Create Pro Buy Transaction

> Generate a buy transaction for a pro pool.

**Flow:** First call `/quote/pro/buy` to get a quote, then pass the `quote_response` and `pool` address here. The returned transaction wraps SOL, executes the swap, and unwraps remaining SOL.

Pro pool buys work identically to standard pool buys but reference the pro pool's state account directly.



## OpenAPI

````yaml /openapi.json post /tx/pro/buy
openapi: 3.1.0
info:
  title: heaven-tx-api
  description: ''
  license:
    name: ''
  version: 0.1.14
servers:
  - url: https://tx.api.heaven.xyz
security: []
tags:
  - name: heaven-api
    description: Heaven API
paths:
  /tx/pro/buy:
    post:
      tags:
        - Pro Pool API
      summary: Create Pro Buy Transaction
      description: >-
        Generate a buy transaction for a pro pool.


        **Flow:** First call `/quote/pro/buy` to get a quote, then pass the
        `quote_response` and `pool` address here. The returned transaction wraps
        SOL, executes the swap, and unwraps remaining SOL.


        Pro pool buys work identically to standard pool buys but reference the
        pro pool's state account directly.
      operationId: create_pro_buy_tx
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProBuyTxRequest'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateProBuyTxResponse'
components:
  schemas:
    CreateProBuyTxRequest:
      type: object
      required:
        - payer
        - quote_response
        - encoded_user_defined_event_data
        - pool
      properties:
        payer:
          type: string
          description: Public key of the wallet that will sign and pay for the transaction.
        quote_response:
          $ref: '#/components/schemas/QuoteBuyResponse'
          description: >-
            The full quote response object from the Quote Pro Buy endpoint.
            Contains the calculated amounts, fees, and slippage parameters.
        encoded_user_defined_event_data:
          type: string
          description: >-
            Arbitrary string data emitted as an on-chain event. Useful for
            tracking or attributing transactions.
        pool:
          type: string
          description: >-
            On-chain address of the pro pool state account. Returned in the
            response when creating a pool.
        compute_unit_limit:
          type: integer
          format: int32
          minimum: 0
          nullable: true
          description: >-
            Maximum compute units for the transaction. Higher values allow more
            complex operations but cost more. Defaults to a sensible value if
            omitted.
        compute_unit_price:
          type: integer
          format: int64
          minimum: 0
          nullable: true
          description: >-
            Priority fee in micro-lamports per compute unit. Higher values
            increase transaction priority. Defaults to a sensible value if
            omitted.
        source:
          type: string
          nullable: true
          description: >-
            Optional source wallet. If different from payer, tokens will be
            debited from this wallet. Defaults to payer if omitted.
      description: >-
        Request to create a buy transaction for a pro pool. First call Quote Pro
        Buy to get the quote_response, then pass it here.
    CreateProBuyTxResponse:
      type: object
      required:
        - tx
      properties:
        tx:
          type: string
          description: >-
            Base64 encoded versioned transaction. Decode, sign with the payer,
            and submit to the Solana network.
    QuoteBuyResponse:
      type: object
      required:
        - max_sol_spend
        - max_lamport_spend
        - minimum_out
        - minimum_out_ui
        - config_version
        - mint
        - program_id
        - slippage_bps
      properties:
        config_version:
          type: integer
          format: int32
          minimum: 0
          description: Protocol config version used for the quote.
        max_lamport_spend:
          type: integer
          description: Maximum amount of lamports to spend for the buy operation
          minimum: 0
        max_sol_spend:
          type: number
          description: Maximum amount of SOL to spend for the buy operation
        minimum_out:
          type: integer
          description: Minimum amount of tokens to receive from the buy operation
          minimum: 0
        minimum_out_ui:
          type: number
          description: >-
            Minimum amount of tokens to receive from the buy operation in UI
            format
        mint:
          type: string
          description: Mint address of the token being bought.
        program_id:
          type: string
          description: Heaven DEX program ID used.
        slippage_bps:
          type: integer
          format: int64
          minimum: 0
          description: Slippage tolerance applied (basis points).

````