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

# Criar Transação

> Cria uma nova cobrança PIX dinâmica com processamento instantâneo.



## OpenAPI

````yaml POST /transactions
openapi: 3.1.0
info:
  title: Pixzy API
  version: 1.0.0
  description: >-
    API do Pixzy para processar pagamentos e saques via PIX de forma
    automatizada. Todos os valores monetários são representados em centavos (R$
    10,00 = 1000).
servers:
  - url: https://app.pixzypay.com/api
    description: Produção
security:
  - bearerAuth: []
paths:
  /transactions:
    post:
      tags:
        - Transações
      summary: Criar Transação
      description: >-
        Cria uma nova cobrança PIX dinâmica. O pagamento é processado
        instantaneamente e você pode receber notificações via webhook.
      operationId: createTransaction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTransactionRequest'
            example:
              amount: 1000
              client_name: João Silva
              client_email: joao@email.com
              client_doc: 123.456.789-00
              client_phone: (11) 99999-9999
              webhook_url: https://api.loja.com/pix
              metadata:
                pedido_id: ABC-123
      responses:
        '200':
          description: Transação criada
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      transaction_id:
                        type: string
                        description: UUID da transação.
                        example: 019c7547-0433-7363-b8d8-704680370307
                      br_code:
                        type: string
                        description: Código PIX copia e cola (BR Code).
                        example: 00020126580014BR.GOV.BCB.PIX...
                      amount:
                        type: integer
                        example: 1000
                      status:
                        type: string
                        example: pending
                      metadata:
                        type: object
                        additionalProperties: true
                        nullable: true
                        example:
                          pedido_id: ABC-123
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/ValidationTransaction'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/GatewayUnavailable'
components:
  schemas:
    CreateTransactionRequest:
      type: object
      required:
        - amount
        - client_name
        - client_email
        - client_doc
      properties:
        amount:
          type: integer
          minimum: 500
          description: 'Valor em centavos (mínimo: 500 = R$ 5,00).'
          example: 1000
        client_name:
          type: string
          description: Nome completo do pagador.
          example: João Silva
        client_email:
          type: string
          format: email
          description: E-mail válido do pagador.
          example: joao@email.com
        client_doc:
          type: string
          description: CPF ou CNPJ (apenas números ou formatado).
          example: 123.456.789-00
        client_phone:
          type: string
          description: Telefone do pagador.
          example: (11) 99999-9999
        webhook_url:
          type: string
          format: uri
          description: URL para receber notificações de status.
        ip:
          type: string
          description: IP do cliente. Se não enviado, é capturado automaticamente.
        metadata:
          type: object
          additionalProperties: true
          description: Objeto JSON com dados extras (máximo 20 chaves).
        utms:
          type: object
          additionalProperties: true
          description: Objeto com parâmetros UTM de rastreamento.
    GenericError:
      type: object
      properties:
        error:
          type: string
          description: Mensagem de erro.
  responses:
    Unauthorized:
      description: Token ausente ou inválido.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericError'
          example:
            error: Unauthenticated
    Forbidden:
      description: Conta inativa ou sem permissão.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericError'
          example:
            error: Account not active
    ValidationTransaction:
      description: Campos obrigatórios faltando ou inválidos (transações).
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: string
          example:
            errors: O campo amount é obrigatório.
    RateLimited:
      description: Muitas requisições. Aguarde o tempo indicado no header Retry-After.
      headers:
        Retry-After:
          description: Segundos até poder tentar novamente.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericError'
          example:
            error: Too Many Requests
    GatewayUnavailable:
      description: Gateway de pagamento temporariamente indisponível.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericError'
          example:
            error: Service unavailable
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer Token gerado em Configurações > Tokens de API.

````