Skip to content
SETSimple Easy Transactions
SET DocsSET Crypto API Suite and SET API referenceCurrent as of 2026-11-21 · wallet release 7d8a79fb
Browse: SET API

SET API · SET Close

Approve and lock a period

POST/v1/close/periods/{period}/approve

Key scope: approve · Success: 200

Approves a prepared period and locks it: nothing in the month changes afterwards. The lock writes snapshotHash, which covers the month's matches and the prior period's hash. No body is read.

Path parameters

period stringrequired
The month as YYYY-MM (UTC), already prepared.

Headers

Idempotency-Key string
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/close call answers 403 close_off after the key is checked. GET /v1/capabilities shows it as features.close.
  • Needs a key with both the approve and the read scopes; a key missing either answers 403 scope_missing. Platform and business keys can both call it.
  • The second approver must be a different key from the one that prepared the period, and not a key rotated from or to it: otherwise 409 same_approver. Issue a second key with POST /v1/api_keys.
  • Every earlier period since the start period must be locked first: otherwise 409 prior_period_open.
  • A period not yet prepared answers 409 period_not_prepared; a locked period answers 409 period_locked, including for a repeat of the same request.
  • An exception that arrived since prepare answers 409 open_exceptions and puts the period back to open.
  • Both keys belong to the same business: this is two-key approval, not an independent attestation.
  • Writes a close.period.locked event carrying the hashes and counts.
  • 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_off
  • 404 not_found
  • 409 period_not_ended
  • 409 before_start_period
  • 409 period_locked
  • 409 period_not_prepared
  • 409 same_approver
  • 409 prior_period_open
  • 409 period_changed
  • 403 scope_missing

All codes: Errors.