Pay Invoice
Make a payment on an invoice
Last updated
Make a payment on an invoice
Last updated
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. Similar to the get invoice methods, there are also two ways to pay for an invoice. This includes an internal method and and external method.
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.
To make a invoice payment, take the response of the URI endpoint (the data) without any additional changes to pay a payment invoice.
This is an example of paying for a DPP invoice using the /pay endpoint. Please check in Get Invoice to get extended values for the body input using DPP.
POST
https://api.relysia.com/v1/pay
The endpoint enables users to pay their invoices that were earlier resolved and put into a standardized format by the /URI endpoint.
Name | Type | Description |
---|---|---|
This is an example if paying for a BIP270 invoice using the /pay endpoint. Please check in Get Invoice to get extended values for the body input using BIP270.
POST
https://api.relysia.com/v1/pay
The endpoint enables users to pay their invoices that were earlier resolved and put into a standardized format by the /URI endpoint.
This method involves constructing a transaction using the /rawTx API and using it as a parameter in another API to associate it with an internal invoice ID for payment confirmation.
Whether DPP or BIP270 is used, the process remains consistent. The /rawTx API is used to create the transaction, and its data is passed as a parameter in the relevant API to link it with an internal invoice ID.
Regardless of the invoice standard (DPP or BIP270) being utilized, the transaction construction and referencing process remains the same, ensuring compatibility and consistency across both methods.
POST
https://api.relysia.com/v1/paymentRequest/pay/:invoiceId
The API takes invoice and settles it.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
network*
String
uri*
String
memo*
String
type*
String
paymentUrl*
String
mainProtocol*
String
modes*
Object
beneficiary *
Object
version*
String
uri
String
type
String
mainProtocol
String
outputs
Array
inputs
Array
memo
String
isBSV
String
peer
String
peerData
String
peerProtocol
String
invoiceId*
String
Invoice ID to be paid
merchantData
String
merchant information
transaction*
String
Transaction hexadecimal value
refundTo
String
Address for refund if required
memo
Description about the transaction