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

# Mint NFT

> Mint an ERC-721 NFT for a record on Ethereum Sepolia. The server wallet pays gas and receives the token initially. The record must have status `unclaimed`.



## OpenAPI

````yaml /openapi.json post /api/records/{wm_id}/mint
openapi: 3.0.3
info:
  title: SQR API
  description: >-
    Invisible watermarking, digital twin registration, and NFT minting for
    product authentication.
  version: 1.0.0
  contact:
    name: SQR Support
    url: https://yys-sqr-render-bsbe.onrender.com
servers:
  - url: https://yys-sqr-render-bsbe.onrender.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Health
    description: Server status
  - name: Templates
    description: Record templates and field definitions
  - name: Records
    description: Create, read, update, and sync digital twin records
  - name: Watermarking
    description: Embed and scan invisible watermarks
  - name: NFT
    description: Mint and claim ERC-721 tokens for records
  - name: API Keys
    description: Manage API keys (requires Supabase JWT)
paths:
  /api/records/{wm_id}/mint:
    post:
      tags:
        - NFT
      summary: Mint NFT
      description: >-
        Mint an ERC-721 NFT for a record on Ethereum Sepolia. The server wallet
        pays gas and receives the token initially. The record must have status
        `unclaimed`.
      parameters:
        - name: wm_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: NFT minted
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  tx_hash:
                    type: string
                  token_id:
                    type: integer
                  etherscan_url:
                    type: string
                  card:
                    $ref: '#/components/schemas/Record'
        '400':
          description: Record already minted or claimed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Web3 not configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Record:
      type: object
      properties:
        watermark_id:
          type: string
          example: SQR-A1B2C
        template_id:
          type: string
          example: pharma
        claim_status:
          type: string
          enum:
            - unclaimed
            - minted
            - claimed
          example: unclaimed
        description:
          type: string
          nullable: true
        record_metadata:
          type: object
          additionalProperties:
            type: string
          example:
            product_name: Aspirin
            dosage: 100mg
        image_url:
          type: string
          nullable: true
        watermarked_image_url:
          type: string
          nullable: true
        scan_count:
          type: integer
          example: 0
        nft_token_id:
          type: integer
          nullable: true
        mint_transaction_hash:
          type: string
          nullable: true
        owner_address:
          type: string
          nullable: true
        claimed_by:
          type: string
          nullable: true
        claim_transaction_hash:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        minted_at:
          type: string
          format: date-time
          nullable: true
        claimed_at:
          type: string
          format: date-time
          nullable: true
    Error:
      type: object
      properties:
        error:
          type: string
          example: Not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Pass a Supabase JWT or a 48-character hex API key as a Bearer token.

````