Reject a payout
/ payouts/ {payout_id}/ rejectRefuse a payment that has not gone out yet. It is the only transition on this contract a client can drive: every other movement a payout makes is Stridge's, and there is no operation here for any of them.
It is legal out of
requestedand out ofqueueduntil Stridge starts sending the payment, and lands the payout onrejected.Those are the two states in which the money has not left; the payout keeps everything else it was, and its
confirmed_atis cleared because a rejected payment was never confirmed.The rejection is decided when it is asked.
A
200means the payout is stopped: Stridge had not started sending it, and now never will. The answer is thePayoutas it stands, stillrequestedorqueued, since the payout readsrejectedonce the stop has reached it. Read it again, or wait for its webhook, to see the final state.
Show 7 more detailsShow fewer details
A payout Stridge has started sending answers
409payout_started.Its transaction may be on its way, so it is not stopped: it runs to its end and reads
confirmedorfailed. A payout's payment can start the moment it is created, so a rejection asked right after the create can meet this.A payout already in a terminal state answers
409payout_already_final.That refusal is checked before the transition itself, so the answer names the reason rather than reporting a generic illegal move: a client that raced another tab is told what happened. A payout of another environment answers
404resource_missingnamingpayout_id, identical to one that exists nowhere.A routed payout can be past rejecting while still
queued.Once a payout to another network or asset may have sent its source transaction, its money may have left, so a reject answers
409payout_source_sentand the route runs to its end. With routed payouts turned off on Stridge, a reject of a routed payout answers409routed_payouts_disabled.rejectedis a state of its own rather than a flavour ofexpired.A cancelled payment left to lapse would lose the difference between a payment nobody acted on and one somebody refused; this contract keeps them apart because a client renders them apart.
Retrying the rejection.
Send an
Idempotency-Keyand a retry with the same key within 24 hours answers the first200again. 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 rejection moves no money, so it asks no step-up.A resetting sandbox.
While a sandbox's reset runs it answers
409environment_resetting.
Parameters
Path
- payout_idstringrequired
The payout being rejected. A value the environment holds no payout under, a value that is not a UUID included, answers
404resource_missingnamingpayout_id.
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 payout is stopped before Stridge started sending it. The answer is the payout as it stands.
- idstring <uuid>required
The payout's own identifier.
- objectstringrequired
The object's type, always
payout. - environment_idstring <uuid>required
The environment whose money this payout moves. It is carried on the object rather than implied by the request, so a payout detached from the request it arrived on still says which world it left.
- livemodebooleanrequired
truewhenenvironment_idnames aliveenvironment andfalsein a sandbox. It is carried on the object itself, so a payload read on its own, a logged response or a webhook body, still says which side of the boundary it came from. - vault_idstring <uuid>required
The vault the money leaves. It is the term a caller narrows this list by, and the vault must belong to the environment the request is scoped to.
- reference_idstringrequired
The caller's own identifier for this payment. While this payout holds it, a second create naming it answers
409payout_reference_takennaming this payout. Only a payout that certainly moved no money frees it, and a later payout in the vault may then carry the same reference.
Show 14 more fieldsShow fewer fields
- to_addressstringrequired
Where the money goes, in the chain's own encoding.
- network_symbolstringrequired
The chain the payment is made on, as the chain's own slug.
- assetstringrequired
The ticker of the asset the vault pays in.
How much of the asset is being paid, as a
TokenAmountin the asset's own decimals onnetwork_symbol. A payout sized byamountcarries the figure the caller stated; one sized byusd_amountcarries what Stridge converted it to, rounded down to the asset's smallest unit.Show full descriptionShow less
A payout stored with a figure finer than that unit is stated rounded down to it, the quantity the chain was sent; one whose asset the network no longer lists is stated in its own asset, at the decimals of its stored figure. A routed payout's
amountis what the recipient receives, inroute.destination_assetat its decimals onroute.destination_network_symbol, the same figure asroute.destination_amount;route.source_amountis what the vault spends.- amountstringrequired
The amount in the asset's base units: digits only, no sign, no exponent and no leading zero (
"0"for zero). At most a uint256, the widest on-chain amount. - amount_decimalstringrequired
The exact human amount,
amount / 10^decimals: no sign, no exponent, no leading zero before the point other than a lone0, and no trailing zero after it ("12.5","0.000001","3"). - decimalsinteger <int32>required
The asset's decimals on its network, which
amount_decimalis scaled by. - assetstringrequired
The symbol of the asset the amount is in (
USDC), so a fee or a total never mixes units.
- amountstringrequired
- usd_amountstringrequired
What the payment is worth in USD, as a decimal string, or the empty string when no price could be read when the payout was created. A caller may state this INSTEAD of
amountand let Stridge convert, in which caseratesays what it converted at. - ratestring | nullrequired
The conversion Stridge used between the asset and USD, or
nullwhen it recorded none. It is an opaque passthrough: a client renders it and does not compute with it. - statusstringrequiredenum requested · queued · confirmed · rejected · expired · failed
Where the payout got to.
requestedandqueuedare the two states a client may still reject out of;confirmed,rejected,expiredandfailedare terminal, and rejecting one answers409.Show full descriptionShow less
rejectedis a first-class terminal state here. A cancelled payment left to lapse toexpiredwould lose the distinction between a payment nobody acted on and one somebody refused. This contract keeps them apart, and Stridge answers what the contract states. - tx_idstring | nullrequired
The on-chain transaction that carried the payment, or
nullbefore one exists. - remarkstring | nullrequired
A free-form note the caller attached, or
null. - errorstring | nullrequired
Why a
failedpayout failed, ornull. - expired_atstring | null <date-time>required
When the payment stops being attemptable: the window the caller stated at create, within 12 hours of now, or an hour after creation when it stated none. Every payout has one.
- created_atstring <date-time>required
When the payment was requested. RFC3339 UTC,
Zsuffixed. The list is ordered on it, newest first. - confirmed_atstring | null <date-time>required
When the payment was confirmed on chain, or
nulluntil it is. How a payout to another network or asset reaches its recipient, or
nullfor a payout on the vault's own network and asset.- destination_network_symbolstringrequired
The chain the recipient is paid on.
- destination_assetstringrequired
The asset the recipient is paid in.
What the vault spends, the provider's fee included.
What the recipient receives.
- providerstringrequired
The provider carrying the route.
- provider_feestringrequired
The provider's fee, in the source asset.
- gas_fundingstring | nullrequiredenum vault · central · tenant · null
Who pays the network fee, or
nulluntil that is decided. - network_fee_paidstring | nullrequired
The network fee every transaction the vault sent for the route paid, approvals and failed calls included, or
nulluntil they land. - source_tx_idstring | nullrequired
The transaction that sent the money on the source chain, or
nullbefore it exists. - destination_tx_idstring | nullrequired
The transaction that paid the recipient, or
nullbefore it exists. The legs the vault sent on the source chain, in the order it sent them.
- destination_network_symbolstringrequired
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
- 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
- 409payout_already_finalPayout already final
- 409payout_source_sentSource transaction sent
- 409payout_startedPayout started
- 409422routed_payouts_disabledRouted payouts not enabled
- 429rate_limitedToo many requests