Merchant Transaction History

POST https://api.onramp.money/onramp/api/v1/transaction/merchantHistory

Headers

NameTypeDescription

X-ONRAMP-APIKEY*

String

Your api key

X-ONRAMP-PAYLOAD*

String

payload generated for the request

X-ONRAMP-SIGNATURE*

String

signature generated for the request

Request Body

NameTypeDescription

page

Integer

Default value 1

pageSize

Integer

Min: 1, Max: 500, Default: 50

since

String

'2022-10-07T22:29:52.000Z'

order

String

ASC or DESC (ASC for ascending order of data DESC for descending, Default: ASC)

type

Integer

1 -> Onramp

2 -> Offramp

Onramp transactions are returned incase the field is empty.

fiatType

String

1 -> India (Default) INR

2 -> Turkey (TRY)

3 -> Arab Emirates Dirham (AED)

4 -> Mexican Peso (MXN)

5 -> Vietnamese dong (VND)

{
    "status": 1,
    "data": [
        {
            "orderId": 3,
            "userId": 1,
            "walletAddress": "012bahscbx",
            "coinId": 54,
            "fiatType": 1,
            "fiatAmount": 100,
            "expectedCryptoAmount": 46.23,
            "expectedPrice": 73,
            "createdAt": "2022-07-26T11:51:06.000Z",
            "appId": -1,
            "status": 0,
            "chainId": 3,
            "onRampFee": 0.25,
            "gatewayFee": 0,
            "clientFee": 0,
            "gasFee": 0.23,
            "actualCryptoAmount": null,
            "actualPrice": null,
            "hashId": null,
            "referenceId": null,
            "kycNeeded": 0,
            "trials": 0
        }
    ],
    "code": 200
}

Note -

  1. Transactions updated on or before "2022-11-09T16:58:07.000Z" UTC will have "2022-11-09T16:58:07.000Z" as the updatedAt field value. Transactions thereon will have the actual last updated timestamp.

  2. For Status codes and its meaning, please to refer to link.

Sample Request

var CryptoJS = require('crypto-js');
var axios = require('axios');
async function getAllTransactions() {
  try {
    let body = {
      page: 1,
      pageSize: 50,
      since: '2022-10-07T22:29:51.999Z',
      order: 'DESC',  // ASC or DESC
      type: 1         // 1 -> onramp, 2 -> offramp
    }
    let payload = {
      timestamp: new Date().getTime(),
      body
    }
    let apiKey = 'API_KEY', apiSecret = 'API_SECRET';
    payload = Buffer.from(JSON.stringify(payload)).toString('base64');
    let signature = CryptoJS.enc.Hex.stringify(CryptoJS.HmacSHA512(payload, apiSecret));
    let options = {
      url: 'https://api.onramp.money/onramp/api/v1/transaction/merchantHistory',
      method: 'POST',
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json;charset=UTF-8',
        'X-ONRAMP-SIGNATURE': signature,
        'X-ONRAMP-APIKEY': apiKey,
        'X-ONRAMP-PAYLOAD': payload
      },
      data: body
    };
    let data = await axios(options)
    console.log(data?.data);
  } catch (error) {
    console.log(error?.response?.data)
  }
}
getAllTransactions();
// Onramp resopnse
{
   "status":1,
   "data":[
      {
         "orderId":338,
         "walletAddress":"0x72c6668306f1d89425e86899b7444a0c2e5f25cf",
         "coinId":54,
         "fiatType":1,
         "paymentType":1,
         "expectedPrice":87,
         "fiatAmount":250,
         "expectedCryptoAmount":2.61,
         "actualPrice":0,
         "actualCryptoAmount":2.87,
         "kycNeeded":0,
         "createdAt":"2022-10-07T22:29:52.000Z",
         "updatedAt":"2022-11-09T16:58:07.000Z",
         "status":5,
         "transactionHash":"0x0ba7ec6883efb0aj7c3cd746a5fe77e82a599efcf03350667d91av70126a2169",
         "referenceId":"228066179164",
         "chainId":3,
         "onRampFee":0.63,
         "gasFee":0.25,
         "clientFee":0,
         "gatewayFee":0,
         "merchantRecognitionId":"23"
      }
   ],
   "code":200
}

//Offramp response
{
   "status":1,
   "data":[
      {
         "orderId":517,
         "coinId":54,
         "chainId":3,
         "walletAddress":"0x9C85C3761E0721c759b8015AC22EfE066dbB73EC",
         "expectedPrice":86,
         "expectedQuantity":1115,
         "onrampFee":2.79,
         "clientFee":0,
         "gatewayFee":8.26,
         "tdsFee":11.12,
         "merchantRecognitionId":'23',
         "paymentType":1,
         "fiatType":1,
         "actualPrice":86,
         "actualQuantity":1115,
         "actualFiatAmount":94685.48,
         "createdAt":"2023-03-31T05:26:18.000Z",
         "updatedAt":"2023-03-31T05:27:16.000Z",
         "status":6,
         "transactionHash":"0xe1s635ef8c1386c30dcdc176d85294c457bceea87289193cc4fb6046f110a070"
      }
   ]
}

Last updated