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

# Create custom quote claim plan

> Build a transaction plan to claim custom quote fees or a holding balance for a wallet. Returns a staged transaction plan: sign and send the entries in `response.transactions` in order. If `response.readiness.status` is `setup_required`, confirm the setup transaction(s) first, then call this endpoint again to fetch the rebuilt plan. Sponsorship depends on the operation. The wallet must still fund applicable rent or reimbursements; holding-only withdrawals use the user as payer. Payouts remain in the original quote token, subject to token transfer fees.

See [Claim Custom Quote Fees](/how-to-guides/claim-custom-quote-fees) for discovery, source selection, and claiming.


## OpenAPI

````yaml POST /token-launch/create-claim-txs/v2
openapi: 3.1.0
info:
  title: Bags Public API v2
  description: API endpoints for Bags platform
  version: 2.0.0
  contact:
    name: Bags Support
    url: https://support.bags.fm
servers:
  - url: https://public-api-v2.bags.fm/api/v1
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Token Launch
    description: Endpoints for creating and managing token launches
  - name: Fee Share
    description: Endpoints for managing fee sharing configs
  - name: Fee Share Admin
    description: >-
      Endpoints for fee share admin operations including listing, transferring
      admin authority, and updating configs
  - name: Analytics
    description: Endpoints for retrieving token analytics and metadata
  - name: Fee Claiming
    description: Endpoints for claiming fees from various sources
  - name: State
    description: Endpoints for retrieving on-chain state and derived state
  - name: Trade
    description: Endpoints for getting trade quotes and executing token swaps
  - name: Partner
    description: Endpoints for managing partner configurations and claiming partner fees
  - name: Solana
    description: Endpoints for direct Solana blockchain interactions
  - name: EVM
    description: Endpoints for reading Bags EVM token data
  - name: Robinhood Chain
    description: Read endpoints for Bags V2 tokens on Robinhood Chain (chain id 4663)
  - name: Dexscreener
    description: >-
      Endpoints for managing Dexscreener token info orders, payments, and image
      uploads
  - name: Auth
    description: Endpoints for retrieving authenticated user information
  - name: Agent
    description: Endpoints for AI agent wallet-signature authentication (V2)
paths:
  /token-launch/create-claim-txs/v2:
    post:
      tags:
        - Fee Claiming
      summary: Create custom quote claim plan
      description: >-
        Build a transaction plan to claim custom quote fees or a holding balance
        for a wallet. Returns a staged transaction plan: sign and send the
        entries in `response.transactions` in order. If
        `response.readiness.status` is `setup_required`, confirm the setup
        transaction(s) first, then call this endpoint again to fetch the rebuilt
        plan. Sponsorship depends on the operation. The wallet must still fund
        applicable rent or reimbursements; holding-only withdrawals use the user
        as payer. Payouts remain in the original quote token, subject to token
        transfer fees.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuoteClaimRequest'
      responses:
        '200':
          description: Successfully built the claim transaction plan
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessResponse'
                  - type: object
                    properties:
                      response:
                        $ref: '#/components/schemas/QuoteTransactionPlan'
        '400':
          description: Bad request - invalid parameters, or nothing available to claim
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    QuoteClaimRequest:
      allOf:
        - $ref: '#/components/schemas/QuoteBuildOptionsRequest'
        - type: object
          properties:
            feeClaimer:
              type: string
              description: Public key of the fee claimer wallet
            tokenMint:
              type: string
              description: Token mint public key
            quoteMint:
              type: string
              description: >-
                Optional: expected quote mint. Must match the selected config or
                holding vault; it does not change the payout asset.
              nullable: true
            source:
              description: >-
                Optional: which specific claimable source to build a claim for.
                Omit to let the server pick the default (position/pair) source.
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - position
                  required:
                    - kind
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - pair
                  required:
                    - kind
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - pool
                    protocol:
                      type: string
                      enum:
                        - dbc
                        - damm_v2
                    pool:
                      type: string
                      description: Public key of the pool to claim from
                  required:
                    - kind
                    - protocol
                    - pool
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - holding
                    authority:
                      type: string
                      description: Public key of the holding vault authority
                  required:
                    - kind
                    - authority
              nullable: true
          required:
            - feeClaimer
            - tokenMint
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        response:
          description: ''
      required:
        - success
    QuoteTransactionPlan:
      description: >-
        A staged, potentially multi-transaction plan for a custom quote
        operation. Sign and send the entries in `transactions` in order; if
        `readiness.status` is `setup_required`, confirm the setup transaction(s)
        first, then call this endpoint again to fetch the rebuilt plan.
      type: object
      properties:
        contractVersion:
          type: number
          enum:
            - 1
          description: Version of the quote transaction plan contract
        operation:
          $ref: '#/components/schemas/QuoteOperation'
        asset:
          $ref: '#/components/schemas/QuoteAsset'
        feeLimits:
          type: array
          items:
            $ref: '#/components/schemas/QuoteFeeLimit'
          description: Fee limits that were applied while building this plan
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/QuoteTransactionStage'
          description: >-
            Ordered transaction stages to sign and send. Empty when
            readiness.status is setup_required and the lookup table is still
            warming up.
        readiness:
          $ref: '#/components/schemas/QuoteTransactionReadiness'
      required:
        - contractVersion
        - operation
        - asset
        - feeLimits
        - transactions
        - readiness
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: Error message
      required:
        - success
        - error
    QuoteBuildOptionsRequest:
      type: object
      properties:
        transactionFormat:
          type: string
          enum:
            - v0
            - v1
          description: 'Optional: requested transaction wire format. Defaults to v0.'
          nullable: true
        feeLimits:
          type: array
          items:
            $ref: '#/components/schemas/QuoteFeeLimit'
          description: >-
            Optional: signed token transfer-fee schedule ceilings. Defaults to
            the observed active schedule; a higher execution-time rate or cap
            fails the bounded transaction. Maximum 4 entries.
          maxItems: 4
          nullable: true
        additionalLookupTables:
          type: array
          items:
            type: string
            description: Public key of a lookup table address
          description: >-
            Optional: extra address lookup tables to compile the transactions
            against. Maximum 8 entries.
          maxItems: 8
          nullable: true
    QuoteOperation:
      description: What this transaction plan accomplishes.
      oneOf:
        - type: object
          properties:
            kind:
              type: string
              enum:
                - config
            baseMint:
              type: string
            flow:
              type: string
              enum:
                - dbc
                - damm_v2_direct
          required:
            - kind
            - baseMint
            - flow
        - type: object
          properties:
            kind:
              type: string
              enum:
                - manager_update
            baseMint:
              type: string
            flow:
              type: string
              enum:
                - dbc
                - damm_v2_direct
          required:
            - kind
            - baseMint
            - flow
        - type: object
          properties:
            kind:
              type: string
              enum:
                - launch
            baseMint:
              type: string
            flow:
              type: string
              enum:
                - dbc
                - damm_v2_direct
          required:
            - kind
            - baseMint
            - flow
        - type: object
          properties:
            kind:
              type: string
              enum:
                - holding_claim
            baseMint:
              type: string
            wallet:
              type: string
            authority:
              type: string
          required:
            - kind
            - baseMint
            - wallet
            - authority
        - type: object
          properties:
            kind:
              type: string
              enum:
                - position_claim
            baseMint:
              type: string
            wallet:
              type: string
          required:
            - kind
            - baseMint
            - wallet
    QuoteAsset:
      type: object
      properties:
        mint:
          type: string
          description: Public key of the asset mint
        tokenProgram:
          type: string
          description: >-
            Public key of the SPL token program that owns this mint (Token or
            Token-2022)
        decimals:
          type:
            - number
            - 'null'
          description: >-
            Decimals configured on the mint, or null when it could not be
            observed
      required:
        - mint
        - tokenProgram
        - decimals
    QuoteFeeLimit:
      type: object
      properties:
        asset:
          $ref: '#/components/schemas/QuoteAssetRef'
        basisPoints:
          type: number
          minimum: 0
          maximum: 10000
          description: >-
            Ceiling on the active token transfer-fee rate, in basis points.
            Checked independently from maximumFeeRaw.
        maximumFeeRaw:
          type: string
          description: >-
            Ceiling on the active token transfer-fee schedule cap, as a decimal
            string to support bigint (raw u64 units). This is not an aggregate
            fee budget.
      required:
        - asset
        - basisPoints
        - maximumFeeRaw
    QuoteTransactionStage:
      type: object
      properties:
        id:
          type: string
          description: Identifier for this stage, unique within the plan
        kind:
          type: string
          enum:
            - config
            - claim
            - manager_update
            - launch
            - lookup_table_setup
          description: What this stage's transaction does
        dependsOn:
          type: array
          items:
            type: string
          description: Ids of stages that must land before this one can be submitted
        format:
          type: string
          enum:
            - v0
            - v1
          description: Selected wire format for this stage's transaction
        encoding:
          type: string
          enum:
            - base64
          description: Encoding of the transaction field
        transaction:
          type: string
          description: Base64 encoded transaction, partially signed where required
        messageSha256:
          type: string
          description: Hex-encoded SHA-256 hash of the transaction's unsigned message bytes
        requiredSigners:
          type: array
          items:
            type: string
          description: >-
            All public keys required to sign, including signers whose signatures
            may already be present. Preserve existing signatures and add missing
            ones.
        lifetime:
          type: object
          properties:
            blockhash:
              type: string
              description: Recent blockhash the transaction was built against
            lastValidBlockHeight:
              type: string
              description: >-
                Last block height for which the blockhash is valid, as a
                string-encoded amount
          required:
            - blockhash
            - lastValidBlockHeight
        budget:
          type: object
          properties:
            computeUnitLimit:
              type: number
              description: Compute unit limit requested for this transaction
            loadedAccountsDataSizeLimit:
              type: number
              description: >-
                Loaded accounts data size limit requested for this transaction,
                in bytes
            priorityFee:
              description: >-
                Priority fee for this stage's transaction. The unit depends on
                the selected transaction format: v1 stages report a total
                lamport amount, v0 stages report a
                micro-lamports-per-compute-unit rate.
              oneOf:
                - type: object
                  properties:
                    unit:
                      type: string
                      enum:
                        - total_lamports
                    amount:
                      type: string
                      description: >-
                        Total priority fee in lamports, as a string-encoded
                        amount
                  required:
                    - unit
                    - amount
                - type: object
                  properties:
                    unit:
                      type: string
                      enum:
                        - micro_lamports_per_compute_unit
                    amount:
                      type: string
                      description: >-
                        Priority fee rate in micro-lamports per compute unit, as
                        a string-encoded amount
                  required:
                    - unit
                    - amount
          required:
            - computeUnitLimit
            - loadedAccountsDataSizeLimit
            - priorityFee
        size:
          type: object
          properties:
            bytes:
              type: number
              description: Serialized transaction size in bytes
            accounts:
              type: number
              description: Number of accounts referenced by the transaction
            signatures:
              type: number
              description: Number of signatures required by the transaction
          required:
            - bytes
            - accounts
            - signatures
      required:
        - id
        - kind
        - dependsOn
        - format
        - encoding
        - transaction
        - messageSha256
        - requiredSigners
        - lifetime
        - budget
        - size
    QuoteTransactionReadiness:
      description: >-
        Whether the plan's transactions are ready to send, or whether an address
        lookup table needs to be created/warmed up first.
      oneOf:
        - type: object
          properties:
            status:
              type: string
              enum:
                - ready
          required:
            - status
        - type: object
          properties:
            status:
              type: string
              enum:
                - setup_required
            lookupTables:
              type: array
              items:
                type: string
              description: Lookup table address(es) involved in the setup step
            minimumSlotExclusive:
              type:
                - string
                - 'null'
              description: >-
                Slot after which the lookup table can be relied on, as a
                string-encoded amount, or null while it is still being created
            action:
              type: string
              enum:
                - confirm_setup_refetch_and_rebuild
              description: >-
                Confirm the setup transaction(s) in `transactions`, then call
                this endpoint again to fetch the rebuilt plan
          required:
            - status
            - lookupTables
            - minimumSlotExclusive
            - action
    QuoteAssetRef:
      type: object
      properties:
        mint:
          type: string
          description: Public key of the asset mint
        tokenProgram:
          type: string
          description: >-
            Public key of the SPL token program that owns this mint (Token or
            Token-2022)
      required:
        - mint
        - tokenProgram
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key authentication. Provide your API key as the header value.

````