---
title: "Register a payment"
method: POST
path: "/companies/{company}/invoices/{invoice}/payments"
tags: ["Invoices"]
---

# Register a payment

`POST /companies/{company}/invoices/{invoice}/payments`

## Request

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

Register a partial or full payment against an invoice.
- The invoice becomes `partially_paid` until the total is reached, then `paid`.
- 422 for a status that rejects payments or `paid_on` later than today; an earlier date records an advance payment.

## Path parameters

- `company` string, uuid, required
- `invoice` string, uuid, required

## Headers

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

## Request body

- RegisterInvoicePaymentRequest: Register a partial (or full) payment against an invoice. Required: `amount` (> 0), `paid_on` (date) and `payment_method` (a value from the closed catalog). Optional: `reference`, `notes`. `paid_on` cannot be later than today (422); an earlier date than the issue date is accepted as an advance payment.
  - `amount` number, required
  - `paid_on` string, date, required
  - `payment_method` 'bank_transfer' | 'direct_debit' | 'sepa_direct_debit' | 'cash' | 'credit_card' | 'check' | 'paypal' | 'bizum' | 'other', required
  - `reference` string, nullable
  - `notes` string, nullable

## Response `201`

- object
  - `data` InvoicePaymentDetail, required: A single payment recorded against an invoice (partial payment ledger entry). Listed in `payments.detail[]` (materialized only on the show endpoint) and in the standalone sub-resource `GET /v1/companies/{company}/invoices/{invoice}/payments`.
    - `id` string, required: Opaque UUID v7 of the payment.
    - `object` 'payment', required: String identifying the object type. Always `payment`.
    - `invoice_id` string, required: UUID v7 of the invoice this payment belongs to.
    - `amount` string, required: Payment amount.
    - `payment_date` string, date, required: Payment date (YYYY-MM-DD).
    - `payment_method` string, required: Payment method (backing value of the Shared enum `PaymentMethod`, e.g. `bank_transfer`).
    - `payment_method_text` string, required: Human-readable label of the payment method (Spanish).
    - `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` and every treasury aggregate — 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` 'direct_debit_return' | 'card_dispute' | 'misapplied_payment' | 'bounced_effect' | 'recording_error' | 'issued_in_error' | 'null', nullable, required: Reason the payment was reverted, from the closed catalog. `issued_in_error` appears only on payments reverted by annulling an invoice issued by mistake with `revert_collections`; it cannot be requested for a single payment. `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 (up to 500 characters), or `null`.
    - `created_at` string, date-time, nullable, required: When the payment was recorded (ISO 8601), or `null`.
    - `updated_at` string, date-time, nullable, required: When the payment was last updated (ISO 8601), or `null`.

## 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.
- `409`: The request conflicts with data that already exists or with a request running at the same time. `resource_conflict`: another request was reserving identifiers for the same kind of record at that moment and this one could not complete its reservation. Nothing was written; send the request again after a few seconds.
- `422`: Validation failed, or the invoice cannot undergo the requested state transition (e.g. marking an already-paid invoice as paid, or editing an issued invoice — use a corrective instead). The `error.param` field identifies which input is invalid, if any. Issuing or annulling an invoice can also be rejected with `verifactu_not_eligible`: either a field of the invoice does not fit its billing record, or — only when the company has VeriFactu enabled in NO VERI*FACTU mode — it has no usable signing certificate (`error.subcode: signing_certificate_unavailable`; `error.param` is `certificate`, `representation` or `system_certificate`, depending on what is missing); in both cases the invoice stays exactly as it was.
- `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)
