<p>The <em>only</em> right way of of doing this is generating a new address for every expected payment, and then waiting until you've received that amount on that address.</p>

CC BY-SA 4.0
2021-05-30T23:15:12.973Z
Came here to write that. Use a new address for each invoice.
Murch
CC BY-SA 4.0
2021-05-30T23:26:55.637Z
Thanks... I guess thats a whole area we have missed out. At the moment assumption is that we store a fixed public address. Are there simple/free api's to generate multiple addesses on the fly for this purpose?
dacology
CC BY-SA 4.0
2021-05-31T01:13:11.437Z
Most wallets software will even make it hard for you to reuse addresses. When you request an address, you get a new one. Integrated POS systems like BTCPayServer do the same.
Pieter Wuille
CC BY-SA 4.0
2021-05-30T23:14:31.310Z
2021-05-30T23:14:31.310Z
Pieter Wuille
<p>This is probably a basic question but I can not find an answer.</p>
<p>We are developing a BTC payment process for a Point-of-Sale. We have managed to build this fine and can make requests (QR code) for a payment amount in BTC. for example 0.0001 BTC</p>
<p>We then check the blockchain for an equivalent transaction on our address of amount 0.0001 BTC.</p>
<p>This works.</p>
<p>But seems unreliable. What if there were to be multiple transactions at around the same time for the same amount. I really want to be able to insert a unique identifier/order number or memo into the QR code request which then gets passed onto the transaction. This would link the request to the payment with a unique id. <strong>Is there a way to do this? It seems odd if there is not? Or is there another obvious way that I am missing?</strong></p>
<p>We are using <a href="https://api.blockcypher.com" rel="nofollow noreferrer">https://api.blockcypher.com</a> to get the transaction details. Which look like below. There does not appear to be any kind of a &quot;memo&quot; parameter, although wallets and QR generators allow you to add such.</p>
<pre><code>{
      &quot;tx_hash&quot;: &quot;8bbe058b46f2f9a7e1709ca4a3ff731ba2227d23f2edf11eb8710dfcd6b1e502&quot;,
      &quot;block_height&quot;: 685568,
      &quot;tx_input_n&quot;: -1,
      &quot;tx_output_n&quot;: 0,
      &quot;value&quot;: 16692,
      &quot;ref_balance&quot;: 3417334,
      &quot;spent&quot;: false,
      &quot;confirmations&quot;: 4,
      &quot;confirmed&quot;: &quot;2021-05-30T22:09:51Z&quot;,
      &quot;double_spend&quot;: false
    },
</code></pre>

<transactions><blockchain><transaction-id>
Developing a Bitcoin POS (Payment Page) - How do I identify the transaction
dacology
# Developing a Bitcoin POS (Payment Page) - How do I identify the transaction

(Asked by: username_0 on 2021-05-30)

This is probably a basic question but I can not find an answer.

We are developing a BTC payment process for a Point-of-Sale. We have managed to build this fine and can make requests (QR code) for a payment amount in BTC. for example 0.0001 BTC

We then check the blockchain for an equivalent transaction on our address of amount 0.0001 BTC.

This works.

But seems unreliable. What if there were to be multiple transactions at around the same time for the same amount. I really want to be able to insert a unique identifier/order number or memo into the QR code request which then gets passed onto the transaction. This would link the request to the payment with a unique id. **Is there a way to do this? It seems odd if there is not? Or is there another obvious way that I am missing?**

We are using <https://api.blockcypher.com> to get the transaction details. Which look like below. There does not appear to be any kind of a "memo" parameter, although wallets and QR generators allow you to add such.

```
{
      "tx_hash": "8bbe058b46f2f9a7e1709ca4a3ff731ba2227d23f2edf11eb8710dfcd6b1e502",
      "block_height": 685568,
      "tx_input_n": -1,
      "tx_output_n": 0,
      "value": 16692,
      "ref_balance": 3417334,
      "spent": false,
      "confirmations": 4,
      "confirmed": "2021-05-30T22:09:51Z",
      "double_spend": false
    },

```

**Tags:** transactions, blockchain, transaction-id


---

## 1 answers

### Answer by username_1 on 2021-05-30. Score: 4 | Accepted answer

The *only* right way of of doing this is generating a new address for every expected payment, and then waiting until you've received that amount on that address.

> **Comments:**
> **username_2**: Came here to write that. Use a new address for each invoice.  
> **username_0**: Thanks... I guess thats a whole area we have missed out. At the moment assumption is that we store a fixed public address. Are there simple/free api's to generate multiple addesses on the fly for this purpose?  
> **username_1**: Most wallets software will even make it hard for you to reuse addresses. When you request an address, you get a new one. Integrated POS systems like BTCPayServer do the same.  

---

