Network calls fail. To retry a POST without doing the work — or paying — twice, send an idempotency key: a unique value you generate per logical operation (a UUID works well).
curl -X POST https://developers.grem.capital/api/v1/valuation/express \
-H "Authorization: Bearer gsk_live_xxx" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 3f1c8a90-1e2b-4c77-9a10-2b6d0f9e4a11" \
-d '{"propertyCategory":"apartment","totalArea":50}'
How it works
- The first request with a given key runs normally and its result is cached.
- A repeat with the same key returns the original result — the tool is not run again and you are not charged again.
- If the first request is still in flight, the repeat returns
409(idempotency conflict) — wait and retry.
Keys are remembered for 24 hours.
Use a fresh key for each distinct operation. Reusing one key for genuinely different requests would return the first result for all of them.