blink
blink copied to clipboard
add metadata when creating invoice
when an API user is creating an invoice, there is a way to pass a memo
field. This memo is aimed to be included in the boltt11 invoice, and display to both the sender (because it's part of the invoice) and the recipient.
we should add another field called metadata
that allow an API user to add more data related to a payment, without the API user to himself have to have an external database to track the payment information.
this would be needed for a service like zaprite.
this metadata should have limited length. based on my discussion with the developer at zaprite, he had a json stringified with 3 values in it. my gutts feeling would be that maybe 1024 characters long would be ok. obvisouly this is an attack vector if the storage is large so we want to keep this small.
Thanks for this Nicolas. Here's a gist I had wrote up a few days ago for your team. Hope it helps! https://gist.github.com/john-zaprite/530d2b07daeca6c0405c38e2dd4f8cd2
The metadata
would be simple, just a few key: value
pairs should be fine:
"metadata": {
"userId": "QNmM7hHzi6vjbi15BSu9",
"docId": "M7hNmHzi15Bidi6vjbSQ",
"ref": "l4c9wAxjt8A7QUqZr7Dh"
}
after discussing with john during baltic honey badger, it seemed the requirement to get this was not that important. the most important requirement was the existence of the webhook