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

# Request a partially signed purchase quote given the wallet public key and required TxLINE amount in whole units

> Authorize and generate a partially signed Solana transaction for purchasing TxLINE utility tokens.

**Pricing & Fees:**
- **Base Rate:** 1,000 TxLINE = 1 USDT
- **Premium/Markup:** Currently 0% (0 basis points)

**Prerequisites:**
- The `buyerPubkey` wallet must hold an active Associated Token Account (ATA) for USDT.
- The wallet must have a sufficient USDT balance to cover the total quoted cost.

The response includes a financial breakdown of the exact base cost and any applied premium fees. The returned transaction payload must be signed by the user's wallet before submission.




## OpenAPI

````yaml https://txline.txodds.com/docs/docs.yaml post /api/guest/purchase/quote
openapi: 3.1.0
info:
  title: TxLINE off-chain API for the Hybrid on-chain/off-chain TxODDS Data system
  version: 1.5.2
  description: >

    ## Overview


    This API provides access to real-time and historical sports data from the
    **TxLINE on-chain/off-chain Data system**.


    It makes proprietary TxODDS available for any funded blockchain users by
    linking the on-chain `subscribe` transaction by issuing time-limited API
    tokens.

    - The data is canonicalised so that all fixtures, odds, or scores are
    provably identifiable and ordered--confirmed by on-chain cryptographic
    proofs.

    - The data is delivered in a request-response or Server-Sent Events (SSE)
    streaming form.


    Examples of accessing the accompanying on-chain program are available
    publicly at: https://txline.txodds.com/documentation.

    All data returned by the off-chain API is canonicalised such that every
    single record can be cryptographically proven on-chain to be

    part of the unique and consistent dataset generated by the TxODDS Data
    system.


    ## Key features


    * The odds data includes the `Stable Price` demargined prices and
    percentages, currently for key markets in European football (soccer).

    * **Free subscription option that offers World Cup 2026 odds and
    off-the-board signals in real-time sampled every 60 seconds**.

    * **Data access paid for by the TxLINE token tethered to USDT ata rate 1
    USDT = 1_000 TxLINE tokens** The TxLINE utility token can purchased using
    the associated Solana program.

    * **Fine-grained service level selection** The user can list the
    pre-configured **service levels** that either map to pre-defined league
    bundles or allow custom selecting the leagues explicitly.
     The price also depends on the sampling period for the data.
    * **Maximum subscription option that offers all leagues in real-time**.

    * **Historical Snapshots:** Query the latest state of any market at a
    specific point in time.

    * **Historical Updates:** Query the updates for any given key such as
    fixture or market for a given time period.

    * **Live Data Streams:** Real-time, low-latency data feeds using Server-Sent
    Events (SSE).

    * **On-chain Validation:** Retrieve Merkle proofs to cryptographically
    verify data against the on-chain held Merkle roots by calling appropriate
    validate on-chain instructions.


    ## How do the users gain access to off-chain data (see more details and
    examples at: https://github.com/txodds/tx-on-chain)


    1. For paid service tiers, the user purchases TxODDS TxLINE utility tokens
    for USDT at a fixed rate using either a script (e.g., calling
    `purchase_subscription_token_usdt`) or an affiliate website. The tokens are
    deposited into the user's associated token account. (Note: This step is
    skipped for the free World Cup tier).

    2. As a guest, with no prior authentication, the user calls the off-chain
    API at "https://txline.txodds.com/auth/guest/start" (or `txline-dev` for
    DevNet) to obtain an anonymous JWT with Guest claims. **Please note that the
    JWT token has 30 days  expiration so if you are issuing calls to the data
    endpoints beyond 30 days, you should either pre-acquire a new JWT token in
    time before 30 days expire or respond to the returned HTTP 401 code by
    reacquiring a fresh JWT token.**

    3. The user creates, signs, and confirms a Solana transaction to the
    `subscribe` instruction, indicating the duration in weeks (must be a
    multiple of 4 weeks, e.g. 4, 8, 12) and the chosen service level. The user
    explicitly acts as the transaction fee payer. For the free tier, the smart
    contract registers the subscription but charges 0 TxLINE tokens.

    4. The user records the confirmed transaction signature (`txSig`).

    5. The user constructs a strict message binding consisting of the `txSig`, a
    comma-separated list of selected leagues, and the JWT.

    6. The user cryptographically signs this message using their wallet's secret
    key to generate a detached signature, which is then Base64-encoded.

    7. The user activates the subscription with the off-chain server at
    "https://txline.txodds.com/api/token/activate" (or `txline-dev` for DevNet)
    by posting the `txSig`, the Base64 wallet signature, and the selected
    leagues array, using the JWT for authorization.

    8. The off-chain server validates the cryptographic proof and entitlements,
    issuing an appropriate API Token or rejecting the activation with a reason.

    9. The user calls the documented APIs while the subscription is valid,
    supplying both the JWT and the API Token.

    10. Before the subscription expires, the user may call the `subscribe`
    instruction again to extend the validity period (by a multiple of 4 weeks,
    e.g. 4, 8, 12) via the same off-chain activation call. The selected leagues
    can also be amended.

    11. If the previous subscription has expired, the user can activate a new
    API Token by repeating the process.
servers:
  - url: https://txline.txodds.com
    description: Production TxLINE server
  - url: http://txline-dev.txodds.com
    description: Test TxLINE server
security: []
paths:
  /api/guest/purchase/quote:
    post:
      tags:
        - Purchase
      summary: >-
        Request a partially signed purchase quote given the wallet public key
        and required TxLINE amount in whole units
      description: >
        Authorize and generate a partially signed Solana transaction for
        purchasing TxLINE utility tokens.


        **Pricing & Fees:**

        - **Base Rate:** 1,000 TxLINE = 1 USDT

        - **Premium/Markup:** Currently 0% (0 basis points)


        **Prerequisites:**

        - The `buyerPubkey` wallet must hold an active Associated Token Account
        (ATA) for USDT.

        - The wallet must have a sufficient USDT balance to cover the total
        quoted cost.


        The response includes a financial breakdown of the exact base cost and
        any applied premium fees. The returned transaction payload must be
        signed by the user's wallet before submission.
      operationId: postApiGuestPurchaseQuote
      parameters:
        - name: Authorization
          in: header
          description: Bearer token for the guest session JWT.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseQuoteRequest'
            example:
              buyerPubkey: >-
                5kb6gnsSu1inDF9nCVV3WcgKryyBFGFkrYS28Sp1avS8mq6Xcw6iq3yzkBTjmq8bGptgqYTXPmjyWECzKzUxYG3C
              txlineAmount: 50
        required: true
      responses:
        '200':
          description: >-
            The partially signed transaction payload alongside the explicit USDT
            fee breakdown.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseQuoteResponse'
              example:
                transactionBase64: >-
                  AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAA...
                baseUsdtCost: 0.05
                feeUsdtAmount: 0
                totalUsdtCharged: 0.05
        '400':
          description: >-
            Validation failed: Payload exceeded maximum limits, or the buyer's
            wallet has insufficient USDT.
          content:
            text/plain:
              schema:
                type: string
        '401':
          description: 'Authorization failed: Invalid or expired guest JWT.'
          content:
            text/plain:
              schema:
                type: string
        '500':
          description: >-
            Blockchain error: Failed to derive PDAs or connect to the Solana
            RPC.
          content:
            text/plain:
              schema:
                type: string
      security:
        - httpAuth: []
components:
  schemas:
    PurchaseQuoteRequest:
      title: PurchaseQuoteRequest
      type: object
      required:
        - buyerPubkey
        - txlineAmount
      properties:
        buyerPubkey:
          description: The public key of the buyer's Solana wallet.
          type: string
        txlineAmount:
          description: >-
            The amount of whole utility TxLINE tokens to purchase. Must be
            strictly positive and not exceed 100000000 (100000 USDT equivalent).
          type: integer
          format: int64
          minimum: 1
          maximum: 100000000
    PurchaseQuoteResponse:
      title: PurchaseQuoteResponse
      type: object
      required:
        - transactionBase64
        - baseUsdtCost
        - feeUsdtAmount
        - totalUsdtCharged
      properties:
        transactionBase64:
          type: string
        baseUsdtCost:
          description: The raw USDT cost for the tokens before fees (in whole USDT).
          type: number
        feeUsdtAmount:
          description: The premium fee applied to the transaction (currently 0 USDT).
          type: number
        totalUsdtCharged:
          description: The final total USDT amount the wallet will be charged.
          type: number
  securitySchemes:
    httpAuth:
      type: http
      description: User's session JWT.
      scheme: bearer

````