Query Order

Introduction

This API is for querying the status of the order

Test environment

https://openapi-test.alchemypay.org/open/api/v3/merchant/query/trade

Prod environment

https://openapi.alchemypay.org/open/api/v3/merchant/query/trade

❗️This API can only be invoked on the server side.

Http method

  • GET
  • Content-Type: application/json

Http Header

ElementMandatoryData TypeRemarks
appidYstringPartner unique ID; once a merchant has been on-boarded with Alchemy Pay, the merchant will be provided with the credentials with appId and appSecret
timestampYstringUTC time with 13 digits to represent time in milliseconds, the expiration period is 5 minutes.
signYstringSign the appId,timeStamp, and requested parameters alphabetically,the sign method can refer here

Url Parameter

ElementMandatoryData TypeRemarks
orderNoNstringAlchemyPay order No.
merchantOrderNoNstringMerchant defined order No.
sideYstringBUY/SELL

Request sample

https://openapi-test.alchemypay.org/merchant/query/trade?orderNo=1028577684629876736&side=BUY>

Response sample

Buy order query

{
	"success": true,
	"returnCode": "0000",
	"returnMsg": "SUCCESS",
	"extend": "",
	"data": {
		"payTime": "20240218 17:57:27",
		"txTime": "20240218 18:02:00",
		"networkFee": "0.59",
		"rebateFiatAmount": "0.00",//rebate amount(priced in fiat)
		"fiatInUSD": "16.16",
		"network": "ELF",
		"tokenAddress": "",
		"cryptoPrice": "0.58960000",
		"payType": "CREDIT_CARD",
		"rampFee": "0.97",
		"appId": "f83Is2y7L425rxl8",
		"fiat": "EUR",
		"txHash": "b42deff9e2f8203610206e12c81141a1535500857e73019bf4a497976eab3d3d",
		"rampFeeInUSD": "1.04",//rampFee (priced in USD)
		"side": "BUY",
		"amount": "15.00000000",
		"orderNo": "1208713811041964032",
		"address": "2e2cHgY9uL12P2xYo6w4MZETXB38oGimUPsfKQPHuJCu1FPCTy",
		"cryptoNetworkFee": "1",//priced in purchased tokens	
		"networkFeeInUSD": "0.63",//networkFee (priced in USD)
		"networkfee": "0.59",//networkFee(priced in fiat)
		"cryptoAmountInUSDT": "14.48063802",//The token received by user (priced in USDT)	
		"rebateUsdAmount": "0.00",//rebate amount
		"crypto": "ELF",
		"rampFeeUnit": "EUR",
		"rampfee": "0.97",//expired
		"cryptoQuantity": "22.78759300",
		"createTime": "20240218 17:57:09",
		"alpha2": "DE",
		"status": "FINISHED"//PENDING, PAY_FAIL, PAY_SUCCESS, TRANSFER, CANCEL, FINISHED
	},
	"traceId": "65ead0a2c1d741ee8080a393696061b1"
}

🔥 "networkfee" and "rampfee" will be expired in 30/Mar

Status returns the following parameters for FINISHED:

ElementData TypeRemarks
fiatInUSDstringFiat amount(count in USD)
rampFeeInUSDstringService charge(count in USD)
cryptoNetworkFeestringNetwork Fee(count in purchased token). Merchant refer to this.
networkFeeInUSDstringNetwork fee (priced in USD), calculated as cryptoNetworkFee and priced in USD
cryptoAmountInUSDTstringThe token received by user (priced in USDT)

Sell order query

{
  "orderNo": "1080106145537236992", 
  "address": "dev03dc84dbfeb74853aa91154efa9b7a13", // wallet address user need to transfer
  "payTime": "2023-02-28 20:44:46", // transfer fiat start time
  "completeTime": "2023-02-28 20:41:08", // block confirm time
  "merchantOrderNo": "kvhl6zvvrg", 
  "crypto": "USDT",
  "network": "TRX", 
  "cryptoPrice": "1.0000000000", // fiat
  "cryptoAmount": "100.0000000000",
  "fiatAmount": "100.0000000000", //fiat amount contains ramp feee
  "appId": "ahzxh0klegv1fzol",
  "fiat": "USD", 
  "txHash": "sdasdasdasdasdasdsad",
  "email": "[email protected]", 
  "signature": "9aa9b34e950061f1bb1e9ccd6fadcedab8e354f6",
  "status": "4",  // 1:order create success  2:user transfered token  3:start to pay fiat to user  4:payment success 5:payment fail 6:refund success 7:order expired
  "orderAddress": "https://ramp-dev.alchemytech.cc/#/sellOrder?sellOrderId\u003d1080106145537236992", // order detail page
  "cryptoActualAmount": "100.0000000000", // 
  "rampFee": "1.7500000000", // fiat
  "receiptTime": "2023-02-28 20:45:22", //transfer fiat success time
  "paymentType": "10001", //  10001 banktransfer
  "name": "asdfsfsd", // account name
  "account": "******4567", // account number
  "card": "", // card No 
  "failReason": "" // failReason
}