End a declaration
Ends declaration {settled_participant_id} on validTo, the last day it is in force, by recording a new version of it. The previous version is kept. validTo is required, cannot be null, and is the only field that changes. A validTo one day before validFrom voids the declaration: it is never in force, the close and the overlap check skip it, and the ISPB can be declared again from any day. A later validTo puts it back in force. The same validTo as the current version creates no version and answers 200 with it.
A validTo earlier than the day before validFrom, or one that makes the validity overlap another declaration of the same ISPB, answers 422 (PIX-0719) at body.validTo. No declaration with this id answers 404 (PIX-0722), and an id that is not a UUID answers 400 (PIX-0015).
version is the current version of the declaration, as the last response for it gave it. Another version answers 409 (PIX-0728), and nothing is written. A declaration, an end or a void that covers a closed month leaves that month’s report unchanged. It enters only the close that follows a reopen.
Headers
REQUIRED. Client-supplied replay key, at most 64 bytes. A request without it is refused with PIX-0030 @ 400 before the handler runs. An identical resend within 1 hour returns the original response, status included, with X-Idempotency-Replayed: true. Reusing the key with a divergent method, URL or body is PIX-0031 @ 412.
1 - 64Path Parameters
Body
Response
OK

