---
title: "Register a payment on an invoice"
method: POST
path: "/v1/invoices/{id}/payments"
tags: ["Invoices"]
---

# Register a payment on an invoice

`POST /v1/invoices/{id}/payments`

## Request

- Base URL: `https://api.officina.it`
- URL: `https://api.officina.it/v1/invoices/{id}/payments`
- Auth: HTTP bearer

Mirrors the web invoice dialog: the payment attaches to the
invoice and the invoice paid-state is refreshed.
`payment_method` falls back to the customer's preferred method,
then the company default, when missing or invalid. The optional
`financial_account_id` (conto di saldo) must belong to the
company.

## Request body

- PaymentCreateRequest
  - `amount` number, double, required: Must be greater than zero.
  - `payment_method` string: MP01–MP23. Omitted/invalid values fall back to the customer's preferred method, then the company default.
  - `payment_date` string, date: YYYY-MM-DD between 1900-01-01 and 2100-12-31 (same window as `WritableTimestamp`); default today. Out of range → 422 `parameter_invalid`.
  - `financial_account_id` string: Conto di saldo (Banca, Cassa, …) — one of the company's accounts from GET /v1/financial-accounts. Optional; an account belonging to another company is rejected with 422.

## Response `201`

Payment registered.

- Payment: One registered payment on a worksheet's invoice. payment_method is an SDI ModalitaPagamento code (MP01–MP23).
  - `object` 'payment', required
  - `id` string, required
  - `amount` number, double, required
  - `payment_method` string, required
  - `payment_date` string, date-time, required
  - `created_at` string, date-time, required

## Other responses

- `400`: Request body is unparseable or X-API-Version is missing.
- `401`: Missing, malformed, expired, or wrong-audience bearer token.
- `402`: The company has no active subscription, or its plan does not include API access. API access is included in the Business and Illimitato plans.
- `403`: The authenticated user lacks the required permission.
- `404`: Resource does not exist OR belongs to a different company. The two cases are intentionally indistinguishable.
- `415`: Content-Type is not `application/json`, or Accept rejects JSON.
- `422`: A request field is missing or invalid (fast-fail).
- `500`: Unhandled server error. Detail is logged, not exposed.

---

[API](https://skmtc.dev/officina/apis/officina-it-api.md) · [All operations](https://skmtc.dev/officina/apis/officina-it-api/llms.txt) · [OpenAPI document](https://skmtc.dev/officina/apis/officina-it-api/revisions/7da3fccfe551?raw)
