user31712: From what I understand, in the current Lightning implementations payments work as follows:

calculate best N paths according to some metric (like, total fees);
try to perform the payment through the best path;
if it fails, try the next one, until one succeeds.

Is there a way, using standard APIs and implementations, to specify the path for the payment explicitly? For example, how can I find the best 10 paths and then try to execute the payment through path number 4?

user81940: In clightning there exist the sendpay command. From the manpage:
sendpay route payment_hash [label] [msatoshi] [bolt11]
  Send along {route} in return for preimage of {payment_hash}

If you look at my (work in progress) code for JIT routing you can see how I create paths and onions myself just with standard api calls to rebalance my channels :
https://github.com/renepickhardt/c-lightning-plugin-collection/blob/master/rebalance-jit-routing/rebalance.py

31712: <p>From what I understand, in the current Lightning implementations payments work as follows:</p>

<ol>
<li>calculate best N paths according to some metric (like, total fees);</li>
<li>try to perform the payment through the best path;</li>
<li>if it fails, try the next one, until one succeeds.</li>
</ol>

<p>Is there a way, using standard APIs and implementations, to specify the path for the payment explicitly? For example, how can I find the best 10 paths and then try to execute the payment through path number 4?</p>
 81940: <p>In clightning there exist the <code>sendpay</code> command. From the manpage:</p>

<pre><code>sendpay route payment_hash [label] [msatoshi] [bolt11]
  Send along {route} in return for preimage of {payment_hash}
</code></pre>

<p>If you look at my (work in progress) code for JIT routing you can see how I create paths and onions myself just with standard api calls to rebalance my channels :</p>

<p><a href="https://github.com/renepickhardt/c-lightning-plugin-collection/blob/master/rebalance-jit-routing/rebalance.py" rel="nofollow noreferrer">https://github.com/renepickhardt/c-lightning-plugin-collection/blob/master/rebalance-jit-routing/rebalance.py</a></p>
