Once an invoice is created, it is essential to provide a means for another party to receive the invoice and proceed with the payment. The response from the "/invoice" endpoint, typically in JSON format, can be utilized to extract the relevant information required for this process.
There are 2 ways to resolve an invoice:
Using an internal invoice ID query for any invoices that may be stored locally.
Using the URL extension in the /URI endpoint that can be resolved externally.
Get Invoice by paymentRequest invoice endpoint
In this method simply pass in the invoice Id value returned from the create invoice step which will return an invoice JSON related to that service ID.
var parameters = { invoiceId :"8f9f4c27-3782-46e2-b76f-1ef956f52c61"}constresponse=awaitrelysia.transaction.v1.paymentRequest(parameters)
Return Invoice JSON from an internal service using the invoice Id value.
Headers
Name
Type
Description
Get Invoice by URI endpoint
In this method, invoices can be obtained by utilizing a URI endpoint with a specific URL extension. This approach serves as a way to externally receive invoices from the system.
Here is an example of the URL extended format that is used in the URI endpoint to resolve the invoice and can be found in the "uri" field when creating the invoice.
var parameters = { uri:"pay:?r=https://api.relysia.com/v1/paymentRequest/8f9f4c27-3782-46e2-b76f-1ef956f52c61"}constresponse=awaitrelysia.utility.v1.uri(parameters)
Resolve address, paymail aliias and invoice information
GEThttps://api.relysia.com/v1/URI
The URI endpoint helps developers to resolve addresses, paymails and invoices and puts them into a standardized response format.
Headers
Response types
Depending whether your invoice is DPP or BIP270 will determine the type of response returned. Here are both examples.