Payrequest is a single payment payload that allows you to receive multiple payments of an undefined amount from your customers. This payload is essentially an LNurl Pay (lightning) or On-chain (bitcoin) address. You can generate a QR code using this. Customers will scan the QR code and enter the amount of their choice to pay.
To receive funds, you must first create a payrequest with details such as
max_uses, and others. The payrequest object essentially consists of a payment payload that can be converted into a QR code. You can see this implemented in One QR.
Let's look at the payrequest’s status and life cycle.
A payrequest is created with an active status and a QR-generable payload. When the customer transfers funds, the status of corresponding payment related to that payrequest changes to paid. However, the payrequest itself does not have a paid status. Payments received from a payrequest are also shown under the payments section of the Speed Web App, which helps you keep track of payments made through payrequests. You may deactivate a payrequest at any time.
Payrequest can have 2 statuses, as mentioned below:
Payrequest is active after its generation until it is deactivated.
You can manually deactivate a payrequest if you no longer wish to get paid via it.
Types of payrequest
There are two types of payrequests available:
on-chain. To generate a payrequest, select your preferred type and specify the expected currency. Decide how your customers would like to pay, and specify the type:
You can create a payrequest directly through the payrequest APIs. You can either create one to accept payments over lightning network or on-chain/bitcoin network. Specify which type you want in the request parameters.
For creating an on-chain payrequest, you do not need to mention details such as the
max_uses, and others. However, mentioning them in both scenarios is suggested by us.
Retrieve all the received payments
You can retrieve all received payments using the retrieve API. Learn more about this here. You can view a list of all payment objects associated with a payrequest using API or the Speed web application. To obtain all the data associated with a payrequest object, you must use the APIs.
Deactivate a payrequest
You can deactivate a payrequest created via the lightning network payment method only. It is not possible for on-chain payment methods.
Updated about 2 months ago