api/v2/sendtx - Litecoin

This endpoint broadcasts a signed, serialized transaction to the Litecoin network through the backend node and returns its transaction id on acceptance.

Parameters

ParameterTypeLocationRequiredDescription
hexstringbodyYesHex-encoded signed raw transaction, sent as the plain-text request body

Request

The trailing slash on /api/v2/sendtx/ is mandatory. Request bodies are limited to 8 MiB.

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/sendtx/' \
--header 'Content-Type: text/plain' \
--data-raw '0200000001...'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/sendtx/',
    { method: 'POST', headers: { 'Content-Type': 'text/plain' }, body: '0200000001...' }
);
console.log(await response.json());

example.py

pythonimport requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/sendtx/',
    headers={'Content-Type': 'text/plain'},
    data='0200000001...'
)

print(response.json())

Response

json{
    "result": "51a31c4236a99bfd17cda606f079c9c4814851119e7593ab7c739bd5972b1969"
}

Response Parameters

FieldTypeDescription
resultstringTransaction id of the accepted transaction

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

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

Error Handling

HTTP StatusMessageDescription
400Bad requestThe hex is malformed or not a complete signed transaction
400min relay fee not metThe fee is below the node's relay threshold
403ForbiddenMissing or invalid ACCESS-TOKEN
500Internal errorThe node rejected or failed to process the broadcast