<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>

CC BY-SA 4.0
2019-06-05T16:43:25.240Z
2019-06-05T16:43:25.240Z
Rene Pickhardt
<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>

<lightning-network><lightning-routing>
Can I explicitly specify a path for Lightning payment?
Sergei Tikhomirov
# Can I explicitly specify a path for Lightning payment?

(Asked by: username_0 on 2019-06-05)

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

1. calculate best N paths according to some metric (like, total fees);
2. try to perform the payment through the best path;
3. 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?

**Tags:** lightning-network, lightning-routing


---

## 1 answers

### Answer by username_1 on 2019-06-05. Score: 1

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/username_1/c-lightning-plugin-collection/blob/master/rebalance-jit-routing/rebalance.py>


---

