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

# Obtain invoice payment instructions

> Creates or reuses a pending CASH or TRANSFER payment and returns its payment instructions.



## OpenAPI

````yaml /openapi.yaml post /v1/invoices/{id}/payments
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
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}/payments:
    post:
      tags:
        - Invoices
      summary: Obtain invoice payment instructions
      description: >-
        Creates or reuses a pending CASH or TRANSFER payment and returns its
        payment instructions.
      operationId: invoices_obtain_payment
      parameters:
        - schema:
            type: string
            description: Identifier of the invoice.
          required: true
          description: Identifier of the invoice.
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ObtainInvoicePaymentRequest'
      responses:
        '200':
          description: Invoice payment instructions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObtainInvoicePaymentPayload'
        '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:
    ObtainInvoicePaymentRequest:
      type: object
      properties:
        input:
          type: object
          properties:
            paymentType:
              type: string
              enum:
                - CASH
                - TRANSFER
              description: Offline payment type to obtain for the invoice.
              example: TRANSFER
          required:
            - paymentType
          additionalProperties: false
      required:
        - input
      additionalProperties: false
      description: >-
        Request body for obtaining a CASH or TRANSFER payment. Invoice ID is
        provided in the URL path.
    ObtainInvoicePaymentPayload:
      type: object
      properties:
        payment:
          oneOf:
            - type: object
              properties:
                id:
                  type: string
                  description: Identifier of the pending payment.
                  example: p_1234567890abcdefghij
                amount:
                  type: integer
                  description: Payment amount in minor currency units.
                  example: 25000
                currency:
                  type: string
                  description: ISO 4217 currency code.
                  example: MXN
                isCompleted:
                  type: boolean
                  enum:
                    - false
                  description: Always false while the payment instructions are pending.
                  example: false
                type:
                  type: string
                  enum:
                    - CASH
                cashPaymentInstructions:
                  type: object
                  properties:
                    reference:
                      type: string
                      description: Reference used to pay in cash.
                      example: '12345678901234567890'
                    expiresAt:
                      anyOf:
                        - type: string
                          description: Date string
                        - type: string
                          format: date-time
                          description: Date object
                        - nullable: true
                      description: When the cash reference expires, if applicable.
                      example: null
                  required:
                    - reference
                    - expiresAt
                  additionalProperties: false
              required:
                - id
                - amount
                - currency
                - isCompleted
                - type
                - cashPaymentInstructions
              additionalProperties: false
            - type: object
              properties:
                id:
                  type: string
                  description: Identifier of the pending payment.
                  example: p_1234567890abcdefghij
                amount:
                  type: integer
                  description: Payment amount in minor currency units.
                  example: 25000
                currency:
                  type: string
                  description: ISO 4217 currency code.
                  example: MXN
                isCompleted:
                  type: boolean
                  enum:
                    - false
                  description: Always false while the payment instructions are pending.
                  example: false
                type:
                  type: string
                  enum:
                    - TRANSFER
                transferInstruction:
                  type: object
                  properties:
                    bankName:
                      type: string
                      description: Receiving bank name.
                      example: STP
                    clabe:
                      type: string
                      description: Receiving CLABE for the transfer.
                      example: '646180157000000001'
                    reference:
                      type: string
                      nullable: true
                      description: Transfer reference, if required.
                      example: '123456'
                    expiresAt:
                      anyOf:
                        - type: string
                          description: Date string
                        - type: string
                          format: date-time
                          description: Date object
                        - nullable: true
                      description: When the transfer instruction expires, if applicable.
                      example: null
                  required:
                    - bankName
                    - clabe
                    - reference
                    - expiresAt
                  additionalProperties: false
              required:
                - id
                - amount
                - currency
                - isCompleted
                - type
                - transferInstruction
              additionalProperties: false
      required:
        - payment
      additionalProperties: false
      description: Pending invoice payment with the instructions required to complete it.
    UserError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - error
      additionalProperties: false
      description: Standard user-facing error response envelope.
  securitySchemes:
    organizationApiKey:
      type: http
      scheme: bearer
      description: 'Organization API key using `Authorization: Bearer sk_...`.'

````