---
agentTools:
  projectIndex: https://apidocs.tryspeed.com/llms.txt
---

# The payrequest object

To accept multiple payments using a single payment payload generated by Speed, you can use **payrequest**. This service generates LNurl Pay (Lightning) or On-chain (Bitcoin) address payment payload, which your customers can use to make multiple payments by scanning a QR code created from that payload.

Once your customers pay using payrequest, internally system create a payment and marked it as `paid`, associated with payrequest. This association helps you keep track of which payments are made through payrequest. Moreover, if you're associated to any other Speed account, then, as a platform account you can create a payrequest in any of your connected account.

Below is the request object of Payrequest with an explanation of all parameters.

```json
{
  "id": "pr_xxxxxxxxxxxxxxxxxxxxxxxxxx",
  "object": "pay_request",
  "status": "active",
  "type": "lnurl",
  "min_amount": 1,
  "max_amount": 500000000,
  "expected_currency": null,
  "max_uses": 0,
  "address": null,
  "url": "https://appapi.tryspeed.com/lnurl?q=92aef8877104823ffb79b54f96d6cc38d22944fa1ee",
  "secret": "92aef8877104823ffb73871f53gfegjhdelfigjecc38d22944fa1ee",
  "encoded": "lnurl1dp68gurn8ghj7ctswpshq6fww3e8jumsv4jkgtnrdakj7mrww4exc0m385unyct9vcursdehxycrgwpjxdnxvc3hxvurwvtxx5enwryxgerjdp5vesnzet90tm3f8",
  "success_url": null,
  "success_message": null,
  "statement_descriptor": null,
  "created": 1676626833155,
  "modified": 1676626833155
}
```

### Attributes

***

<b class="para-title">id</b> <span style="font-size:12px; color: #8792a2;">string</span>\
Unique identifier for the object.

***

<b class="para-title">object</b> <span style="font-size:12px; color: #8792a2;">string</span>\
The type of the object indicates to which entity this response belongs.

***

<b class="para-title">status</b> <span style="font-size:12px; color: #8792a2;">string</span>\
Payrequest can have 2 statuses, as mentioned below:

    <b class="para-title">active</b>\
     Payrequest is active after its generation until it is deactivated.\
     <b class="para-title">deactivated</b>\
     You can manually deactivate a payrequest if you no longer wish to get paid via it.

***

<b class="para-title">type</b> <span style="font-size:12px; color: #8792a2;">string</span>\
Both `onchain` and `lnurl` methods can be used to receive funds. This indicates the payrequest method (`lnurl`or `onchain`) used to send funds through this payrequest.

***

<b class="para-title">min\_amount</b> <span style="font-size:12px; color: #8792a2;">BigInteger</span>\
This is the minimum amount you will receive through this payrequest.

***

<b class="para-title">max\_amount</b> <span style="font-size:12px; color: #8792a2;">BigInteger</span>\
This is the maximum amount you will receive through this payrequest.

***

<b class="para-title">expected\_currency</b> <span style="font-size:12px; color: #8792a2;">string</span>\
Your customer will make a payment in SATS/BTC. However, you can specify the expected currency (fiat or cryptocurrency) in which you would like to store the conversion of the payment made by your customers in SATS.

***

<b class="para-title">max\_uses</b> <span style="font-size:12px; color: #8792a2;">BigInteger</span>\
This is the maximum number of payments that can be received through this payrequest. Here `0` means an infinite number of payments can be received.

***

<b class="para-title">address</b> <span style="font-size:12px; color: #8792a2;">string</span>\
If the method type is `onchain`, this indicates the Bitcoin wallet address to which the payment is sent. If not, it is null.

***

<b class="para-title">url</b> <span style="font-size:12px; color: #8792a2;">string</span>\
If the method type is `lnurl`, this indicates the url which is derived from decoding the `lnurl`. If not, it is null.

***

<b class="para-title">secret</b> <span style="font-size:12px; color: #8792a2;">string</span>\
If the method type is `lnurl`, this indicates the secret derived from the url. If not, it is null.

***

<b class="para-title">encoded</b> <span style="font-size:12px; color: #8792a2;">string</span>\
If the method type is `lnurl`, this indicates the `lnurl` that your customer can use to send funds. If not, it is null.

***

<b class="para-title">statement\_descriptor</b> <span style="font-size:12px; color: #8792a2;">string</span>\
Additional information about a payment made to an account using this payrequest.

***

<b class="para-title">success\_message</b> <span style="font-size:12px; color: #8792a2;">string</span>\
Message customers will see when they make payment via their preferred wallet.

***

<b class="para-title">success\_url</b> <span style="font-size:12px; color: #8792a2;">string</span>\
Customers will see this clickable link in their wallet if the transaction goes through successfully.

***

<b class="para-title">created</b> <span style="font-size:12px; color: #8792a2;">timestamp</span>\
Time at which the payrequest object was created.

***

<b class="para-title">modified</b> <span style="font-size:12px; color: #8792a2;">timestamp</span>\
Time at which the last modification was made.

***