API Settings

List of available merchants

The request allows you to get the list of cryptobank payment gateways available for your account, including up-to-date information on rates and commissions.

Response sample


POST or POST
https://relictum.finance/api/v1/finance/gates
Content-Type: application/json

// Options

{
	"api_key": "RELICTUM_FINANCE_API_KEY"
}


// Response

{
   "gates":{
      "USDT-TRX":[
         {
            "title":"USDT Tron",
            "alias":"usdt-tron",
            "min_sum":10,
            "max_sum":100000,
            "rate":1,
            "gateCurrency":{
               "code":"USDT-TRX",
               "title":"Tether Tron TRC-20",
               "type":"crypto"
            },
            "data":{
               "send_paysys_identificator":"USDTTRC",
               "dec_digits":4,
               "icon":"https://dev.relictum.finance/img/gate/usdttrc20.svg",
               "networks":[
                  "TRC20"
               ],
               "percent_fee":0,
               "min_fee":1
            }
         }
      ],
      "USDT":[
         {
            "title":"USDT Tether",
            "alias":"usdt-tether",
            "min_sum":1000,
            "max_sum":100000,
            "rate":1.02,
            "gateCurrency":{
               "code":"USDT",
               "title":"Tether Ethereum ERC-20",
               "type":"crypto"
            },
            "data":{
               "send_paysys_identificator":"USDT",
               "dec_digits":4,
               "icon":"https://dev.relictum.finance/img/gate/usdterc20.svg",
               "networks":[
                  "ERC20"
               ]
            }
         }
      ]
   }
}

Also it is possible to send a request using the GET method, in which case the response will return a list of all active gateways of the cryptobank.

Purchase

The request allows you to create a USDR purchase order for the selected cryptocurrency. The response contains information about the created order, including the created order ID, which must be saved. After the end user transfers funds to the address received in the response, USDRs will be transferred to the specified address of the Relictum network automatically, and the status of the created transaction will change, and the cryptobank will notify you about that fact with a callback request to the URL specified in the settings of your API key.

Response sample

POST
https://relictum.finance/api/v1/finance/buy
Content-Type: application/json

// Options

{
	"api_key": " RELICTUM_FINANCE_API_KEY ",
	"currency": "USDT-TRX",
	"sum": "200",
	"relictum": "relictum_recipient_wallet_address",
	"email": "test@relictum.finance"
}

// Response

{
   "success":true,
   "transaction":{
      "id":374,
      "sum":200,
      "sum_currency":201,
      "status":0,
      "gate":{
         "title":"USDT Tron",
         "alias":"usdt-tron",
         "min_sum":10,
         "max_sum":100000,
         "rate":1,
         "gateCurrency":{
            "code":"USDT-TRX",
            "title":"Tether Tron TRC-20",
            "type":"crypto"
         },
         "data":{
            "send_paysys_identificator":"USDTTRC",
            "dec_digits":4,
            "icon":"https://dev.relictum.finance/img/gate/usdttrc20.svg",
            "networks":[
               "TRC20"
            ],
            "percent_fee":0,
            "min_fee":1
         }
      },
      "user":{
         "username":"test@relictum.finance",
         "email":"test@relictum.finance"
      },
      "created_at":"2021-08-16 16:30:48",
      "updated_at":"2021-08-16 16:30:48",
      "transaction_address":"TNhVvX9Tjmmu19MaL77bEYs7TxqPkczVM4",
      "data":{
         "relictum":"relictum_recipient_wallet_address",
         "course":1,
         "percent_fee":0,
         "min_fee":1,
         "fee":1
      }
   }
}

  • relictum —   The address to which USDR will be sent.
  • email —    End user's email address.

Status

It is not necessary to use this request if you correctly process callback requests from the cryptobank to update transaction statuses, but it allows you to check the current status of any transaction in the cryptobank at any time

Response sample

GET
https://relictum.finance/api/v1/finance/status?id=<id>
Content-Type: application/json

// example

https://relictum.finance/api/v1/finance/status?id=374
Ответ:
{
   "success":true,
   "transaction":{
      "id":374,
      "sum":200,
      "sum_currency":201,
      "status":0,
      "gate":{
         "title":"USDT Tron",
         "alias":"usdt-tron",
         "min_sum":10,
         "max_sum":100000,
         "rate":1,
         "gateCurrency":{
            "code":"USDT-TRX",
            "title":"Tether Tron TRC-20",
            "type":"crypto"
         },
         "data":{
            "send_paysys_identificator":"USDTTRC",
            "dec_digits":4,
            "icon":"https://dev.relictum.finance/img/gate/usdttrc20.svg",
            "networks":[
               "TRC20"
            ],
            "percent_fee":0,
            "min_fee":1
         }
      },
      "user":{
         "username":"test@relictum.finance",
         "email":"test@relictum.finance"
      },
      "created_at":"2021-08-16 16:30:48",
      "updated_at":"2021-08-16 16:30:48",
      "transaction_address":"TNhVvX9Tjmmu19MaL77bEYs7TxqPkczVM4",
      "data":{
         "relictum":"relictum_recipient_wallet_address",
         "course":1,
         "percent_fee":0,
         "min_fee":1,
         "fee":1
      }
   }
}

  • <id> —   Order ID in the cryptobank.

Possible values of the status field:

  • 0 – New transaction
  • 1 – Transaction paid success
  • 2 – Transaction canceled
  • 3 – Transaction is pending moderation
  • 5 – An error occurred while processing a transaction.

User verification

This request is optional, but it will allow you to check the correctness of filling in the email field, as well as provide the end user with a hint about filling in the relictum field (if he is given such an opportunity), in the case when this email is already registered in the cryptobank.

Response sample

GET  https://relictum.finance/api/v1/user/get-relictum?email=<email>
Content-Type:  application/json
{
    "success":  true,
    "relictum"  null
}
  • <email> —   end user's email address.

Callback

Cryptobank will send a request to the URL you specified when the status of the order you have created changes to successful or canceled.

Response sample

{
    "currency":  "USDT-TRX",   
    "id":  "374",   
    "status":  "SUCCESS",
    "sum":  "185",   
    "sum_currency":  "186",   
    "verify_hash":  "SECRET_HASH"     
}
  • id —    order ID in the cryptobank you saved after your purchase request.
  • verify_hash —   a message signature that allows you to verify that the request came from a cryptobank.

Please note that the USDR amount <sum> and the currency amount <sum_currency> may differ from the values set when the transaction was created (for example, if the end user transferred an amount different from the set one).

Make sure your code handles the value of each return parameter correctly.

Possible values of the status field:

  • SUCCESS —   transaction paid
  • CANCEL —   transaction cancelled

Verify_hash transaction (example on PHP):

$data = $_POST;
unset($data['verify_hash']);
ksort($data);
$dataString = serialize($data);
$checkKey = hash_hmac('sha1', $dataString, CALLBACK_API_KEY);
    
if ($checkKey != $_POST[''verify_hash'']) {
  return false;
}

Expected response if the event was successfully processed:

{
   "success":  true
}

In case of a different answer, the cryptobank will continue sending the request until a correct answer is received, or until the limit set in the API settings is reached.

Start using stable coins and currency on the Blockchain.

Relictum Finance is the your stable cryptocurrency system on the market today.

Get started