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

# Criar cobrança Pix

> Cria uma cobrança Pix. Exige o escopo `payment_intents:write` e o cabeçalho `Idempotency-Key`.



## OpenAPI

````yaml /openapi.json post /v1/payment-intents
openapi: 3.1.0
info:
  title: MingoPay API
  version: 1.0.0
  description: >-
    API pública para cobranças Pix, subcontas, devoluções e consulta de saldo.
    Valores monetários em centavos; ambientes e saldos são isolados.
servers:
  - url: https://api.mingopay.com.br
    description: API MingoPay
security:
  - bearerAuth: []
tags:
  - name: Cobranças
    description: Criação, consulta e reconciliação de cobranças Pix.
  - name: Devoluções
    description: Devoluções parciais ou totais de cobranças pagas.
  - name: Saldo
    description: Saldo disponível calculado pelo ledger da organização.
  - name: Sandbox
    description: Simulações disponíveis somente para chaves mp_test_.
  - name: Subcontas
    description: >-
      Subcontas administradas pela sua organização, com cobranças e saldos
      separados.
paths:
  /v1/payment-intents:
    post:
      tags:
        - Cobranças
      summary: Criar cobrança Pix
      description: >-
        Cria uma cobrança Pix. Exige o escopo `payment_intents:write` e o
        cabeçalho `Idempotency-Key`.
      operationId: createPaymentIntent
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePaymentIntentRequest'
            example:
              externalReference: pedido_1024
              amountCents: 14990
              method: pix
              description: Pedido 1024
              expiresInSeconds: 1800
              payer:
                name: Cliente Exemplo
                taxId: '52998224725'
                email: cliente@example.com
              metadata:
                orderId: '1024'
      responses:
        '201':
          description: Cobrança criada.
          headers:
            idempotent-replayed:
              description: Presente com valor true quando a resposta foi reproduzida.
              schema:
                type: string
                const: 'true'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedPaymentIntent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      description: Chave única de 16 a 128 caracteres seguros para esta tentativa.
      schema:
        type: string
        pattern: ^[A-Za-z0-9._-]{16,128}$
        example: pedido-1024-cobranca-001
  schemas:
    CreatePaymentIntentRequest:
      type: object
      additionalProperties: false
      required:
        - amountCents
        - method
        - payer
      properties:
        externalReference:
          type: string
          minLength: 1
          maxLength: 100
        amountCents:
          type: integer
          minimum: 100
          maximum: 100000000
          description: Valor em centavos.
        method:
          type: string
          const: pix
        description:
          type: string
          minLength: 1
          maxLength: 140
        expiresInSeconds:
          type: integer
          minimum: 60
          maximum: 86400
          default: 1800
        payer:
          $ref: '#/components/schemas/Payer'
        metadata:
          type: object
          additionalProperties: true
          default: {}
        subaccountId:
          type: string
          format: uuid
          description: >-
            ID MingoPay da subconta da mesma organização e ambiente. O crédito
            líquido pertence exclusivamente a ela.
    CreatedPaymentIntent:
      allOf:
        - $ref: '#/components/schemas/PaymentIntent'
        - type: object
          required:
            - pix
          properties:
            pix:
              $ref: '#/components/schemas/PixInstructions'
    Payer:
      type: object
      additionalProperties: false
      required:
        - name
        - taxId
      properties:
        name:
          type: string
          minLength: 2
          maxLength: 120
          description: >-
            Nome visível do pagador. Não aceita HTML, caracteres de controle nem
            marcas de direção invisíveis.
        taxId:
          type: string
          description: CPF ou CNPJ válido. Pontuação é removida pela API.
          examples:
            - '52998224725'
        email:
          type: string
          format: email
          maxLength: 254
          description: >-
            E-mail permanente. Domínios descartáveis, typos de Gmail, Outlook,
            Hotmail, Yahoo e iCloud, e domínios sem entrega são recusados.
    PaymentIntent:
      type: object
      required:
        - id
        - organizationId
        - amountCents
        - feeCents
        - netCents
        - currency
        - method
        - status
        - metadata
        - createdAt
        - updatedAt
        - environment
        - providerFeeCents
        - platformFeeCents
        - commissionCents
        - mingoFeeCents
      properties:
        id:
          type: string
          format: uuid
        organizationId:
          type: string
          format: uuid
        customerId:
          type:
            - string
            - 'null'
          format: uuid
        externalReference:
          type:
            - string
            - 'null'
        amountCents:
          type: integer
        feeCents:
          type: integer
          description: 'Total descontado: mingoFeeCents + commissionCents.'
        netCents:
          type: integer
        currency:
          type: string
          const: BRL
        method:
          type: string
          enum:
            - pix
            - card
        status:
          $ref: '#/components/schemas/PaymentIntentStatus'
        provider:
          type:
            - string
            - 'null'
        providerReference:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        metadata:
          type: object
          additionalProperties: true
        expiresAt:
          type:
            - string
            - 'null'
          format: date-time
        paidAt:
          type:
            - string
            - 'null'
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        subaccountId:
          type:
            - string
            - 'null'
          format: uuid
        environment:
          type: string
          enum:
            - sandbox
            - production
        providerFeeCents:
          type: integer
        platformFeeCents:
          type: integer
          description: >-
            Receita Mingo: mingoFeeCents - providerFeeCents, sem a comissão do
            criador.
        commissionCents:
          type: integer
          minimum: 0
          description: Comissão do criador da subconta, incluída em feeCents.
        mingoFeeCents:
          type: integer
          minimum: 0
          description: Tarifa Mingo, incluindo o custo do provedor.
    PixInstructions:
      type: object
      required:
        - copyPasteCode
        - expiresAt
      properties:
        copyPasteCode:
          type: string
        expiresAt:
          type: string
          format: date-time
    ApiError:
      type: object
      required:
        - error
        - message
        - requestId
      properties:
        error:
          type: string
        message:
          type: string
        requestId:
          type: string
        details:
          type: array
          items:
            type: object
            required:
              - path
              - message
            properties:
              path:
                type: string
              message:
                type: string
    PaymentIntentStatus:
      type: string
      enum:
        - created
        - pending
        - processing
        - paid
        - failed
        - cancelled
        - partially_refunded
        - refunded
  responses:
    BadRequest:
      description: Requisição inválida.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Unauthorized:
      description: Chave ausente ou inválida.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Forbidden:
      description: >-
        Ambiente, organização ou escopo não autorizado. Organizações suspensas
        (restricted) ou encerradas (closed) retornam organization_not_active em
        sandbox e produção.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Conflict:
      description: Conflito de estado ou idempotência.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    UnprocessableEntity:
      description: Operação válida, mas incompatível com os valores ou o estado atual.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    RateLimited:
      description: Limite de requisições excedido.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ServiceUnavailable:
      description: Provedor ou operação temporariamente indisponível.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Chave de API MingoPay com prefixo mp_test_ ou mp_live_.

````

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