---
title: "Register an expense payment"
method: POST
path: "/companies/{company}/purchase-invoices/{purchase_invoice}/payments"
tags: ["Purchase Invoices"]
---

# Register an expense payment

`POST /companies/{company}/purchase-invoices/{purchase_invoice}/payments`

## Request

- Base URL: `https://api.factuarea.com/v1`
- URL: `https://api.factuarea.com/v1/companies/{company}/purchase-invoices/{purchase_invoice}/payments`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Record a partial or total payment against an expense and append it to its ledger; returns `201` with a `Location` header.
- Returns `422` if amount is zero or above the balance, `paid_on` is future, or the expense is cancelled.
- When payments cover the total the expense settles on its own; no `mark_paid` call is needed.

## Path parameters

- `company` string, uuid, required
- `purchase_invoice` string, uuid, required

## Headers

- `Idempotency-Key` string
- `Factuarea-Version` string, date

## Request body

- RegisterPurchaseInvoicePaymentRequest: Register a partial (or full) payment against an expense. Required: `amount` (> 0), `paid_on` (date) and `payment_method` (a value from the closed catalog). Optional: `bank_account_id`, `reference`, `notes`. The domain invariants (amount within the pending balance, payment date not later than today — an earlier date than the issue date is an advance payment —, expense not cancelled) are enforced with a 422.
  - `amount` number, required
  - `paid_on` string, date, required
  - `payment_method` string, required
  - `bank_account_id` integer, nullable
  - `reference` string, nullable
  - `notes` string, nullable

## Response `201`

The newly registered purchase-invoice payment.

- object
  - `data` PurchaseInvoicePayment, required: A single payment recorded against a purchase invoice (payment ledger entry). Listed by `GET /v1/companies/{company}/purchase-invoices/{purchase_invoice}/payments` and returned by `POST` on the same path.
    - `id` string, uuid, required: Opaque UUID v7 of the payment.
    - `object` 'purchase_invoice_payment', required: String identifying the object type. Always `purchase_invoice_payment`.
    - `amount` string, required: Payment amount as a string with two decimal places (Stripe-style).
    - `paid_date` string, date, required: Payment date (YYYY-MM-DD). Renamed from `paid_on`, which is no longer emitted; the INPUT field of `POST` keeps the old name on purpose.
    - `payment_method` string, required: Payment method (backing value of the Shared enum `PaymentMethod`, e.g. `bank_transfer`).
    - `bank_account_id` integer, nullable, required: Internal bank account the payment was settled into, or `null`.
    - `reference` string, nullable, required: Payment reference/operation number. `null` if not provided.
    - `notes` string, nullable, required: Internal notes for the payment. `null` if not provided.
    - `is_reversed` boolean, required: Whether the payment has been reverted. A reverted payment stays in the ledger but stops counting towards `paid_amount`/`pending_amount` — read this flag, do not infer the state from absence.
    - `reversed_at` string, date-time, nullable, required: When the payment was reverted (ISO 8601), or `null` while it is in force.
    - `reversal_reason` string, nullable, required: Reason the payment was reverted, from the closed catalog. `null` while the payment is in force.
    - `reversal_reason_text` string, nullable, required: Human-readable label of the reversal reason (Spanish), or `null`.
    - `reversal_note` string, nullable, required: Free-text remark recorded with the reversal, or `null`.
    - `created_at` string, date-time, required: When the payment was recorded (ISO 8601).

## Other responses

- `400`: `parameter_unknown` with `subcode` `retired_active_profile_header`: the retired `X-Active-Profile` header was sent; the company goes in the path. `parameter_invalid_format` on `Factuarea-Version`: the header is not a `YYYY-MM-DD` date. `unsupported_api_version`: the `Factuarea-Version` date is not a supported version.
- `401`: Missing or invalid API key.
- `403`: The request is authenticated but not allowed: the API key lacks the required scope (`insufficient_scope`), the plan does not include the public API or this feature (`addon_not_active`, `feature_not_available_in_plan`), or the module is not available with a test key (`module_not_available_in_sandbox`).
- `404`: The requested resource does not exist or belongs to another company.
- `422`: Validation failed, or the expense cannot undergo the requested state transition (e.g. marking an already-received expense as received). The `error.param` field identifies which input is invalid, if any.
- `429`: Rate limit exceeded. Retry after the duration in `Retry-After`.
- `500`: Unexpected server error.

---

[API](https://skmtc.dev/factuarea/apis/factuarea-public-api.md) · [All operations](https://skmtc.dev/factuarea/apis/factuarea-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/factuarea/apis/factuarea-public-api/revisions/718e77934422?raw)
