runs.settle when the provider has completed the work and you know the actual usage. Start the
run before work begins so customer funds are reserved. Settlement accounts for that usage and
leaves the run open. After all known usage is settled, call runs.end to close the run and
release unused reservation funds.
Use runs.consume to authorize a known usage amount before a billable step. Do not consume and
settle the same usage twice.
reservation.settle() from the reservations helper calls
this operation and then ends the run for you. Do not call runs.end after it.Request
Response and recovery
Checkaccepted, reason, and the returned run summary. When present, fundingStatus,
fundedAmountMinor, and unfundedAmountMinor describe how much usage the reserved funds covered.
Check these fields before treating the usage as fully funded.
Persist the actual usage and settlement key before sending the request. If the API call fails,
retry the same settlement with the same key. Do not call runs.end in a finally block to release
funds when provider usage exists but settlement is unconfirmed.
Use End budgeted run to release unused funds after known usage has
been accounted for, or when no billable work occurred.