Retry a settlement
/ settlements/ {id}/ retrySend a settlement's deposit out again now, to the destination its deposit address resolves to at the moment of the retry. It is the one move on this family a client can drive: every other state a settlement reaches is Stridge's.
It is legal out of
retryingand out offailed.Out of
retryingit runs ahead of the next automatic attempt, whichretry.next_automatic_attempt_atnames. Out offailedit runs past the automatic limit, after Stridge has stopped trying on its own. Either way it counts as an attempt, andretry.attemptssays how many there have been.It answers
202with the attempt it started, the way a webhook event's resend answers with the delivery it created:pending, orawaiting_creditwhen the workspace's gas credit cannot pay for the move, which runs once credit arrives and spends no retry meanwhile. Its outcome is read back fromGET /settlements/{id}/attempts.
Show 6 more detailsShow fewer details
Every retry that goes out sends the
uda.settlement.retryingwebhook, with the settlement as the retry found it:retrying, the failure being retried, and the attempts made before this one. A retry waiting for credit sendsuda.settlement.awaiting_creditinstead.One manual retry per settlement every five minutes.
A retry inside that window answers
429settlement_retry_too_soon, withRetry-Afterin seconds anderror.retry_after, the instant the next one is accepted. A settlement's own read says the same asretry.available_atbefore anyone asks. The window is the settlement's: retrying one does not hold any other back.A settlement in any other state answers
409settlement_not_retryable, and one whose deposit is being refunded answers409settlement_refund_in_flight. A settlement of another environment answers404resource_missingnamingid, identical to one that exists nowhere.Retrying the request.
Send an
Idempotency-Keyand a retry with the same key within 24 hours answers the first202again and spends nothing. A409or a429is a refusal made before the retry began, which is not remembered, so the same key runs afresh once its cause has passed. The same key with a different request answers400idempotency_key_reused, and a retry while the first is still running answers409idempotency_key_in_use.Who may.
In live it is an owner's alone: a developer or a viewer answers
403permission_denied. In a sandbox an owner and a developer may, and a viewer answers403permission_denied. A retry chooses neither the destination nor the amount, so it asks no step-up. A secret key of the environment may too when it holdsuda.settlement_retry; one without it answers403permission_denied.A resetting sandbox.
While a sandbox's reset runs it answers
409environment_resetting.
Parameters
Path
- idstring <uuid>required
The settlement being retried. A value that is not a UUID answers
422parameter_invalidnamingid.
Headers
- X-Stridge-Environmentstring <uuid>optional
Which environment the request acts inside, on an operation a session and an API key both call. Learn more
Show full descriptionShow less
It is required under a person's session, exactly as
EnvironmentHeaderdescribes: a session request that omits it answers400withenvironment required, and one naming an environment the caller holds no membership of answers404.An API key names its own environment, so a request made with one omits this header. A key request that sends it answers
400withenvironment header not accepted, whatever it names, rather than having the header ignored: a header that is silently ignored hides the integration bug that sent it. - Idempotency-Keystringoptional
A caller-chosen key making this request safe to retry. Sent, the server remembers what the first request with it produced; omitted, every request is a new one. Learn more
Show full descriptionShow less
The same key with the same parameters returns the first result, status and body both, and does nothing a second time. So a retry after a dropped connection is safe whether or not the first attempt landed. The parameters are compared as parsed, not as bytes: the query with its names sorted and the JSON body decoded, so member order, spacing and escaping never make two requests differ, while any changed value does.
What is remembered is the answer of an attempt that began execution, success or failure, a
500included. A refusal made before execution is not remembered, so a retry with the same key runs afresh once its cause is fixed: a validation error (400,422), a409conflict, a429, a403step_up_required, and any answer carryingRetry-After. An answer whose body is larger than 64 KiB is not remembered either, and an operation may say that its500is not; a retry of either runs the request again. What the first attempt did stands, so a create that took a unique value answers that value's conflict on the retry: a payout whose first attempt took itsreference_idanswers409payout_reference_taken.The same key with different parameters answers
400withidempotency key replayed with a different body: a key names one request, and reusing it for another is a client bug rather than a retry. A replay while the first request is still in flight answers409at once witha request with this idempotency key is still in flight, and the remedy is to retry once the first has answered.Keys are scoped to the environment the request acts inside, and to its reset: one environment's key never answers another environment's request, and a key used before a sandbox reset runs afresh after it.
An operation that acts on a workspace or on the account rather than inside an environment, such as creating a workspace or requesting go-live in the dashboard, scopes its keys to the caller and to its path, so the same key sent for another workspace is a separate request and never a replay.
Responses
The retry was accepted. The answer is the attempt it started; its outcome is read back from the settlement's attempts.
- objectstringrequired
The object's type, always
settlement_attempt. - settlement_idstring <uuid>required
The settlement this attempt was carrying.
- environment_idstring <uuid>required
The environment the settlement belongs to.
- livemodebooleanrequired
truewhenenvironment_idnames aliveenvironment andfalsein a sandbox. It is carried on the object itself, so a payload read on its own still says which side of the boundary it came from. - attempt_numberinteger <int32>required
Which attempt this was, counting from one, the original dispatch.
- automaticbooleanrequired
truefor an attempt Stridge made on its own,falsefor one a person made withPOST /settlements/{id}/retry.
Show 4 more fieldsShow fewer fields
- statusstringrequiredenum pending · success · failed · awaiting_credit
How the attempt went.
pendinghas not ended;successcarried the deposit to its destination, which a completion arriving after a failure also reports;faileddid not, which is what a retry exists to fix, and is also how an attempt a refund interrupted ends.Show full descriptionShow less
awaiting_creditis a retry waiting for the workspace's gas credit: it runs once credit arrives, and spends no retry meanwhile. - errorstring | nullrequired
Why a failed attempt failed, or
nullon every attempt that has not. Developer documentation, not user copy. - created_atstring <date-time>required
When the attempt started. RFC3339 UTC,
Zsuffixed. - updated_atstring <date-time>required
When the attempt's status last changed. It equals
created_aton an attempt that has not moved.
Errors
The error.code values this operation can return. Each one links to its entry in the error catalogue, which explains the cause and the fix.
- 400environment_requiredEnvironment required
- 400header_invalidInvalid header
- 400idempotency_key_reusedIdempotency key reused
- 400422parameter_invalidInvalid parameter
- 400parameter_unknownUnknown parameter
- 401api_key_not_acceptedAPI key not accepted
- 401authentication_requiredAuthentication required
- 401publishable_key_not_acceptedPublishable key not accepted
- 401token_invalidInvalid or expired token
- 403membership_suspendedMembership suspended
- 403permission_deniedPermission denied
- 404environment_not_foundEnvironment not found
- 404resource_missingNo such object
- 409environment_provisioningEnvironment provisioning
- 409environment_resettingEnvironment resetting
- 409idempotency_key_in_useIdempotency key in use
- 409settlement_not_retryableSettlement not retryable
- 409settlement_refund_in_flightSettlement refund in flight
- 429rate_limitedToo many requests
- 429settlement_retry_too_soonSettlement retried too recently