> For the complete documentation index, see [llms.txt](https://docs.relysia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.relysia.com/payments/payments.md).

# Payments

How to make general payments

To make a payment it requires an input, and rather than the requirement to build this input from scratch we can utilize the URI endpoint as described in lookup. We can use the /URI endpoint as a way to construct these payment JSON values in a simplistic way.\
\
Here is an example of creating a payment request using the [URI ](/payments/uri.md)endpoint&#x20;

```javascript
var parameters = {
    uri: "payto:90@relysia.com?purpose=cashback&amount=10000"
}
const response = await relysia.utility.v1.uri(parameters)
```

This will be the response which is a standard payment format.

```javascript
{
  "statusCode": 200,
  "data": {
    "status": "success",
    "msg": "Operation completed successfully",
    "data": {
      "uri": "payto:90@relysia.com?purpose=cashback&amount=10000",
      "type": "paymail",
      "mainProtocol": "paymail",
      "outputs": [
        {
          "script": "76a914e2a15b75da46234f5e5943b1289b955842532ce088ac",
          "satoshis": 10000
        }
      ],
      "inputs": [],
      "memo": "cashback",
      "isBSV": true,
      "peer": "https://api.relysia.com/v1/bsvalias/receive-transaction/90@relysia.com",
      "peerData": "2zwwsow4bfg",
      "peerProtocol": "paymail"
    }
  }
}
```

This can then be used to facilitate general payments. The advantages include using a simple format provided by the URI endpoint, which allows for the retrieval of a comprehensive JSON schema conforming to widely accepted industry standards within the ecosystem. Alternatively, these formats can also be constructed from scratch if necessary.

## Pay an invoice request.

<mark style="color:green;">`POST`</mark> `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.

#### Headers

| Name                                   | Type   | Description                                    |
| -------------------------------------- | ------ | ---------------------------------------------- |
| data<mark style="color:red;">\*</mark> | Object | As described above using the inner data object |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "statusCode": 200,
  "data": {
    "status": "success",
    "msg": "Transaction Completed Successfully",
    "txid": "f12823a06cbc8b14b14a779f55c51a9c99e980495505b43d79ab6b8d5d0f5393"
  }
}
```

{% endtab %}
{% endtabs %}
