Quote a routed payout
/ payouts/ quotesPrice a payout to another network or asset, as a create with the same members would price it, and hold its route until expires_at. Nothing moves and no payout exists yet. POST /payouts naming the answer's id as quote_id before expires_at pays through this route, for this quote's destination_amount.
Only a routed payout has a quote.
destination_network_symbolordestination_assetmust name another network or asset than the vault pays from; otherwise it answers422parameter_invalidnamingdestination_network_symbol.The refusals are the create's.
vault_id,to_address,network_symbolandassetare required, and a body without one, or with one that is only whitespace, answers422parameter_missingnaming it; a member of the wrong type or avault_idthat is not a UUID answers422parameter_invalidnaming the member, and a member the body does not declare answers400parameter_unknownnaming it. Stating neitheramountnorusd_amountanswers422parameter_missingnamingamount; stating both or ausd_amountthat is not a positive decimal answers422parameter_invalidnaming it. Ato_addressthat does not check out for the chain the recipient is paid on, a network or asset the environment does not support and amax_slippage_bpsout of its bounds each answer422parameter_invalidnaming the member. A vault the environment does not hold answers404resource_missingnamingvault_id, resolved before any check the schema does not state.
Show 6 more detailsShow fewer details
What the route needs.
A pair no provider quotes, or a network not served here, answers
422route_unavailable, routed payouts not enabled for the workspace422routed_payouts_disabled, a vault network or asset routes cannot leave422route_source_unsupported, a vault gas no gas station funds422gas_station_missing, and a miner fee that cannot be priced422miner_fee_unpriced. A vault without the balance answers422balance_insufficientand one without the gas422gas_insufficient; a vault with no wallet on the chain answers422vault_wallet_missing, and ausd_amountStridge cannot price422payout_price_unavailable.It has its own budget.
Each quote asks a provider and holds a route, so a workspace may ask for 30 a minute,
/v1quotes included; past that it answers429rate_limited.Retrying a quote.
Send an
Idempotency-Keyand a retry with the same key and the same body within 24 hours answers the first201again and holds no second route. The same key with a different body 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, checked before the step-up. In a sandbox an owner and a developer may, and a viewer answers403permission_denied. A secret key of the environment may too when it holdspayout.quoteorpayout.create, so the key that creates a payout quotes it; one holding neither answers403permission_denied.Step-up.
In live, a person needs a fresh step-up (
totporbackup_code, neveremail) no older than 15 minutes, which the act renews; without one it answers403step_up_required, and an owner with no authenticator is answeredenrolment_required: true. A sandbox never asks, and neither does a key.A resetting sandbox.
While a sandbox's reset runs it answers
409environment_resetting.
Header parameters
- 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.
Request body
- vault_idstring <uuid>required
The vault to pay from. A vault outside the environment is refused.
- to_addressstringrequired
The address to pay, valid for the chain the recipient is paid on.
- network_symbolstringrequired
The chain the vault pays from.
- assetstringrequired
The asset the vault pays in, matched in any case.
What the recipient receives, as a positive
TokenAmountstated indestination_asset(the body'sassetwhen that is left out) at its decimals ondestination_network_symbol(the body'snetwork_symbolwhen that is left out).- 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_amountstring
What value to pay in USD, as a positive decimal string, letting Stridge convert.
- destination_network_symbolstring
The chain the recipient is paid on, when it is not
network_symbol. - destination_assetstring
The asset the recipient is paid in, when it is not
asset. - max_slippage_bpsinteger
The slippage the route may take, in basis points; omitted, Stridge's default.
Responses
The payout was priced and its route is held until expires_at.
- idstringrequired
What a create names as
quote_id. - objectstringrequired
The object's type, always
payout_quote. - environment_idstring <uuid>required
The environment whose vault would pay.
- livemodebooleanrequired
truewhenenvironment_idnames aliveenvironment andfalsein a sandbox. - vault_idstring <uuid>required
The vault that would pay.
- to_addressstringrequired
The address the recipient would be paid at, as the chain spells it.
Show 10 more fieldsShow fewer fields
- network_symbolstringrequired
The chain the vault pays from.
- assetstringrequired
The asset the vault pays in.
- destination_network_symbolstringrequired
The chain the recipient is paid on.
- destination_assetstringrequired
The asset the recipient is paid in.
What the vault would spend, the provider's fee included.
- 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
What the recipient would receive.
- 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
- providerstringrequired
The provider carrying the route.
- provider_feestringrequired
The provider's fee, in the source asset.
- gas_fundingstringrequiredenum vault · central · tenant
Who would pay the network fee.
- expires_atstring <date-time>required
When the held route lapses. A create naming the quote from then on answers
422quote_expired.
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.
- 400body_invalidInvalid request body
- 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
- 403step_up_requiredStep-up required
- 404environment_not_foundEnvironment not found
- 404resource_missingNo such object
- 409environment_provisioningEnvironment provisioning
- 409environment_resettingEnvironment resetting
- 409idempotency_key_in_useIdempotency key in use
- 409422routed_payouts_disabledRouted payouts not enabled
- 413body_too_largeRequest body too large
- 415media_type_unsupportedUnsupported media type
- 422balance_insufficientInsufficient balance
- 422gas_insufficientInsufficient gas
- 422gas_station_missingNo gas station funds the vault
- 422miner_fee_unpricedMiner fee cannot be priced
- 422parameter_missingMissing parameter
- 422payout_price_unavailablePayout cannot be priced
- 422route_source_unsupportedRoutes cannot leave this source
- 422route_unavailableNo route for the payout
- 422vault_wallet_missingVault has no wallet on the chain
- 429rate_limitedToo many requests