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

# Generate Card Top Up QR Code

> Generate QR Code for Card Top Up card balance



## OpenAPI

````yaml v2/api-reference/openapi.json POST /v2/cards/{id}/topup/qrcode
openapi: 3.0.0
info:
  title: Trio API v2
  version: 2026-10-19.v2
servers:
  - url: https://api.sandbox.trio.com.br
    variables: {}
  - url: https://api.qa.trio.com.br
    variables: {}
  - url: https://api.trio.com.br
    variables: {}
security: []
tags: []
paths:
  /v2/cards/{id}/topup/qrcode:
    parameters:
      - description: >-
          Version of the v2 contract the client is written against. Each
          breaking change publishes a new version.
        example: 2026-10-19.v2
        in: header
        name: Trio-Version
        required: true
        schema:
          enum:
            - 2026-10-19.v2
          type: string
          x-struct: null
          x-validate: null
      - description: >-
          ID of another org to act on instead of the API key's own org. The
          key's org must have been granted access to it, and the request is
          refused with 403 FORBIDDEN otherwise. When that access or the API key
          is read-only, only GET and HEAD requests may carry it. When the target
          org requires mTLS, so does the request. Leave it out to act on the
          key's own org.
        in: header
        name: Trio-Target-Org-Id
        required: false
        schema:
          format: uuid
          type: string
          x-struct: null
          x-validate: null
    post:
      tags:
        - Cards
      summary: Generate QR Code for Card Top Up card balance
      description: Generate QR Code for Card Top Up card balance
      operationId: TrioFoundationWeb.V2.CardController.topup_qrcode
      parameters:
        - description: Card ID
          in: path
          name: id
          required: true
          schema:
            $ref: '#/components/schemas/UUID'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V2_card_top_up_balance_via_qrcode_params'
        description: Top Up Card Balance QR Code
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2_card_top_up_QR_code_response'
          description: Topup QR Code
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2_error'
          description: >-
            Malformed request: a body that is not valid JSON
            (MALFORMED_REQUEST), or a Trio-Version header that is missing or not
            the current one (INVALID_TRIO_VERSION).
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2_error'
          description: Missing or invalid API key credentials (INVALID_CREDENTIALS).
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2_error'
          description: >-
            The API key may not do this (FORBIDDEN): for instance
            Trio-Target-Org-Id names an org it has no access to, or writes
            through a read-only access.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2_error'
          description: No resource with this ID (NOT_FOUND_RESOURCE).
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2_error'
          description: >-
            Invalid input (INVALID_PARAMETER, REQUIRED_PARAMETER, or the code of
            the rule the request breaks). A request outside the operation's
            schema lists the offending fields in `errors`.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2_error'
          description: >-
            A service needed to answer is unavailable
            (TRIO_SERVICE_UNAVAILABLE).
      callbacks: {}
      security:
        - authorization: []
components:
  schemas:
    UUID:
      description: Unique identifier
      format: uuid
      title: UUID
      type: string
      x-struct: null
      x-validate: null
    V2_card_top_up_balance_via_qrcode_params:
      description: >-
        Generates a Pix QR code that tops up the card in the path once it is
        paid
      example:
        amount:
          amount: 1000
          currency: BRL
        counterparty:
          name: John Doe
          tax_number: '12345678909'
        entity_id: 019514eb-5d5c-4a1e-9f0b-1c2d3e4f5a6b
      properties:
        amount:
          $ref: '#/components/schemas/V2_card_amount_params'
        counterparty:
          description: Who pays the QR code
          properties:
            name:
              description: Name
              type: string
              x-struct: null
              x-validate: null
            tax_number:
              description: CPF or CNPJ
              type: string
              x-struct: null
              x-validate: null
          required:
            - name
            - tax_number
          type: object
          x-struct: null
          x-validate: null
        entity_id:
          description: ID of the entity that holds the card
          format: uuid
          type: string
          x-struct: null
          x-validate: null
      required:
        - entity_id
        - amount
        - counterparty
      title: V2 card top up balance via qrcode params
      type: object
      x-struct: >-
        Elixir.TrioFoundationWeb.Schemas.Banking.V2.Card.TopUpBalanceQrcodeParams
      x-validate: null
    V2_card_top_up_QR_code_response:
      description: The QR code created
      example:
        data:
          amount:
            amount: 10000
            currency: BRL
          description: 0197a339-481c-5bc5-7809-3bc11807df2f
          expiration_datetime: '2025-06-24T23:35:30.091799Z'
          hash: >-
            00020101021226630014br.gov.bcb.pix2541pix.example.com/cob/01K1BWRSMG89A3TE0SNZFNPMH05204000053039865802BR5910brcodename6010brcodecity62070503***6304E6A4
          id: 0197a339-49ab-27db-a98d-29c56a0c1b1c
      properties:
        data:
          $ref: '#/components/schemas/V2_card_top_up_QR_code'
      required:
        - data
      title: V2 card top up QR code response
      type: object
      x-struct: >-
        Elixir.TrioFoundationWeb.Schemas.Banking.V2.Card.TopUpBalanceQrcodeResponse
      x-validate: null
    V2_error:
      example:
        error:
          error_code: INVALID_PARAMETER
          error_message: 'Invalid parameters: /amount: Invalid integer. Got: string'
          errors:
            - field: /amount
              message: 'Invalid integer. Got: string'
      properties:
        error:
          properties:
            error_code:
              description: >-
                Stable UPPER_SNAKE identifier of the error, for programs and
                logs. Branch on this, not on the message.
              type: string
              x-struct: null
              x-validate: null
            error_message:
              description: Human readable explanation of the error.
              type: string
              x-struct: null
              x-validate: null
            errors:
              description: >-
                Only on INVALID_PARAMETER for a request outside the operation's
                schema: one entry per offending field.
              items:
                properties:
                  field:
                    description: JSON pointer to the field, e.g. /amount.
                    type: string
                    x-struct: null
                    x-validate: null
                  message:
                    description: What is wrong with it.
                    type: string
                    x-struct: null
                    x-validate: null
                required:
                  - field
                  - message
                type: object
                x-struct: null
                x-validate: null
              type: array
              x-struct: null
              x-validate: null
          required:
            - error_code
            - error_message
          type: object
          x-struct: null
          x-validate: null
      required:
        - error
      title: V2 error
      type: object
      x-struct: Elixir.TrioFoundationWeb.Schemas.HTTP.V2Error
      x-validate: null
    V2_card_amount_params:
      description: Amount of money to move, in cents
      example:
        amount: 1000
        currency: BRL
      properties:
        amount:
          description: Amount in cents
          minimum: 1
          type: integer
          x-struct: null
          x-validate: null
        currency:
          description: Currency
          enum:
            - BRL
          type: string
          x-struct: null
          x-validate: null
      required:
        - amount
        - currency
      title: V2 card amount params
      type: object
      x-struct: Elixir.TrioFoundationWeb.Schemas.Banking.V2.Card.AmountParams
      x-validate: null
    V2_card_top_up_QR_code:
      description: Pix QR code that tops up a card
      example:
        amount:
          amount: 10000
          currency: BRL
        description: 0197a339-481c-5bc5-7809-3bc11807df2f
        expiration_datetime: '2025-06-24T23:35:30.091799Z'
        hash: >-
          00020101021226630014br.gov.bcb.pix2541pix.example.com/cob/01K1BWRSMG89A3TE0SNZFNPMH05204000053039865802BR5910brcodename6010brcodecity62070503***6304E6A4
        id: 0197a339-49ab-27db-a98d-29c56a0c1b1c
      properties:
        amount:
          $ref: '#/components/schemas/V2_card_money'
        description:
          description: QR code description
          type: string
          x-struct: null
          x-validate: null
        expiration_datetime:
          description: When the QR code expires
          format: date-time
          type: string
          x-struct: null
          x-validate: null
        hash:
          description: Pix copy and paste code
          type: string
          x-struct: null
          x-validate: null
        id:
          description: QR code ID
          format: uuid
          type: string
          x-struct: null
          x-validate: null
      required:
        - id
        - description
        - hash
        - amount
        - expiration_datetime
      title: V2 card top up QR code
      type: object
      x-struct: Elixir.TrioFoundationWeb.Schemas.Banking.V2.Card.TopupQrCodeData
      x-validate: null
    V2_card_money:
      description: An amount of money in cents. It can be zero or negative.
      example:
        amount: 10000
        currency: BRL
      properties:
        amount:
          description: Amount in cents
          type: integer
          x-struct: null
          x-validate: null
        currency:
          description: Currency
          enum:
            - BRL
          type: string
          x-struct: null
          x-validate: null
      required:
        - amount
        - currency
      title: V2 card money
      type: object
      x-struct: Elixir.TrioFoundationWeb.Schemas.Banking.V2.Card.Money
      x-validate: null
  securitySchemes:
    authorization:
      scheme: basic
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.