submitTransaction - Cardano

This method submits a signed, serialized transaction to the network. On success it returns the transaction id; on failure it returns the list of validation errors reported by the node.

Parameters

ParameterTypeRequiredDescription
transactionobjectYesObject with a cbor field holding the base16 transaction

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "submitTransaction",
    "params": {
        "transaction": {
            "cbor": "84a300818258200e...transaction-cbor-hex...ff"
        }
    },
    "id": "getblock.io"
}'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({"jsonrpc": "2.0", "method": "submitTransaction", "params": {"transaction": {"cbor": "84a300818258200e...transaction-cbor-hex...ff"}}, "id": "getblock.io"})
    }
);
console.log(await response.json());

example.py

pythonimport requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers={'Content-Type': 'application/json'},
    json={"jsonrpc": "2.0", "method": "submitTransaction", "params": {"transaction": {"cbor": "84a300818258200e...transaction-cbor-hex...ff"}}, "id": "getblock.io"}
)

print(response.json())

Response

json{
    "jsonrpc": "2.0",
    "method": "submitTransaction",
    "result": {
        "transaction": {
            "id": "3e6f2d8c9a1b4e7f0c2d5a8b1e4f7a0c3d6b9e2f5a8c1d4e7b0f3a6c9d2e5b8f"
        }
    },
    "id": "getblock.io"
}

Response Parameters

FieldTypeDescription
transactionobjectObject containing the accepted transaction id

Use Cases

  • Payment Broadcast: Submit a signed ada or asset transfer
  • dApp Backends: Broadcast transactions built and signed client-side
  • Certificate Submission: Submit staking and governance certificates
  • Retry Flows: Resubmit a dropped transaction from stored CBOR

Error Handling

Error CodeMessageDescription
-32602Invalid paramsThe transaction CBOR is missing or malformed
3005Era mismatchThe transaction was built for a different ledger era
3100Validation failureThe node rejected the transaction; see the failure list in the error data
-32603Internal errorThe node failed to process the submission