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

# Record supplier invoice payment

> Records a (partial) payment of a matched or approved invoice. Payments are entered manually — paying itself happens in the accounting system.



## OpenAPI

````yaml /openapi.yaml post /supplier_invoices/{supplier_invoice_id}/payments
openapi: 3.0.1
info:
  title: GetSpecs REST API
  description: REST API documentation for GetSpecs.
  version: 1.0.0
servers:
  - url: /v1
  - url: https://demo-api.getspecs.io/v1
security: []
paths:
  /supplier_invoices/{supplier_invoice_id}/payments:
    post:
      tags:
        - SupplierInvoicePayment
      summary: Record supplier invoice payment
      description: >-
        Records a (partial) payment of a matched or approved invoice. Payments
        are entered manually — paying itself happens in the accounting system.
      operationId: supplier_invoice_payments#create
      parameters:
        - name: supplier_invoice_id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestBodySupplierInvoicePayment'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/supplier_invoice_payment'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
        - apiKey: []
          workspaceId: []
components:
  schemas:
    requestBodySupplierInvoicePayment:
      type: object
      description: >-
        Records a (partial) payment of a matched or approved invoice; the paid
        total can't exceed the net amount. The payment is split across the
        invoice's purchase orders and stored — without `allocations`
        proportionally across all of them (by their items' amount on the
        invoice), with `allocations` ids only proportionally across the selected
        ones, with ids and amounts exactly (amounts must add up to `amount`; a
        PO may get more than its share).
      properties:
        allocations:
          type: array
          items:
            type: object
            properties:
              purchase_order_id:
                type: integer
              amount:
                type: string
                nullable: true
            required:
              - purchase_order_id
        amount:
          type: string
          example: '2500.00'
        paid_on:
          type: string
          format: date
        reference:
          type: string
          nullable: true
        notes:
          type: string
          nullable: true
      required:
        - amount
        - paid_on
    supplier_invoice_payment:
      type: object
      properties:
        id:
          type: integer
        amount:
          type: string
          example: '2500.00'
        paid_on:
          type: string
          format: date
        reference:
          type: string
          nullable: true
          description: Bank / transfer reference.
        notes:
          type: string
          nullable: true
        allocations:
          type: array
          description: >-
            How the payment is split across the invoice's purchase orders (adds
            up to `amount`). One entry per PO, whichever projects the invoice
            bills it on.
          items:
            type: object
            properties:
              purchase_order:
                type: object
                properties:
                  id:
                    type: integer
                  label:
                    type: string
              amount:
                type: string
        created_by_id:
          type: integer
          nullable: true
        created_at:
          type: string
          format: date-time
      required:
        - id
        - amount
        - paid_on
    error:
      type: object
      properties:
        error:
          type: string
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                nullable: true
              code:
                type: string
                nullable: true
              message:
                type: string
            required:
              - message
  securitySchemes:
    apiKey:
      type: apiKey
      name: authorization
      in: header
    workspaceId:
      type: apiKey
      name: X-Workspace-ID
      in: header

````

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