Once a transaction is created using the /send endpoint and broadcasted to the network, there may be situations where access to the raw transaction data before broadcasting is necessary. To address this use case, the /rawtx endpoint becomes relevant. By utilizing the /rawtx endpoint, you can generate one or multiple transactions and retrieve the un-broadcasted raw transaction data. This data can be employed for alternative processes as needed.
The transactions generated through the /rawtx endpoint are constructed in their pure form, devoid of any change outputs that might be required for subsequent transactions. It's important to understand that any change outputs included in the transactions are not considered valid on the network until the previous transaction has been successfully broadcasted.
Similar to the /send endpoint, the /rawtx endpoint allows you to create transactions using the same input parameters in the request body. This facilitates consistency and familiarity in the process of generating transactions between the two endpoints.
The rawtx response is a valid signed transaction that can be used in conjunction with paying invoices or awaiting other logic before broadcasting it to the network.