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

# Generate badge attribution code

> Generates a code that a member can use to earn a badge.



## OpenAPI

````yaml https://api.openpage.fun/v1/docs.json get /community/{id}/badge/{badgeId}/code
openapi: 3.0.0
info:
  title: OpenPage API Reference
  description: ''
  version: '1.0'
  contact: {}
servers:
  - url: https://api.openpage.fun/v1
security: []
tags:
  - name: Launcher
    description: >-
      Launcher endpoints are used to interact with your embedded or external
      experiences.


      **Launcher endpoints require setting up a Community Experience.**


      See: [Community
      Experiences](/api-reference/community-experiences/create-experience)
  - name: Communities
    description: >-
      Community endpoints are used to retrieve information about your
      Communities and associated members.


      **Community API endpoints require an API key obtained from the Community
      dashboard.**


      [Community Dashboard](https://portal.openpage.fun)
  - name: Community Badges
    description: >-
      Community Badge endpoints are used to create and manage badges, their
      associated rewards, and member attributions.


      **Community Badge endpoints require an API key obtained from the Community
      dashboard.**


      [Community Dashboard](https://portal.openpage.fun)
  - name: Community Files
    description: >-
      Community File endpoints are used to create and manage files used for
      Badges and Collections.


      **Community File endpoints require an API key obtained from the Community
      dashboard.**


      [Community Dashboard](https://portal.openpage.fun)
  - name: Community Experiences
    description: >-
      Community Experience endpoints are used to create and manage experiences.


      **Community Experience endpoints require an API key obtained from the
      Community dashboard.**


      [Community Dashboard](https://portal.openpage.fun)
paths:
  /community/{id}/badge/{badgeId}/code:
    get:
      tags:
        - Community Badges
      summary: Generate badge attribution code
      description: Generates a code that a member can use to earn a badge.
      operationId: CommunityBadgeController_generateQrCode
      parameters:
        - name: id
          required: true
          in: path
          description: Community ID
          schema:
            type: string
        - name: badgeId
          required: true
          in: path
          description: ID of the badge to generate the code for.
          schema:
            type: string
        - name: seed
          required: false
          in: query
          description: >-
            Optional seed to generate a one-time use code (this is required and
            must be a valid wallet address if the code will be consumed by the
            /attribution endpoint)
          schema:
            type: string
        - name: expiresIn
          required: false
          in: query
          description: >-
            Number of seconds the code will be valid for. Leave empty if you
            want the code to be valid indefinitely.
          schema:
            type: number
        - name: generateQR
          required: true
          in: query
          description: Generate a QR image for the code (defaults to true).
          schema:
            type: boolean
      responses:
        '200':
          description: QR code data URL
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      name: X-Api-Key
      in: header

````