use http basic auth to authenticate requests to generate invoices
where the username is your access token and the password an empty string.
Send the amount
in terms of USD, and the currency you want to collect being
BCH, DASH, ZEC, etc.
curl -X POST https://api.anypay.global/invoices \
-u myAccessToken: \
-d webhook_url=https://webhooks.coil.com/anypay \
-d amount=1 \
-d currency=DASH
GET https://api.anypay.global/invoices/{uid}
Given a webhook_url
the invoice data will be posted to your url when payment
is complete.
Your app can subscribe to notifications of payment via websockets:
var socket = socketIO('wss://ws.anypay.global', {
transports: ['websocket']
});
socket.on('connect', function () {
socket.emit('subscribe', {invoice: invoice.uid});
});
socket.on('invoice:paid', function (data) {
// handle invoice data
});