sendTransaction - Bitcoin

Broadcasts a signed, serialized transaction to the Bitcoin network through the backend node and returns its transaction id on acceptance. This is the WebSocket form of the REST api/v2/sendtx endpoint.

Parameters

ParameterTypeRequiredDescription
hexstringYesHex-encoded signed raw transaction

Message

bashwscat -c wss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>

# then send:
{
    "id": "getblock.io",
    "method": "sendTransaction",
    "params": {
        "hex": "02000000000101662a2fc609ddb4eb..."
    }
}

Response

json{
    "id": "getblock.io",
    "data": {
        "result": "7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25"
    }
}

Response Fields

FieldTypeDescription
resultstringTransaction id of the accepted transaction

Use Cases

  • Wallet Sends: Broadcast a transaction built and signed on the client
  • Payment Settlement: Push a payout to the network
  • Consolidation: Broadcast a transaction combining several small outputs
  • Retry Flows: Rebroadcast a transaction that has not been mined

Acceptance means the backend node admitted the transaction to its mempool, not that it has been mined. Track it to the required depth with subscribeAddresses or subscribeNewBlock before treating a payment as settled.

Error Handling

ErrorMessageDescription
errorTransaction decode failedThe hex is malformed or not a complete signed transaction
errorTransaction already in block chainThe transaction has already been mined
errormin relay fee not metThe fee is below the backend node's relay threshold
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect