Skip to content
Docs

Transaction records

Create a record

Create a transaction record for your project, usually with status prepared.

Endpoint

POST/v1/transactions

Creates a project-owned row. With project auth, projectId and organizationId are taken from credentials—do not send them. Default status is prepared.

Body

FieldRequiredDescription
kindYestransfer | swap | defi | approval | other
chainIdYesValid Gray3 chain ID
fromYesSender address
toNoRecipient when known
valueNoAmount in base units (string)
tokenAddressNoToken contract when not native
statusNoprepared | broadcast | confirmed | failed (default prepared)
txHashNoSet if already submitted
unsignedPayloadNoOptional prepare payload snapshot
providerRefsNoString map for your correlation ids
Request
curl -sS -X POST "https://ledger.gray3.io/v1/transactions" \
  -H "X-Gray-Project-Id: proj_your_project_id" \
  -H "Authorization: Bearer gray_sk_your_secret" \
  -H "Content-Type: application/json" \
  -d '{
  "kind": "transfer",
  "chainId": "ethereum-sepolia",
  "from": "0xYourAddress",
  "to": "0xRecipient",
  "value": "1000000000000000000",
  "status": "prepared"
}'

Response

HTTP 201 — new id is tx_….

HTTP 201 — 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": "prepared",
  "createdAt": "2026-03-01T10:00:00.000Z",
  "updatedAt": "2026-03-01T10:00:00.000Z"
}
}

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
  }
}

Next: link on Cloud broadcast or patch status yourself.