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

Prepare a week: open to prepared

POST/v1/close/weeks/{week}/prepare

Key scope: write · Success: 200

Moves a week from open to prepared and records the preparing key. Only after the week has ended (UTC), on or after Close's first week, while it is not signed, and with no exception in it left without a note.

Path parameters

week stringrequired
YYYY-Www, a real ISO week such as 2026-W33. Anything else answers 404 not_found.

Headers

Idempotency-Key string
Any unique string, so a retry runs once. See Idempotency.

Notes

  • SET Close is switched on per deployment; while it is off every /v1/close/* call answers 403 close_off. Check GET /v1/capabilities (features.close).
  • Needs a key with the write scope.
  • A week is prepared after its Sunday ends (UTC): 409 week_not_ended before then.
  • Close's first week is the one holding the first day of startPeriod (PUT /v1/close/settings); an earlier week answers 409 before_start_week.
  • 409 open_exceptions, with count, when an exception in the week has no note. Resolve each, or leave it open with a note.
  • Preparing does not need the earlier weeks signed; approving does.
  • preparedBy is the key that prepared the week. That key, or one rotated from or to it, cannot approve it.
  • Emits the event close.week.prepared.
  • 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 week_not_ended
  • 409 before_start_week
  • 409 week_signed

All codes: Errors.