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

# Criar cobrança PIX (QR Code imediato)

> Gera um QR Code PIX dinâmico, sem vencimento. A cobrança nasce com `status` `pending` e é confirmada por webhook.



## OpenAPI

````yaml /openapi-transacional.yaml post /v1/pix/in/qrcode
openapi: 3.0.3
info:
  title: API Ephra
  description: >-
    API REST para gerar cobranças (PIX, cartão e boleto), consultar transações e
    gerenciar webhooks.
  version: 1.0.0
servers:
  - url: https://api.ephra.io
    description: Servidor de produção
security:
  - bearerAuth: []
tags:
  - name: Autenticação
    description: Login e obtenção do token de acesso
  - name: Pagamentos
    description: Criação de cobranças PIX, cartão e boleto
  - name: Assinaturas
    description: Cobrança recorrente — iniciar, listar, consultar e cancelar assinaturas
  - name: Transações
    description: Consulta de transações
  - name: Webhooks
    description: Cadastro e gerenciamento de webhooks
paths:
  /v1/pix/in/qrcode:
    post:
      tags:
        - Pagamentos
      summary: Criar cobrança PIX (QR Code imediato)
      description: >-
        Gera um QR Code PIX dinâmico, sem vencimento. A cobrança nasce com
        `status` `pending` e é confirmada por webhook.
      operationId: createPixQrCode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PixQrCodeRequest'
            example:
              amountInCents: 49900
              description: 'Pedido #1234 — Curso de Tráfego Pago'
              customer:
                name: Mariana Ribeiro Alves
                email: mariana.alves@exemplo.com.br
                documentType: cpf
                document: '39053344705'
                phone: '+5521998877665'
      responses:
        '200':
          description: Cobrança criada
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PixResponse'
              example:
                success: true
                message: Transação criada com sucesso
                data:
                  id: clxabc123def456
                  pix:
                    emv: >-
                      00020126580014br.gov.bcb.pix0136c1f4d0e2-9a3b-4c7d-8e1f-2a5b6c7d8e9f5204000053039865802BR5913EPHRA
                      PAGTOS6009SAO PAULO62070503***6304ABCD
                    qrCode: >-
                      data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5f
                  status: pending
                  fees: 1591
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    PixQrCodeRequest:
      type: object
      required:
        - amountInCents
        - customer
      properties:
        amountInCents:
          type: integer
          description: Valor em centavos (> 0)
          example: 10000
        description:
          type: string
          example: 'Pedido #1234'
        postbackUrl:
          type: string
          format: uri
          description: Recebe webhooks só desta transação
        customer:
          $ref: '#/components/schemas/Customer'
        seller:
          $ref: '#/components/schemas/Seller'
        items:
          type: array
          items:
            $ref: '#/components/schemas/Item'
    PixResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Transação criada com sucesso
        data:
          type: object
          properties:
            id:
              type: string
              example: clxabc123def456
            pix:
              type: object
              properties:
                emv:
                  type: string
                  example: 00020126580014br.gov.bcb.pix...6304ABCD
                qrCode:
                  type: string
                  description: PNG em base64
                  example: data:image/png;base64,iVBORw0KG...
            status:
              type: string
              example: pending
            fees:
              type: integer
              example: 150
    Customer:
      type: object
      required:
        - documentType
        - document
      properties:
        documentType:
          type: string
          enum:
            - cpf
            - cnpj
          example: cpf
        document:
          type: string
          description: CPF/CNPJ do pagador (validado)
          example: '12345678909'
        name:
          type: string
          example: Maria Silva
        email:
          type: string
          format: email
          example: maria@email.com
        phone:
          type: string
          example: '+5511999998888'
        billingAddress:
          $ref: '#/components/schemas/Address'
    Seller:
      type: object
      required:
        - name
        - documentType
        - document
      properties:
        name:
          type: string
        documentType:
          type: string
          enum:
            - cpf
            - cnpj
        document:
          type: string
        phone:
          type: string
        averageTicket:
          type: number
        address:
          $ref: '#/components/schemas/Address'
    Item:
      type: object
      required:
        - title
        - tangible
        - quantity
        - amountInCents
      properties:
        title:
          type: string
          example: Produto A
        tangible:
          type: boolean
          example: false
        quantity:
          type: integer
          minimum: 1
          example: 1
        amountInCents:
          type: integer
          example: 10000
        shippingAddress:
          $ref: '#/components/schemas/Address'
    Error:
      type: object
      properties:
        statusCode:
          type: integer
          example: 400
        error:
          type: string
          example: Bad Request
        message:
          type: string
          example: Mensagem descritiva do erro
    Address:
      type: object
      properties:
        street:
          type: string
        number:
          type: string
        neighborhood:
          type: string
        city:
          type: string
        state:
          type: string
        zipCode:
          type: string
  responses:
    BadRequest:
      description: Requisição inválida
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 400
            error: Bad Request
            message: Documento inválido para o tipo selecionado
    Unauthorized:
      description: Token ausente, inválido ou expirado
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 401
            error: Unauthorized
            message: Token inválido ou expirado
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````