Guide

Idempotency

Networks fail half-way: the request reached School360 but the answer never came back. With an Idempotency-Key you can simply send it again.

How it works

Networks fail. Send an Idempotency-Key header (any unique value of 8–100 characters, e.g. a UUID) with a POST and you can safely send it again: the first answer is returned (with Idempotent-Replayed: true) instead of doing it twice. It is required on POST /payments. The same key with a different body is refused with 422. Keys are kept for 24 hours.

Example: a bank payment

Build the key from something that identifies the operation itself (the bank's transaction id), not from a random value made on each attempt, so that every retry of the same payment carries the same key.

curl -X POST https://api.school360.cloud/v1/payments \
  -H "Authorization: Bearer $SCHOOL360_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: hbl-FT26100812345" \
  -d '{ "voucherNumber": "FV-2026-10-00123", "amount": 8500, "method": "ibft",
        "reference": "FT26100812345", "paidAt": "2026-10-08T10:15:00+05:00" }'
# → 201 { "id": 981, "number": "RCT-2026-00981", "amount": 8500, "lines": [...] }
# The same request again → the same 201 answer, with Idempotent-Replayed: true

Rules

  • 8–100 characters; any unique value (a UUID, or <bank>-<transaction id>).
  • Required on POST /payments; accepted on every other POST.
  • Kept for 24 hours per key: a repeat within that time gets the first answer, with Idempotent-Replayed: true.
  • The same key with a different body answers 422 idempotency_mismatch.
  • While the first request is still running, a repeat answers 409 idempotency_in_progress: wait a moment and send it again.
  • On top of this, POST /payments refuses a reference already recorded for the same method (409 duplicate_reference), even with a new key.