<p>You can. If you make a Bitcoin URI with the <code>r</code> parameter, it will interpret that as a url to fetch the PaymentRequest from.</p>

<p>Documentation on this feature is frustratingly sparse, so I'm having trouble figuring out how to implement all of the details, though.</p>

CC BY-SA 3.0
2015-04-21T14:09:03.820Z
Yeah, I've been observing that frustration too. Hopefully this will start moving me in the right direction, though.
S. Buda
CC BY-SA 3.0
2015-04-21T19:44:17.700Z
So, correct me if I'm wrong, but it looks to me like, if I use the r parameter, it will come back to my server to try to handle the bitcoin payment, rather than using a payment address.

However, that seems like it won't work to me if my server is not actually handling bitcoins. I should still be able to use the uri (as indicated https://electrum.org/bitcoin_URIs.html) without the r parameter, but then I'll need some sort of check to coinbase to see if the payment goes through? Which I guess that would mean that a payment request isn't quite what I need, but rather BIP21 is sufficient?
S. Buda
CC BY-SA 3.0
2015-04-21T20:10:51.990Z
@S.Buda If you don't need any of the features in BIP70, then you should use BIP21 instead, yeah.
Nick ODell
CC BY-SA 3.0
2015-04-21T20:29:00.223Z
In that case, (and even messing around with BIP70 this seems to work), I found it easier to not worry about all that extra clutter with the bitcoinJ api. I used it to create a payment address, and then wrote a function that created the URI I needed as a string and will then send that URI back to the client. Thanks for the help, again.
S. Buda
CC BY-SA 3.0
2015-04-21T00:39:45.697Z
2015-04-21T00:39:45.697Z
Nick ODell
<p>I am writing a java webserver that can use bitcoin as a payment method. Thanks to the <a href="https://bitcoin.stackexchange.com/questions/36953/accept-payments-on-someone-elses-behalf-without-being-able-to-spend-them">helpful advice in this question,</a> I am able to generate payment addresses for various signed up vendors. I am now taking that address and creating a Payment Request using the bitcoinJ library. I would like, however, to have this request as a meaningful URL still, so the web browser or client making the payment can do something with it. That is to say, I create the payment request on the server and return it to the client. The client can then put that request in their wallet of choice and make a payment.</p>

<p>Is the payment request able to work that way? <a href="https://stackoverflow.com/questions/23568270/how-do-i-create-a-bitcoin-payment-request">I saw this post on stackoverflow that indicates that it can,</a> however I haven't been able to see anything within the API I am using that can do that. Is that a limitation of the specification, the library I'm using, or is it possible to do?</p>

<bitcoinj><website-integration><bip70-payment-protocol>
Can you generate a url from a payment request?
S. Buda
# Can you generate a url from a payment request?

(Asked by: username_0 on 2015-04-20)

I am writing a java webserver that can use bitcoin as a payment method. Thanks to the [helpful advice in this question,](https://bitcoin.stackexchange.com/questions/36953/accept-payments-on-someone-elses-behalf-without-being-able-to-spend-them) I am able to generate payment addresses for various signed up vendors. I am now taking that address and creating a Payment Request using the bitcoinJ library. I would like, however, to have this request as a meaningful URL still, so the web browser or client making the payment can do something with it. That is to say, I create the payment request on the server and return it to the client. The client can then put that request in their wallet of choice and make a payment.

Is the payment request able to work that way? [I saw this post on stackoverflow that indicates that it can,](https://stackoverflow.com/questions/23568270/how-do-i-create-a-bitcoin-payment-request) however I haven't been able to see anything within the API I am using that can do that. Is that a limitation of the specification, the library I'm using, or is it possible to do?

**Tags:** bitcoinj, website-integration, bip70-payment-protocol


---

## 1 answers

### Answer by username_1 on 2015-04-21. Score: 1 | Accepted answer

You can. If you make a Bitcoin URI with the `r` parameter, it will interpret that as a url to fetch the PaymentRequest from.

Documentation on this feature is frustratingly sparse, so I'm having trouble figuring out how to implement all of the details, though.

> **Comments:**
> **username_0**: Yeah, I've been observing that frustration too. Hopefully this will start moving me in the right direction, though.  
> **username_0**: So, correct me if I'm wrong, but it looks to me like, if I use the r parameter, it will come back to my server to try to handle the bitcoin payment, rather than using a payment address.  However, that seems like it won't work to me if my server is not actually handling bitcoins. I should still be able to use the uri (as indicated https://electrum.org/bitcoin_URIs.html) without the r parameter, but then I'll need some sort of check to coinbase to see if the payment goes through? Which I guess that would mean that a payment request isn't quite what I need, but rather BIP21 is sufficient?  
> **username_1**: @S.Buda If you don't need any of the features in BIP70, then you should use BIP21 instead, yeah.  
> **username_0**: In that case, (and even messing around with BIP70 this seems to work), I found it easier to not worry about all that extra clutter with the bitcoinJ api. I used it to create a payment address, and then wrote a function that created the URI I needed as a string and will then send that URI back to the client. Thanks for the help, again.  

---

