Query Order

Introduction

This API is for querying the status of the order

Test environment

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

Prod environment

https://openapi.alchemypay.org/open/api/v4/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.
signYstringSignature, you can refer to the signature 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": {
    "side": "BUY",
    "amount": "15.00000000",
    "orderNo": "1037622078705283072",
    "address": "0xc871473c179028b86e883fb407d7c81df9374399",
    "payTime": "2022-11-03 15:02:19",
    "txTime": "2022-11-03 15:13:00",
    "networkfee": "0.29000000",//will be expired in 30/Mar
    "networkFee": "0.29000000",
    "crypto": "USDT",
    "network": "BSC",
    "cryptoPrice": "1.00000000",
    "payType": "CREDIT_CARD",
    "rampfee": "0.99850000", //will be expired in 30/Mar
    "rampFee": "0.99850000",
    "cryptoQuantity": "13.71150000",
    "appId": "f83Is2y7L425rxl8",
    "fiat": "USD",
    "txHash": "0xba08ac9b4480211d4831930f33205d0a326e753a37ef423172304a3bb07e2635",
    "status": "FINISHED" //PENDING, PAY_FAIL, PAY_SUCCESS, TRANSFER, CANCEL, FINISHED
  },
  "traceId": "63fd618f2662be1f56f1f16d635100d9"
}

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

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
}