> ## 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 a Pix Payment (v2)

> Generate a Pix payment using the v2 endpoint, pix key direct



## OpenAPI

````yaml api-reference/banking-api/openapi.json POST /banking/cashout/pix/v2
openapi: 3.0.0
info:
  title: Banking API
  version: 1.0.0
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:
  /banking/cashout/pix/v2:
    post:
      tags:
        - cashout
      summary: Generates a Pix v2
      description: Generates a Pix v2
      operationId: TrioFoundationWeb.Banking.Cashout.Pix.V2Controller.generate
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Generate_pix_v2_create_params'
        description: The generation Pix v2 attributes
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneratePixResponse'
          description: GeneratePixV2
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/500'
          description: Internal server error
      callbacks: {}
components:
  schemas:
    '401':
      example:
        error:
          error_code: UNAUTHORIZED
          error_message: Invalid credentials
      properties:
        error:
          properties:
            error_code:
              description: Error code
              type: string
            error_message:
              description: Error message
              type: string
          type: object
      title: '401'
      type: object
    '500':
      example:
        error:
          error_code: INTEGRATION_ERROR
          error_message: An unexpected issue occurred
      properties:
        error:
          properties:
            error_code:
              description: Error code
              type: string
            error_message:
              description: Error message
              type: string
          type: object
      title: '500'
      type: object
    Generate_pix_v2_create_params:
      description: Body params to generate a Pix v2
      example:
        amount: 100
        description: description
        external_id: external_id 1
        reference: '05964110000197'
        reference_tax_number: '05964110000197'
        type: key
        virtual_account_id: 1a760495-cb95-4023-96e8-0cff5776b010
      properties:
        amount:
          description: Amount
          maximum: 100000000000
          type: integer
        description:
          description: Pix description
          type: string
        external_id:
          description: External ID
          type: string
        platform_id:
          description: Platform ID
          nullable: true
          type: string
        reference:
          description: Receiver Pix key or receiver brcode
          type: string
        reference_bank_accounts:
          description: Receiver bank account list reference
          items:
            $ref: '#/components/schemas/ReferenceBankAccount'
          type: array
        reference_tax_number:
          description: Receiver tax number reference
          type: string
        type:
          $ref: '#/components/schemas/PixRefTypeV2'
        virtual_account_id:
          $ref: '#/components/schemas/UUID'
      required:
        - amount
        - reference
        - type
        - virtual_account_id
      title: Generate pix v2 create params
      type: object
    GeneratePixResponse:
      description: Response schema for a single Pix generation
      example:
        data:
          payment_document_id: 41234d60-f6a9-4c9c-8cc3-5769ce9bbea2
      properties:
        data:
          properties:
            payment_document_id:
              description: Payment document unique identifier
              format: uuid
              type: string
          type: object
      title: GeneratePixResponse
      type: object
    JsonErrorResponse:
      properties:
        errors:
          items:
            properties:
              detail:
                example: null value where string expected
                type: string
              source:
                properties:
                  pointer:
                    example: /data/attributes/petName
                    type: string
                required:
                  - pointer
                type: object
              title:
                example: Invalid value
                type: string
            required:
              - title
              - source
              - detail
            type: object
          type: array
      required:
        - errors
      title: JsonErrorResponse
      type: object
    ReferenceBankAccount:
      description: ReferenceBankAccount
      properties:
        branch:
          description: Branch
          type: string
        digit:
          description: Digit
          type: string
        ispb:
          description: ISPB
          type: string
        number:
          description: Number
          type: string
        type:
          description: Type
          type: string
      title: ReferenceBankAccount
      type: object
    PixRefTypeV2:
      description: Pix reference type
      enum:
        - key
        - brcode
      title: PixRefTypeV2
      type: string
    UUID:
      description: Unique identifier
      format: uuid
      title: UUID
      type: string

````