What to poll
Polling guidance
- Determinations: index determinations are periodic, not real-time. A daily
reconciliation sweep over
GET /api/determinations(newest first,page/limitpaginated,limitcapped at 100) is sufficient. Filter withpolicyId,statusorkind. - Payments (Tier 2): poll
payments/status/{reference}every ~10–15s until it leavesPENDING(or for a few minutes, then treat as abandoned). - Activation: after a
COMPLETEDpayment, pollpolicies/{id}/statusuntilACTIVE(on-chain settlement can lag slightly). On Tier 1 the policy isACTIVEas soon asPUT /api/policies/{id}/activatereturns. - Payouts (Tier 2): a daily or hourly sweep over
GET /api/payoutsfiltered bystatusandfarmerId, plus per-policystatuschecks, is enough. - Respect rate limits (100 req/min). Prefer list endpoints with filters over many per-item calls when reconciling in bulk.
- Add jitter to polling intervals so retries don’t synchronize.
The policy status endpoint
GET /api/policies/{policyId}/status returns the full policy plus daysRemaining, its
farmer, plot/herd, payouts[] and damageAssessments[] — the single best call for
a policy’s current state.
On a
DETERMINATION-tier policy payouts[] is always empty — MicroCrop settles
nothing there, by design. That is not a missing payout; the determination is the artifact.
Read it at GET /api/determinations. See Service tiers.Webhooks
Get signed events pushed to your endpoint instead of polling.