Payments
Specify the amount you need of a token (e.g. stable coin) or BitcoinSV
As We learned in the earlier section about invoices, there are advantages to pre-determine request amounts. From a infrastructure perspective, it is advantageous to create invoice alike schemas even if no invoice was given to exactly determine what script to use to make certain payments.
The /pay endpoint takes up lookup response formats and triggers a payment. While that might sound a bit complex, we can imagine is as a standardization machine that can take up a variety of formats without worrying about their compatibility.
Whereas the payment endpoint is essential to complete invoice requests, we created utility wrappers around the pay endpoint, such as the /send endpoint that lets you define address, type and amount to make transactions in a simpler format.

Make a Payment

To make a invoice payment, take the response of the URI endpoint (the data) without any additional changes to pay a payment invoice.
1
var parameters = {
2
serviceId: 'optional',
3
walletID: 'optional',
4
data: {
5
"uri": "string",
6
"type": "string",
7
"mainProtocol": "string",
8
"outputs": [
9
{
10
"script": "string",
11
"satoshi": "string"
12
}
13
],
14
"inputs": [
15
{
16
"txid": "string",
17
"vout": 0,
18
"satoshis": 0,
19
"scriptPubKey": "string",
20
"scriptType": "string",
21
"scriptSig": "string"
22
}
23
],
24
"memo": "string",
25
"isBSV": true,
26
"peer": "string",
27
"peerData": "string",
28
"peerProtocol": "string"
29
}
30
}
31
const response = await relysia.pay(parameters);
Copied!
post
https://api.relysia.com
/v1/pay
Pay an invoice request.
Copy link
Contents
post
/v1/pay