Skip to content
Docs

Transaction records

Update status and hash

PATCH status, hash, receipt, and providerRefs as the send progresses.

Endpoint

PATCH/v1/transactions/:txId

Partial update. Only status, txHash, receipt, and providerRefs are accepted. Patching to confirmed sets confirmedAt. providerRefs merges into any existing map.

Body

FieldRequiredDescription
statusNoprepared | broadcast | confirmed | failed
txHashNoNon-empty on-chain hash
receiptNoArbitrary receipt JSON (e.g. from Cloud)
providerRefsNoMerged string map
Request
curl -sS -X PATCH "https://ledger.gray3.io/v1/transactions/tx_your_transaction_id" \
  -H "X-Gray-Project-Id: proj_your_project_id" \
  -H "Authorization: Bearer gray_sk_your_secret" \
  -H "Content-Type: application/json" \
  -d '{
  "status": "broadcast",
  "txHash": "0x…"
}'

Response

HTTP 200 — success envelope wraps the payload in data.

json
{
  "data": {
    "_id": "tx_…",
    "projectId": "proj_…",
    "organizationId": "org_…",
    "kind": "transfer",
    "chainId": "ethereum-sepolia",
    "from": "0xYourAddress",
    "to": "0xRecipient",
    "value": "1000000000000000000",
    "status": "broadcast",
    "txHash": "0x…",
    "createdAt": "2026-03-01T10:00:00.000Z",
    "updatedAt": "2026-03-01T10:01:00.000Z"
  }
}

Confirm example

Request
curl -sS -X PATCH "https://ledger.gray3.io/v1/transactions/tx_your_transaction_id" \
  -H "X-Gray-Project-Id: proj_your_project_id" \
  -H "Authorization: Bearer gray_sk_your_secret" \
  -H "Content-Type: application/json" \
  -d '{
  "status": "confirmed",
  "receipt": {
    "status": "success",
    "blockNumber": "12345678"
  }
}'

Errors

Errors use HTTP { "error": { "code", "message", "retryable" } }. Branch on code, not the message text.

CodeHTTPWhen
unauthorized401Missing or invalid project credentials
invalid_argument400Bad kind, chainId, status, empty from/hash, or malformed body
not_found404Unknown transaction ID, or a record owned by another project
rate_limit_exceeded429Write or project throttle (retryable)
json
{
  "error": {
    "code": "unauthorized",
    "message": "Human-readable detail (may be sanitized).",
    "retryable": false
  }
}

Status meanings: Status model.