Get Invoice
Resolving an invoice to make a payment
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.
Get invoice JSON
GET
https://api.relysia.com/v1/paymentRequest/:invoiceId
Return Invoice JSON from an internal service using the invoice Id value.
Headers
invoiceId*
String
Invoice Id provided from creating invoice
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.
Resolve address, paymail aliias and invoice information
GET
https://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
URI*
Invoice URI provided in the /invoice response in the "uri" field
Response types
Depending whether your invoice is DPP or BIP270 will determine the type of response returned. Here are both examples.
These responses can be directly used to make a payment. In the next section we will see how to use these response values.
Last updated