# Import historical payments `POST /api/v1/payments/historical-import/commit` Imports eligible CSV rows as paid incoming payments documented externally. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Payments → Write**. ## Body parameters - `csv` (string, required) — UTF-8 CSV text up to 2 MiB and 2,000 rows. Required headers are data, importo, and codice_fiscale_atleta. Optional headers are codice_fiscale_genitore and causale. - `options` (map, required) — Supply bank_account_id, payment_method_id, and an incoming accounting_category_id. - `request_id` (string, required) — Batch identifier, 16–64 letters, digits, or hyphens. Reuse it with the same input when retrying. ## Request Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request POST \ --url "https://api.asdincloud.com/api/v1/payments/historical-import/commit" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"csv":"data;importo;codice_fiscale_atleta;causale\n2025-12-15;25.00;DEMO000000000001;Club fee\n","options":{"bank_account_id":8,"payment_method_id":2,"accounting_category_id":8},"request_id":"example-historical-import-01"}' ``` ## Response **200 OK** Returns counts and per-row results. Inspect failed and already_imported before retrying. Example with fictional data and selected fields. ```json { "status": "success", "data": { "total": 1, "ready": 0, "imported": 1, "failed": 0, "already_imported": 0, "rows": [ { "row": 2, "taxcode": "DEMO000000000001", "date": "2025-12-15", "amount": "25.00", "code": null, "warnings": [], "athlete": "Example Alex", "payer": "Example Sam", "status": "imported", "payment_id": 35 } ] } } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `400` — The CSV, import options, or request ID are invalid.