Skip to main content

Response envelopes

Success:
Paginated list:
Error:
details is present for validation errors (an array of { field, message }) and for rate-limit errors ({ limit, retryAfter }).

Error codes

Handling tips

  • Branch on error.code, not the message (messages may change).
  • 400 INVALID_INPUT with details → surface the per-field messages to your operators.
  • 403 FORBIDDEN on purchase almost always means your organization isn’t VERIFIED yet — check GET /api/organizations/me.
  • 403 TIER_NOT_ENTITLED is not a transient failure and must not be retried. It means the policy was sold under DETERMINATION: MicroCrop will never settle it, and the obligation is yours. Route to the Tier 1 flow.
  • 404 NOT_FOUND on a determination id is deliberately indistinguishable from “belongs to another organization” — the endpoint never confirms that someone else’s id is real.
  • 409 CONFLICT on farmer registration → the farmer already exists; look them up instead of re-creating.
  • 429 → back off and retry after the retryAfter seconds in details.
Retrying a POST /api/determinations/{id}/settlement-report after a timeout is safe: it is idempotent on (determinationId, partnerReference) and a replay returns 200 with replayed: true and the stored report, not a 409.

Removed endpoints

The org-facing wallet and reserve endpoints were removed with the non-custodial model and now return 404 NOT_FOUND: GET /me/wallet, POST /me/wallet/fund, GET /me/reserve, POST /me/reserve/deposit, POST /me/reserve/withdraw. See Requirements.