Report the outcome of an effect you executed
ratchet_report_effectReports the result of an authorized effect using its lease token, marking it succeeded or failed so duplicate callers replay the outcome and retries stay safe.
Instructions
Call this IMMEDIATELY AFTER performing an action that ratchet_begin_effect authorised. Pass the lease_token you were given. Report "succeeded" with a result — future duplicate callers replay that result instead of repeating the action. Report "failed" ONLY when you are certain the action did NOT reach the outside world (for example, a validation error before the request was sent). That permits a clean retry. If you are UNSURE whether it went through — a timeout, a dropped connection, an ambiguous error — do NOT report anything. Say so to the user. Letting the lease lapse records an honest "indeterminate", which is far safer than a false "failed" that licenses a duplicate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | No | What the action produced (ids, confirmation numbers, links). Replayed verbatim to duplicate callers, so include what a retry would need. | |
| outcome | Yes | ||
| effect_id | Yes | ||
| lease_token | Yes | ||
| failure_reason | No | Required when outcome is "failed". | |
| actual_cost_micros | No | What it really cost, if different from the estimate. |