Create Invoice

Creating an invoice for payments

In this section, we will explore the various methods for generating invoices, namely the DPP and BIP270 processes, each with its own set of input fields. It's important to note that while DPP enables the creation of invoices using Tokens, BIP270 is specifically designed for generating BSV-type invoices.

Below, you will find examples of the invoice input bodies for both DPP and BIP270. For DPP, it is important to select and include either the "native" or "stas" section in the invoice input body, but does not support both at the same time.

var parameters = {
  "expirationTimeInMinuts": 0,
  "memo": "string",
  "paymentOptions": [
    {
      "transactions": [
        {
          "native": {
            "amount": 0,
            "to": "string"
          },
          "stas": {
            "tokenAmount": 0,
            "tokenRecipient": "string",
            "tokenId": "string"
          }
        }
      ]
    }
  ],
  "modeId": "ef63d9775da5",
  "beneficiary": {
    "name": "string",
    "email": "string",
    "address": "string",
    "paymentReference": "string"
  }
}
const response = await relysia.transaction.v1.invoice(parameters);

DPP

The abbreviation "DPP" stands for Direct Payment Protocol, which is utilized for generating invoices that encompass BSV (Bitcoin SV) or STAS tokens. Note that the payment options cannot include both native and stas and only one is required for the invoice to be created. The following is the "/invoice" endpoint to be employed when utilizing DPP:

Create an Invoice

POST https://api.relysia.com/v1/invoice

Create an invoice to receive payments for a merchant product.

Request Body

NameTypeDescription

expirationTimeInMinuts *

Number

Number of minuites the Invoice is valid for

memo

String

Notes about the transaction

paymentOptions*

Array

Either Native BSV or STAS token

modeId*

String

Specific identifier for the DPP protocol format used

beneficiary*

Object

Information about the merchant revieing the transaction

{
  "statusCode": 200,
  "data": {
    "msg": "Operation Completed Successfully !",
    "status": "success",
    "reqUrl": "https://api.relysia.com/v1/payment-request/f339874f-ad98-486d-9359-a8aa2af2e040"
  }
}

BIP270

BIP270 is a widely recognized invoice standard extensively adopted within the BSV (Bitcoin SV) ecosystem. When utilizing BIP270, the following are the inputs required for the "/invoice" endpoint:

Create an Invoice

POST https://api.relysia.com/v1/invoice

Create an invoice to receive payments for a merchant product.

Request Body

NameTypeDescription

type

String

Supported Currencies such as "USD" , "BSV", etc...

amount*

Number

amount in currency type

address*

String

receiving address for the payment

description

String

Description about the transaction

expirationTimeInMinuts*

Number

Number of minuites the Invoice is valid for

memo

String

Notes about the transaction

merchantData

String

Information about the receiving party/merchant

{
  "statusCode": 200,
  "data": {
    "msg": "Operation Completed Successfully !",
    "status": "success",
    "reqUrl": "https://api.relysia.com/v1/payment-request/f339874f-ad98-486d-9359-a8aa2af2e040"
  }
}

Last updated