adopt_refused: The on-chain budget does not match the prepared adoption

POST /owner/v1/budgets/adopt reads every prepared fact back from the version 2 vault before it records anything: the budget's owner, asset, cap, escrow, mandate fingerprint, revocation and expiry, and the root stream's session key, service node, rate, cap and settled value. When one of them differs, the adoption is refused and nothing is adopted. The adoption id stays unused, so you can adopt again once the on-chain budget matches.

With Dynamo-Error-Detail: 1, errorDetail.check names the check that failed, and errorDetail.param names the request field it concerns (budgetRef, streamRef, delegation or payeeOffer). Without it, detail names the check in words.

checkWhat differs
budget_existsNo budget with this id exists on this deployment's vault
stream_existsNo stream with this id exists on this deployment's vault
budget_ownerThe budget was opened by another wallet than the prepared owner
budget_assetThe budget holds another asset than this deployment's
asset_listedThe budget's asset is not listed in the vault's asset registry
budget_capThe budget's cap differs from the prepared cap
budget_escrowThe escrow does not cover the cap
budget_mandateThe mandate fingerprint differs from the prepared mandate
budget_revokedThe budget is revoked
budget_expiredThe budget has passed its on-chain expiry
root_streamThe stream is not the budget's root stream
stream_session_keyThe root stream's session key is not the one the core issued
stream_service_nodeThe root stream pays another service node
stream_revokedThe root stream is revoked
stream_rateThe root stream's rate differs
stream_capThe root stream's cap differs
stream_settledThe root stream has already settled value
hop_intentAt 1.8.0: the owner's signed root hop intent is missing (required own hops), is not the prepared one, is not bound to this chain and vault, or does not recover (param is delegation)
hop_signerAt 1.8.0: the root hop intent is signed by a wallet other than the one that opened the budget on chain
payee_offerAt 1.8.0: the payee's signed offer is missing (required own hops) or does not verify (param is payeeOffer)

What to do

On the wire

HTTP 409, error type state_error, for clients pinned at Dynamo-Version 1.8.0 or later. Clients pinned earlier keep the earlier answer: HTTP 500 internal for the on-chain checks, and HTTP 404 not_found when the budget or stream does not exist (budget_exists, stream_exists). Nothing is adopted either way.

On a single-tenant core, a request that sends no Dynamo-Version gets the earlier answer. On the multi-tenant hosted tier, the front door serves such a request at the account's default version, which is 1.8.0 for new accounts, so it gets adopt_refused.

Without Dynamo-Error-Detail: 1 the body is {"error": "state", "reason": "adopt_refused", "detail": "…"}. With it:

{
  "error": "state",
  "reason": "adopt_refused",
  "detail": "…",
  "errorDetail": {
    "type": "state_error",
    "code": "adopt_refused",
    "message": "…",
    "param": "budgetRef",
    "doc_url": "…/errors/adopt_refused.md",
    "fix": "the on-chain budget or root stream does not match the prepared adoption (errorDetail.check names the fact); open the budget from the prepared owner wallet on this deployment's vault with exactly the prepared values, then adopt again (nothing was adopted)",
    "check": "budget_owner"
  }
}

See all error codes.