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 endpoint

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.

{
  "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.

POST 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

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

Last updated