> ## 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.

# Retry invoice payment

> Attempts to charge the invoice using the associated payment method.



## OpenAPI

````yaml /openapi.yaml post /v1/invoices/{id}/try-payment
openapi: 3.0.3
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
  - url: https://api.demo.quentli.com
    description: Demo API hostname served by staging
security:
  - organizationApiKey: []
tags:
  - name: Auth
  - name: Billing
  - name: Catalog
  - name: Customers
  - name: Invoices
  - name: Payment Methods
  - name: Payment Sessions
  - name: Payments
  - name: Subscriptions
  - name: Tax Invoices
  - name: Webhooks
paths:
  /v1/invoices/{id}/try-payment:
    post:
      tags:
        - Invoices
      summary: Retry invoice payment
      description: Attempts to charge the invoice using the associated payment method.
      operationId: invoices_try_payment
      parameters:
        - schema:
            type: string
            description: Identifier of the invoice.
          required: true
          description: Identifier of the invoice.
          name: id
          in: path
      responses:
        '200':
          description: Payment attempt result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetryInvoicePaymentPayload'
        '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: Invoice not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
components:
  schemas:
    RetryInvoicePaymentPayload:
      type: object
      properties:
        success:
          type: boolean
          description: Whether the payment attempt succeeded.
        payment:
          $ref: '#/components/schemas/Payment'
        invoice:
          $ref: '#/components/schemas/Invoice'
      required:
        - success
        - payment
        - invoice
      description: Result of retrying a payment for an invoice.
    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
          nullable: true
          description: Human-readable description of the payment.
          example: Colegiatura Enero 2025
        type:
          type: string
          nullable: true
          enum:
            - TRANSFER
            - CARD
            - OXXO
            - OTHER
            - CASH
            - DIRECT_DEBIT
            - null
          description: Payment type.
          example: CARD
        status:
          type: string
          nullable: true
          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
          nullable: true
          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
          nullable: true
          description: Payment processor intent identifier, if any.
          example: null
        paymentMethodId:
          type: string
          nullable: true
          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
          nullable: true
          description: Number of monthly installments, if any.
          example: null
        processor:
          type: string
          nullable: true
          enum:
            - FISERV
            - KUSHKI
            - QUENTLI
            - SANTANDER
            - STRIPE
            - TAPI
            - null
          description: Processor that handled the payment, if any.
          example: null
        processorFee:
          type: integer
          nullable: true
          description: Processor fee in minor currency units, if known.
          example: null
        processorFeeTax:
          type: integer
          nullable: true
          description: Tax on the processor fee in minor currency units, if known.
          example: null
        installmentsFee:
          type: integer
          nullable: true
          description: Installments fee in minor currency units, if any.
          example: null
        installmentsFeeTax:
          type: integer
          nullable: true
          description: Tax on the installments fee in minor currency units, if any.
          example: null
        externalPaymentTypeId:
          type: string
          nullable: true
          description: External payment type identifier when type is OTHER.
          example: null
        sessionId:
          type: string
          nullable: true
          description: Payment session identifier associated with this payment, if any.
          example: null
        metadata:
          type: array
          nullable: true
          items:
            type: object
            properties:
              key:
                type: string
              value:
                type: string
            required:
              - key
              - value
            additionalProperties: false
          description: Structured metadata entries.
          example: null
        meta:
          type: object
          nullable: true
          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.
    Invoice:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the invoice.
          example: inv_1234567890abcdefghij
        createdAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
          description: Date and time when the invoice was created.
          example: '2025-01-10T12:00:00.000Z'
        updatedAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
          description: Date and time when the invoice was last updated.
          example: '2025-01-10T12:00:00.000Z'
        customerId:
          type: string
          description: Identifier of the customer this invoice belongs to.
          example: cus_1234567890abcdefghij
        subscriptionId:
          type: string
          nullable: true
          description: Identifier of the subscription that generated this invoice, if any.
          example: sub_1234567890abcdefghij
        collectionMethod:
          type: string
          enum:
            - AUTOMATIC
            - SEND_REMINDER
            - NONE
          description: 'How payment is collected: AUTOMATIC, SEND_REMINDER, or NONE.'
          example: SEND_REMINDER
        totalAmount:
          type: number
          description: Computed total amount of the invoice in minor units.
          example: 150000
        currency:
          type: string
          description: ISO 4217 currency code for the invoice.
          example: MXN
        dueDate:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
          description: Date and time when payment is due.
          example: '2025-02-01T06:00:00.000Z'
        expireDate:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
            - nullable: true
          description: Date and time when the invoice expires.
          example: null
        organizationId:
          type: string
          description: Identifier of the organization that owns this invoice.
          example: org_1234567890abcdefghij
        isPaid:
          type: boolean
          description: Whether the invoice has been fully paid.
          example: false
        paidById:
          type: string
          nullable: true
          description: Identifier of the customer who paid the invoice.
          example: null
        amountPaid:
          type: number
          description: Total amount paid so far in minor units.
          example: 0
        beneficiaryId:
          type: string
          nullable: true
          description: Identifier of the beneficiary customer, if any.
          example: null
        allowOfftimePayment:
          type: boolean
          description: Whether payment is accepted outside the due window.
          example: false
        paidWithId:
          type: string
          nullable: true
          description: Identifier of the payment that settled the invoice.
          example: null
        canceledAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
            - nullable: true
          description: Date and time when the invoice was canceled.
          example: null
        canceledById:
          type: string
          nullable: true
          description: Identifier of the user who canceled the invoice.
          example: null
        items:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceItem'
          description: Line items included in this invoice.
          example:
            - id: invi_1234567890abcdefghij
              description: Colegiatura Enero 2025
              conceptId: pc_1234567890abcdefghij
              concept: null
              quantity: 1
        meta:
          type: object
          nullable: true
          additionalProperties:
            type: string
          description: Flattened metadata map where each key maps to a string value.
          example:
            Ciclo Escolar: 2025-1
      required:
        - id
        - createdAt
        - updatedAt
        - customerId
        - subscriptionId
        - collectionMethod
        - totalAmount
        - currency
        - dueDate
        - expireDate
        - organizationId
        - isPaid
        - paidById
        - amountPaid
        - beneficiaryId
        - allowOfftimePayment
        - paidWithId
        - canceledAt
        - canceledById
        - items
      description: Invoice record representing a payment request sent to a customer.
    InvoiceItem:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the invoice item.
          example: invi_1234567890abcdefghij
        description:
          type: string
          description: Human-readable description of the line item.
          example: Colegiatura Enero 2025
        conceptId:
          type: string
          nullable: true
          description: Identifier of the payment concept for this item.
          example: pc_1234567890abcdefghij
        quantity:
          type: number
          minimum: 1
          description: Quantity of units for this line item.
          example: 1
      required:
        - id
        - description
        - conceptId
        - quantity
      description: A single line item within an invoice.
  securitySchemes:
    organizationApiKey:
      type: http
      scheme: bearer
      description: 'Organization API key using `Authorization: Bearer sk_...`.'

````