Receive custom payment notifications. View full API documentation.
var Receive = require('blockchain.info/Receive')
Creating a new instance for receiving payments:
var myReceive = new Receive(xpub, callback, key)
Parameters (required):
xpub
- a BIP32 extended public key for generating bitcoin addressescallback
- the url that you want to receive payment notifications to (ex:'http://mysite.com/receive'
)key
- your blockchain.info API v2 key (click here to request a key)
myReceive.generate(query)
Generate the next address for the xpub used to initialize myReceive
.
Parameters:
query
- Object of key/value pairs that will be added to the query string of the callback url as arguments. Although this is not required, it is highly recommended that you include asecret
query parameter for security.
Responds with an object containing the following properties:
address
- the newly generated address, this is where your customer should send bitcoinindex
- the index of the newly generated addresscallback
- the full callback url to which payment notifications will be sent