# Create Treasury Movement Creates a new treasury movement for a client. A Payment settles the client's open documents up to value and issues a receipt for each. A Reimbursement is spread over the client's settled documents (or only document_id when sent). Send an Idempotency-Key header to make retries safe: a repeated request with the same key and payload replays the first answer instead of creating a second movement. Endpoint: POST /api/v3/clients/{client_id}/treasury_movements Version: 3.1.0 Security: apiKeyAuth ## Query parameters: - `api_key` (string, required) Your API Key. Example: "YOUR_API_KEY" ## Path parameters: - `client_id` (string, required) Client id ## Header parameters: - `Idempotency-Key` (string) Optional client-generated unique key (e.g. a UUID). Without it, every request creates a new movement. Example: "6f1c2a4e-1b7d-4c55-9a0e-3f2b8d7c9e10" ## Request fields (application/json): - `treasury_movement` (object, required) - `treasury_movement.movement_type` (string, required) Any other value is rejected with HTTP 422. Enum: "Payment", "Reimbursement", "InitialBalance", "Regularization" - `treasury_movement.value` (number) For Payment, must not exceed the client's open balance (with VAT). For Reimbursement, must not exceed the settled balance that can be reimbursed (of document_id when sent, otherwise of all the client's documents). Example: 123.45 - `treasury_movement.date` (string, required) Required — omitting it fails with HTTP 500. A value that cannot be parsed as a date is replaced by today's date. Example: "2023-04-28" - `treasury_movement.payment_method` (string) Example: "MB" - `treasury_movement.document_id` (integer) Reimbursement only: restrict the reimbursement to this settled document. Example: 987654 - `treasury_movement.serie` (string) Payment only: passed to the receipts issued for the paid documents. Not stored on the movement. Example: "2023" - `treasury_movement.observation` (string,null) Payment only: used as the note of the receipts issued for the paid documents. Not stored on the movement. ## Response 201 fields (application/json): - `treasury_movement` (object) - `treasury_movement.id` (integer) Example: 123456 - `treasury_movement.value` (number) Example: 123.45 - `treasury_movement.movement_type` (string) Enum: "Payment", "Reimbursement", "InitialBalance", "Regularization" - `treasury_movement.payment_method` (string,null) Example: "MB" - `treasury_movement.date` (string) Example: "2023-04-28" ## Response 401 fields (application/json): - `errors` (array) Example: [{"error":"Authentication Error"}] - `errors.error` (string) ## Response 404 fields (application/json): - `errors` (array) Example: [{"error":"Resource not found"}] - `errors.error` (string) ## Response 409 fields (application/json): - `errors` (array) Example: [{"error":"An unexpected error occurred"}] - `errors.error` (string) ## Response 422 fields (application/json): - `errors` (array) Example: [{"error":"An unexpected error occurred"}] - `errors.error` (string) ## Response 500 fields (application/json): - `errors` (array) Example: [{"error":"An unexpected error occurred"}] - `errors.error` (string)