The \fBsendonion\fR RPC command can be used to initiate a payment attempt with a
custom onion packet\. The onion packet is used to deliver instructions for hops
along the route on how to behave\. Normally these instructions are indications
on where to forward a payment and what parameters to use, or contain details
of the payment for the final hop\. However, it is possible to add arbitrary
information for hops in the custom onion, allowing for custom extensions that
are not directly supported by c-lightning\.
The onion is specific to the route that is being used and the \fIpayment_hash\fR
used to construct, and therefore cannot be reused for other payments or to
attempt a separate route\. The custom onion can generally be created using the
\fBdevtools/onion\fR CLI tool, or the \fBcreateonion\fR RPC command\.
The \fIonion\fR parameter is a hex-encoded 1366 bytes long blob that was returned
by either of the tools that can generate onions\. It contains the payloads
destined for each hop and some metadata\. Please refer to \fBBOLT 04\fR (\fIhttps://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md\fR) for
further details\.
The \fIfirst_hop\fR parameter instructs c-lightning which peer to send the onion
to\. It is a JSON dictionary that corresponds to the first element of the route
array returned by \fIgetroute\fR\. The following is a minimal example telling