request-repair

Repair a request by repointing it at a transaction. (admin access required)

Repoints a purchase or payment at a specific transaction and syncs its on-chain state. By default the transaction is fetched, checked for confirmation depth and a unique unspent output at this payment source's contract address, then its versioned datum and immutable fields are matched against the request. Pass requestVersion from preview so a concurrent tx-sync update returns 409 instead of being overwritten. Force skips chain checks but still requires requestVersion or expectedRequestUpdatedAt from the operator dialog to prevent a stale forced write.

post/request-repair

Request

  • Base URL: ./../api/v1/ (relative, and the document was published on a file host, not at the API’s origin)
  • URL: ./../api/v1/request-repair
  • Auth: API key in header token

Request body

kind'Purchase' | 'Payment' required

Whether the blockchainIdentifier refers to a purchase or a payment

network'Preprod' | 'Mainnet' required

The network the request belongs to

blockchainIdentifierstring required

The request to repair

txHashstring required

The transaction that should become the request's CurrentTransaction

forceboolean

Skip chain validation and write the supplied onChainState verbatim. Only for cases validation cannot cover — a mistake here points the request at the wrong escrow and the automatic refund/withdraw logic will act on it.

onChainState'FundsLocked' | 'FundsOrDatumInvalid' | 'ResultSubmitted' | 'RefundRequested' | 'Disputed' | 'WithdrawAuthorized' | 'RefundAuthorized' | 'Withdrawn' | 'RefundWithdrawn' | 'DisputedWithdrawn'

Required when force is true. Ignored otherwise — the state is read from the transaction datum.

requestVersionstring

Opaque request version returned by preview. Required unless force is true; rejects an apply when tx-sync changed the request after preview.

expectedRequestUpdatedAtstring date-time

Required for force when requestVersion is unavailable. Pass the request updatedAt shown in the operator dialog to reject stale forced writes.

Example request

{
  "kind": "Purchase",
  "network": "Preprod",
  "blockchainIdentifier": "blockchain_identifier",
  "txHash": "0000000000000000000000000000000000000000000000000000000000000000",
  "requestVersion": "yF6hS5jPq0yNlTTDyc7mwHt18ZMYbn1RGv5C49VqX74"
}

Response

Request repaired

status'success' required

Example response

{
  "status": "success",
  "data": {
    "requestId": "request_id",
    "txHash": "0000000000000000000000000000000000000000000000000000000000000000",
    "transactionId": "transaction_id",
    "previousOnChainState": null,
    "newOnChainState": "FundsLocked",
    "forced": false
  }
}

Changes

No recorded changes to this operation across all 50 revisions of this API.