Transactions

Broadcast a transaction (raw or PSBT)

Broadcasts a raw transaction or a Partially Signed Bitcoin Transaction (PSBT) to the network for the specified cryptocurrency.

post/v1/cryptos/{cryptoCode}/transactions

Path parameters

cryptoCodestring required

The cryptocurrency code to track (e.g., 'BTC' for Bitcoin, 'LTC' for Litecoin).

Query parameters

testMempoolAcceptboolean

If true, tests whether the transaction would be accepted into the mempool without broadcasting it.

Request body

hexstring

The raw transaction in hexadecimal format, or finalized PSBT in Base64 or hex.

Example request

{
  "hex": "0200000001..."
}

Response

Transaction processed successfully.

successboolean

Whether the transaction was successfully broadcast.

rpcCodeinteger

The RPC code returned by the node.

rpcCodeMessagestring

The error code message returned during transaction submission.

rpcMessagestring

The detailed RPC message returned by the node.

Example response

{
  "rpcCode": -25,
  "rpcCodeMessage": "General error during transaction submission",
  "rpcMessage": "bad-txns-inputs-missingorspent"
}

Changes

Changed in 4 of the 40 revisions of this API.418

  • 7cfed66afed8114See the full diff
    • removed the required property transactionId from the response with the 200 status

      response-required-property-removed

    • removed the request property psbt

      request-property-removed

    • added the optional property rpcCode to the response with the 200 status

      response-optional-property-added

    • added the optional property rpcCodeMessage to the response with the 200 status

      response-optional-property-added

    • added the optional property rpcMessage to the response with the 200 status

      response-optional-property-added

    • added the optional property success to the response with the 200 status

      response-optional-property-added

  • cfaf4efd4ea823See the full diff
    • the code response's property type/format changed from integer/ to string/ for status 400

      response-property-type-changed

    • removed the required property error from the response with the 400 status

      response-required-property-removed

    • added the optional property httpCode to the response with the 400 status

      response-optional-property-added

    • added the optional property message to the response with the 400 status

      response-optional-property-added

    • added the optional property reason to the response with the 400 status

      response-optional-property-added

    • endpoint added

      endpoint-added

    • api path removed without deprecation

      api-path-removed-without-deprecation

    This revision also has 14 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog