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

# Criar transação

> Crie uma transação Pix, voucher ou cartão.

## Pagamentos por voucher

Use `method: "voucher"` para instruções locais de pagamento como Boleto, SPEI, Mercado Pago, Webpay, CODI e PSE. Não envie nomes específicos de provedor para este endpoint.

Para o fluxo completo de voucher, países suportados, tipos de documento e campos de resposta, veja [Receber pagamentos por voucher](/pt/payments/vouchers/accept-payments).


## OpenAPI

````yaml api-reference/openapi-v2.json POST /v2/transactions
openapi: 3.1.0
info:
  title: API PIX - v2
  description: API for Pagou.ai Gateway
  version: 2.0.0
  contact:
    name: Support
    url: https://pagou.ai
    email: support@pagou.ai
servers:
  - url: https://api.pagou.ai
    description: Production server
  - url: https://api.sandbox.pagou.ai
    description: Sandbox server for testing
security:
  - BearerAuth: []
  - ApiKeyAuth: []
  - BasicAuth: []
paths:
  /v2/transactions:
    post:
      tags:
        - API - Transactions
      summary: Create a Transaction
      description: Create a new transaction
      operationId: postTransactions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                external_ref:
                  nullable: true
                  description: >-
                    Optional idempotency key or external reference from your
                    system.
                  type: string
                amount:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  maximum: 100000000
                currency:
                  default: BRL
                  description: Transaction currency. Defaults to BRL.
                  type: string
                  enum:
                    - ARS
                    - BOB
                    - BRL
                    - CLP
                    - COP
                    - CRC
                    - GTQ
                    - MXN
                    - PYG
                    - PEN
                    - USD
                    - UYU
                method:
                  type: string
                  enum:
                    - pix
                    - voucher
                    - credit_card
                  description: Payment method to be used for the transaction.
                  default: pix
                installments:
                  nullable: true
                  description: Number of installments for the transaction when applicable.
                  type: integer
                  minimum: 1
                  maximum: 12
                interest_rate:
                  nullable: true
                  description: >-
                    Installment interest rate (%) embedded in the charged
                    amount, when applicable.
                  type: number
                  minimum: 0
                  maximum: 100
                buyer:
                  type: object
                  properties:
                    id:
                      nullable: true
                      description: Existing buyer identifier in your system or Pagou.
                      anyOf:
                        - type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        - type: string
                    name:
                      nullable: true
                      description: Full name of the buyer when id is not provided.
                      type: string
                    email:
                      nullable: true
                      description: Email address of the buyer when id is not provided.
                      type: string
                      format: email
                      pattern: >-
                        ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                    phone:
                      nullable: true
                      description: Buyer phone number.
                      type: string
                    birth_date:
                      nullable: true
                      description: Buyer birth date in string format.
                      type: string
                    document:
                      nullable: true
                      description: Buyer document information.
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - DNI
                            - CUIT
                            - CI
                            - CE
                            - NIT
                            - CPF
                            - CNPJ
                            - RUT
                            - RUN
                            - CC
                            - CDI
                            - PP
                            - RUC
                            - PAS
                            - DPI
                            - CUI
                            - RFC
                            - CURP
                        number:
                          type: string
                      required:
                        - type
                        - number
                    address:
                      nullable: true
                      description: Buyer billing or shipping address.
                      type: object
                      properties:
                        street:
                          type: string
                          minLength: 1
                        number:
                          type: string
                        complement:
                          nullable: true
                          type: string
                        neighborhood:
                          type: string
                        city:
                          type: string
                          minLength: 1
                        state:
                          type: string
                          minLength: 2
                          maxLength: 3
                          pattern: ^[\p{L}\p{N}]{2,3}$
                        zipCode:
                          type: string
                        country:
                          default: BR
                          type: string
                          enum:
                            - AR
                            - BO
                            - BR
                            - CL
                            - CO
                            - CR
                            - EC
                            - GT
                            - MX
                            - PA
                            - PY
                            - PE
                            - UY
                      required:
                        - street
                        - city
                  description: Buyer information for the transaction.
                products:
                  minItems: 1
                  maxItems: 100
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        minLength: 1
                        maxLength: 255
                        description: Product name or title.
                      price:
                        type: integer
                        minimum: 0
                        maximum: 100000000
                        description: Unit price in cents for the product.
                      quantity:
                        default: 1
                        description: Quantity of this product being purchased.
                        type: integer
                        minimum: 1
                        maximum: 999999
                      tangible:
                        default: false
                        description: Indicates if the product is a physical good.
                        type: boolean
                      sku:
                        nullable: true
                        description: Optional SKU or internal identifier for the product.
                        type: string
                        maxLength: 255
                    required:
                      - name
                      - price
                  description: List of products associated with the transaction.
                token:
                  description: >-
                    Optional payment token for card transactions. Use 'pgct_'
                    for single-use or 'pgpm_' for reusable (upsell) tokens.
                  type: string
                  pattern: ^(pgct_|pgpm_)
                notify_url:
                  nullable: true
                  description: Optional HTTPS URL to receive webhooks for this transaction.
                  type: string
                  maxLength: 2048
                metadata:
                  nullable: true
                  description: Optional metadata string for your own reference.
                  type: string
                traceable:
                  default: false
                  description: >-
                    Whether the transaction should be traceable for fraud or
                    risk analysis.
                  type: boolean
                ip_address:
                  nullable: true
                  description: IPv4 or IPv6 address of the buyer or request origin.
                  anyOf:
                    - type: string
                      format: ipv4
                      pattern: >-
                        ^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$
                    - type: string
                      format: ipv6
                      pattern: >-
                        ^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$
              required:
                - amount
                - method
                - buyer
                - products
      responses:
        '201':
          description: HTTP 201 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  requestId:
                    type: string
                  data:
                    type: object
                    properties:
                      id:
                        description: >-
                          Unique identifier of the transaction (numeric or
                          UUID).
                        type: string
                        format: uuid
                      amount:
                        type: integer
                        minimum: 100
                        maximum: 100000000
                        description: Total transaction amount in cents.
                      voucher:
                        nullable: true
                        type: object
                        properties:
                          barcode:
                            nullable: true
                            description: >-
                              Barcode string for boleto or voucher, when
                              applicable.
                            type: string
                          digitable_line:
                            nullable: true
                            description: >-
                              Digitable line representation of the boleto or
                              voucher.
                            type: string
                          url:
                            nullable: true
                            description: >-
                              URL where the boleto or voucher can be viewed or
                              downloaded.
                            type: string
                          expiration_date:
                            nullable: true
                            description: Expiration date of the boleto or voucher.
                            type: string
                            format: date-time
                          instructions:
                            nullable: true
                            description: >-
                              Additional payment instructions for the boleto or
                              voucher.
                            type: string
                          receipt_url:
                            nullable: true
                            description: URL to access the payment receipt, when available.
                            type: string
                        required:
                          - barcode
                          - digitable_line
                          - url
                          - expiration_date
                          - instructions
                          - receipt_url
                        additionalProperties: false
                      currency:
                        type: string
                        enum:
                          - ARS
                          - BOB
                          - BRL
                          - CLP
                          - COP
                          - CRC
                          - GTQ
                          - MXN
                          - PYG
                          - PEN
                          - USD
                          - UYU
                        description: Currency of the transaction.
                        default: BRL
                      buyer:
                        type: object
                        properties:
                          id:
                            type: string
                            description: Unique identifier of the buyer.
                            format: uuid
                          name:
                            type: string
                            description: Full name of the buyer.
                          email:
                            type: string
                            format: email
                            pattern: >-
                              ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                            description: Email address of the buyer.
                          phone:
                            type: string
                            description: Phone number of the buyer.
                          birth_date:
                            type: string
                            description: Birth date of the buyer.
                          document:
                            type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - DNI
                                  - CUIT
                                  - CI
                                  - CE
                                  - NIT
                                  - CPF
                                  - CNPJ
                                  - RUT
                                  - RUN
                                  - CC
                                  - CDI
                                  - PP
                                  - RUC
                                  - PAS
                                  - DPI
                                  - CUI
                                  - RFC
                                  - CURP
                              number:
                                type: string
                            required:
                              - type
                              - number
                            additionalProperties: false
                            description: Buyer document information.
                          address:
                            type: object
                            properties:
                              street:
                                type: string
                                minLength: 1
                              number:
                                type: string
                              complement:
                                nullable: true
                                type: string
                              neighborhood:
                                type: string
                              city:
                                type: string
                                minLength: 1
                              state:
                                type: string
                                minLength: 2
                                maxLength: 3
                                pattern: ^[\p{L}\p{N}]{2,3}$
                              zipCode:
                                type: string
                              country:
                                default: BR
                                type: string
                                enum:
                                  - AR
                                  - BO
                                  - BR
                                  - CL
                                  - CO
                                  - CR
                                  - EC
                                  - GT
                                  - MX
                                  - PA
                                  - PY
                                  - PE
                                  - UY
                            required:
                              - street
                              - city
                              - country
                            additionalProperties: false
                            description: Buyer billing or shipping address.
                        required:
                          - id
                          - name
                          - email
                          - phone
                          - birth_date
                          - document
                          - address
                        additionalProperties: false
                        description: Buyer details associated with the transaction.
                      external_ref:
                        nullable: true
                        description: External reference originally provided by your system.
                        type: string
                      fee:
                        type: object
                        properties:
                          net_amount:
                            type: integer
                            minimum: 0
                            maximum: 100000000
                            description: >-
                              Net amount in cents that will be settled after
                              fees.
                          estimated_fee:
                            type: integer
                            minimum: 0
                            maximum: 100000000
                            description: >-
                              Estimated processing fee in cents for this
                              transaction.
                        required:
                          - net_amount
                          - estimated_fee
                        additionalProperties: false
                        description: Fee breakdown for the transaction.
                      installments:
                        nullable: true
                        description: >-
                          Number of installments for the transaction, if
                          applicable.
                        type: integer
                        minimum: 1
                        maximum: 12
                      informations:
                        type: array
                        items:
                          type: object
                          properties:
                            key:
                              type: string
                              description: Key of the additional information entry.
                            value:
                              type: string
                              description: Value of the additional information entry.
                          required:
                            - key
                            - value
                          additionalProperties: false
                        description: >-
                          Additional information entries returned by the
                          processor or gateway.
                      paid_amount:
                        type: integer
                        minimum: 0
                        maximum: 100000000
                        description: Total amount in cents that has been paid.
                      paid_at:
                        nullable: true
                        description: >-
                          Timestamp of when the transaction was paid, if
                          applicable.
                        type: string
                        format: date-time
                      method:
                        type: string
                        enum:
                          - pix
                          - voucher
                          - credit_card
                        description: Payment method actually used in the transaction.
                        default: pix
                      pix:
                        nullable: true
                        description: PIX payment details when the method is PIX.
                        type: object
                        properties:
                          qr_code:
                            type: string
                            description: PIX QR code payload for payment.
                          expiration_date:
                            description: PIX QR code expiration date.
                            type: string
                            format: date-time
                          end_to_end_id:
                            nullable: true
                            description: >-
                              End-to-end identifier assigned to the PIX payment,
                              when available.
                            type: string
                          receipt_url:
                            nullable: true
                            description: >-
                              URL to access the PIX payment receipt, when
                              available.
                            type: string
                        required:
                          - qr_code
                          - expiration_date
                          - end_to_end_id
                          - receipt_url
                        additionalProperties: false
                      refunded_amount:
                        type: integer
                        minimum: 0
                        maximum: 100000000
                        description: Total refunded amount in cents for this transaction.
                      products:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                              maxLength: 255
                              description: Product name or title.
                            price:
                              type: integer
                              minimum: 0
                              maximum: 100000000
                              description: Unit price in cents for the product.
                            quantity:
                              type: integer
                              minimum: 1
                              maximum: 999999
                              description: Quantity of this product.
                          required:
                            - name
                            - price
                            - quantity
                          additionalProperties: false
                        description: List of products included in the transaction.
                      metadata:
                        nullable: true
                        description: >-
                          Arbitrary key-value metadata associated with the
                          transaction.
                        type: object
                        additionalProperties:
                          type: string
                      traceable:
                        type: boolean
                        description: Indicates whether the transaction is traceable.
                      ip_address:
                        nullable: true
                        description: IPv4 or IPv6 address associated with the transaction.
                        anyOf:
                          - type: string
                            format: ipv4
                            pattern: >-
                              ^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$
                          - type: string
                            format: ipv6
                            pattern: >-
                              ^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$
                      splits:
                        type: array
                        items:
                          type: object
                          properties:
                            recipient_id:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                              description: Identifier of the split recipient.
                            amount:
                              type: integer
                              minimum: 1
                              maximum: 100000000
                              description: >-
                                Split amount in cents to allocate to the
                                recipient.
                            charge_processing_fee:
                              default: true
                              description: >-
                                Indicates if processing fees are charged to this
                                recipient.
                              type: boolean
                          required:
                            - recipient_id
                            - amount
                            - charge_processing_fee
                          additionalProperties: false
                        description: Revenue split configuration for this transaction.
                      status:
                        type: string
                        enum:
                          - authorized
                          - canceled
                          - captured
                          - chargedback
                          - three_ds_required
                          - expired
                          - in_protest
                          - paid
                          - partially_paid
                          - partially_refunded
                          - pending
                          - processing
                          - processed
                          - refunded
                          - med
                          - refused
                        description: Current external status of the transaction.
                      next_action:
                        nullable: true
                        description: >-
                          Next action required to complete the transaction, such
                          as 3DS authentication.
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - three_ds_challenge
                            description: The type of next action required.
                          challenge_session_id:
                            type: string
                            description: Challenge session identifier for 3DS resolution.
                          client_secret:
                            type: string
                            description: Client secret for SDK polling authentication.
                          expires_at:
                            description: Expiration timestamp for the challenge session.
                            type: string
                            format: date-time
                        required:
                          - type
                          - challenge_session_id
                          - client_secret
                          - expires_at
                        additionalProperties: false
                      created_at:
                        description: Date and time when the transaction was created.
                        type: string
                        format: date-time
                      updated_at:
                        description: Date and time when the transaction was last updated.
                        type: string
                        format: date-time
                    required:
                      - id
                      - amount
                      - currency
                      - buyer
                      - fee
                      - informations
                      - paid_amount
                      - method
                      - refunded_amount
                      - products
                      - traceable
                      - splits
                      - status
                      - created_at
                      - updated_at
                    additionalProperties: false
                required:
                  - success
                  - requestId
                  - data
                additionalProperties: false
        '409':
          description: HTTP 409 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - DUPLICATE_EXTERNAL_REF
                  message:
                    type: string
                    enum:
                      - >-
                        A transaction with this external reference already
                        exists
                  status:
                    type: number
                    enum:
                      - 409
                required:
                  - error
                  - message
                  - status
                additionalProperties: false
        '422':
          description: HTTP 422 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  status:
                    type: number
                    enum:
                      - 422
                required:
                  - error
                  - message
                  - status
                additionalProperties: false
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '500':
          description: HTTP 500 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  status:
                    type: number
                    enum:
                      - 500
                required:
                  - error
                  - message
                  - status
                additionalProperties: false
        default:
          description: RFC 7807 Problem Details error response
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
        - BasicAuth: []
components:
  schemas:
    ValidationProblemDetails:
      allOf:
        - $ref: '#/components/schemas/ProblemDetails'
        - type: object
          properties:
            errors:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
                  code:
                    type: string
                additionalProperties: true
          additionalProperties: true
    ProblemDetails:
      type: object
      description: RFC 7807 Problem Details object.
      properties:
        type:
          type: string
          format: uri-reference
        title:
          type: string
        status:
          type: number
        detail:
          type: string
        instance:
          type: string
          format: uri-reference
      required:
        - type
        - title
        - status
        - detail
      additionalProperties: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apiKey
    BasicAuth:
      type: http
      scheme: basic
      description: Use Basic auth with username `token` and password `x`.

````