SET API · SET Close
Prepare a period: open to prepared
POST/v1/close/periods/{period}/prepare
Moves a period from open to prepared, recording the calling key as the preparer. Only after the month has ended (UTC), and only with no exception left without a note. No body is read.
Path parameters
periodstringrequired- The month as
YYYY-MM(UTC). It must have ended and must not be before the start period.
Headers
Idempotency-Keystring- Any unique string. What a repeat of this call answers is in the notes. See Idempotency.
Notes
- SET Close is switched on per deployment; when it is off, every
/v1/closecall answers 403close_offafter the key is checked.GET /v1/capabilitiesshows it asfeatures.close. - Needs a key with the
writescope. Platform and business keys can both call it. - The current month answers 409
period_not_ended; a month before the start period answers 409before_start_period. - Exceptions with no note answer 409
open_exceptionswith the count. Resolve them withPOST /v1/close/exceptions/{exception}/resolve. - A wallet balance mismatch in the month with no note answers 409
open_position_mismatches. - Preparing again before approval replaces the preparer. Once the period is locked the answer is 409
period_locked, including for a repeat of the same request. - A new exception arriving in a prepared month, from SET's scheduled pass or an upload, puts the period back to
open. - Writes a
close.period.preparedevent. - The example was made with a sandbox key (
sandbox: true). - This example is a recorded run of SET's own code (wallet release
e9b03447) with a sandbox key; ids and times are that run's.
Errors
403 close_off404 not_found409 period_not_ended409 before_start_period409 period_locked409 open_exceptions