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

# Record external payment

> Records a payment received outside Quentli and optionally settles pending invoices with it.



## OpenAPI

````yaml /openapi.yaml post /v1/external-payments
openapi: 3.1.0
info:
  title: Quentli REST API
  version: 1.0.0
  description: OpenAPI spec for Quentli REST endpoints.
servers:
  - url: https://api.quentli.com
    description: Production API
  - url: https://api.staging.quentli.com
    description: Staging API for production-like validation
security:
  - organizationApiKey: []
  - oauthAccessToken: []
tags:
  - name: Auth
  - name: Management
  - name: Billing
  - name: Catalog
  - name: Customers
  - name: Invoices
  - name: Payment Methods
  - name: Payment Sessions
  - name: Payments
  - name: Subscriptions
  - name: Tax Invoices
  - name: Webhooks
  - name: Messaging
paths:
  /v1/external-payments:
    post:
      tags:
        - Payments
      summary: Record external payment
      description: >-
        Records a payment received outside Quentli and optionally settles
        pending invoices with it.
      operationId: external_payments_create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateExternalPaymentArgs'
      responses:
        '200':
          description: External payment recorded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateExternalPaymentPayload'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '403':
          description: Permission denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '404':
          description: Customer not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
components:
  schemas:
    CreateExternalPaymentArgs:
      type: object
      properties:
        input:
          type: object
          properties:
            customerId:
              type: string
            amount:
              type: integer
              exclusiveMinimum: 0
              maximum: 2147483647
            currency:
              type: string
            externalTypeId:
              type:
                - string
                - 'null'
            paymentTime:
              anyOf:
                - type: string
                  description: Date string
                - type: string
                  format: date-time
                  description: Date object
              default: '2026-11-19T20:54:00.920Z'
            description:
              type: string
            invoiceAllocations:
              type:
                - array
                - 'null'
              items:
                type: object
                properties:
                  invoiceId:
                    type: string
                    minLength: 1
                  settledAmount:
                    type: integer
                    exclusiveMinimum: 0
                required:
                  - invoiceId
                  - settledAmount
              minItems: 1
              maxItems: 100
          required:
            - customerId
            - amount
            - currency
      required:
        - input
      description: Request body for recording a payment received outside Quentli.
    CreateExternalPaymentPayload:
      type: object
      properties:
        payment:
          $ref: '#/components/schemas/Payment'
      required:
        - payment
      description: The recorded external payment.
    UserError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - error
      additionalProperties: false
      description: Standard user-facing error response envelope.
    Payment:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the payment.
          example: p_1234567890abcdefghij
        createdAt:
          type: string
          format: date-time
          description: When the payment record was created.
          example: '2025-01-15T18:30:00.000Z'
        updatedAt:
          type: string
          format: date-time
          description: When the payment was last updated.
          example: '2025-01-15T18:30:00.000Z'
        amount:
          type: number
          description: Payment amount in minor currency units.
          example: 150000
        currency:
          type: string
          description: ISO 4217 currency code.
          example: MXN
        description:
          type:
            - string
            - 'null'
          description: Human-readable description of the payment.
          example: Colegiatura Enero 2025
        type:
          type:
            - string
            - 'null'
          enum:
            - TRANSFER
            - CARD
            - OXXO
            - OTHER
            - CASH
            - DIRECT_DEBIT
            - null
          description: Payment type.
          example: CARD
        status:
          type:
            - string
            - 'null'
          enum:
            - INCOMPLETE
            - COMPLETE
            - CANCELED
            - INITIATED
            - REFUNDED
            - DISPUTED
            - REVERTED
            - null
          description: Current payment status.
          example: COMPLETE
        isCompleted:
          type: boolean
          description: Whether the payment has been fully settled.
          example: true
        paymentTime:
          type:
            - string
            - 'null'
          format: date-time
          description: Date and time when the payment was completed.
          example: '2025-01-15T18:30:00.000Z'
        customerId:
          type: string
          description: Identifier of the customer who made the payment.
          example: cus_1234567890abcdefghij
        paymentIntentId:
          type:
            - string
            - 'null'
          description: Payment processor intent identifier, if any.
          example: null
        paymentMethodId:
          type:
            - string
            - 'null'
          description: Identifier of the payment method used, if any.
          example: pm_1234567890abcdefghij
        organizationId:
          type: string
          description: Identifier of the owning organization.
          example: org_1234567890abcdefghij
        skipTaxInvoice:
          type: boolean
          description: Whether tax invoice generation is skipped for this payment.
          example: false
        monthlyInstallments:
          type:
            - integer
            - 'null'
          description: Number of monthly installments, if any.
          example: null
        processor:
          type:
            - string
            - 'null'
          enum:
            - FISERV
            - KUSHKI
            - QUENTLI
            - SANTANDER
            - STRIPE
            - TAPI
            - null
          description: Processor that handled the payment, if any.
          example: null
        processorFee:
          type:
            - integer
            - 'null'
          description: Processor fee in minor currency units, if known.
          example: null
        processorFeeTax:
          type:
            - integer
            - 'null'
          description: Tax on the processor fee in minor currency units, if known.
          example: null
        installmentsFee:
          type:
            - integer
            - 'null'
          description: Installments fee in minor currency units, if any.
          example: null
        installmentsFeeTax:
          type:
            - integer
            - 'null'
          description: Tax on the installments fee in minor currency units, if any.
          example: null
        externalPaymentTypeId:
          type:
            - string
            - 'null'
          description: External payment type identifier when type is OTHER.
          example: null
        sessionId:
          type:
            - string
            - 'null'
          description: Payment session identifier associated with this payment, if any.
          example: null
        metadata:
          type:
            - array
            - 'null'
          items:
            type: object
            properties:
              key:
                type: string
              value:
                type: string
            required:
              - key
              - value
            additionalProperties: false
          description: Structured metadata entries.
          example: null
        meta:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
          description: Flattened metadata key-value map.
          example: null
      required:
        - id
        - createdAt
        - updatedAt
        - amount
        - currency
        - description
        - type
        - status
        - isCompleted
        - paymentTime
        - customerId
        - paymentIntentId
        - organizationId
        - skipTaxInvoice
        - monthlyInstallments
        - processor
        - processorFee
        - processorFeeTax
        - installmentsFee
        - installmentsFeeTax
        - externalPaymentTypeId
        - sessionId
      description: A payment record for a completed or pending transaction.
  securitySchemes:
    organizationApiKey:
      type: http
      scheme: bearer
      description: 'Organization API key using `Authorization: Bearer sk_...`.'
    oauthAccessToken:
      type: http
      scheme: bearer
      bearerFormat: OAuth 2.1
      description: 'OAuth access token using `Authorization: Bearer qoa_at_...`.'

````

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