How to make general payments
To make a payment it requires an input, and rather than the requirement to build this input from scratch we can utilize the URI endpoint as described in lookup. We can use the /URI endpoint as a way to construct these payment JSON values in a simplistic way. Here is an example of creating a payment request using the URI endpoint
var parameters = {
uri: "payto:[email protected]?purpose=cashback&amount=10000"
const response = await relysia.utility.v1.uri(parameters)
This will be the response which is a standard payment format.
"statusCode": 200,
"data": {
"status": "success",
"msg": "Operation completed successfully",
"data": {
"uri": "payto:[email protected]?purpose=cashback&amount=10000",
"type": "paymail",
"mainProtocol": "paymail",
"outputs": [
"script": "76a914e2a15b75da46234f5e5943b1289b955842532ce088ac",
"satoshis": 10000
"inputs": [],
"memo": "cashback",
"isBSV": true,
"peer": "[email protected]",
"peerData": "2zwwsow4bfg",
"peerProtocol": "paymail"
This can then be used to facilitate general payments. The advantages include using a simple format provided by the URI endpoint, which allows for the retrieval of a comprehensive JSON schema conforming to widely accepted industry standards within the ecosystem. Alternatively, these formats can also be constructed from scratch if necessary.
Pay an invoice request.