Order status
Returns the order status of the transaction.
Returns the order status of the transaction
POST
https://api.onramp.money/onramp/api/v2/common/transaction/orderStatus
Headers
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
orderId* | Integer | order id of the transaction |
type* | Integer | 1 -> Onramp 2 -> Offramp |
{
"status":1,
"code":200,
"data":{
"orderStatus":4
}
}
Sample Request
var CryptoJS = require('crypto-js');
var axios = require('axios');
async function orderStatus() {
try {
let body = {
orderId: '89912',
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/v2/common/transaction/orderStatus',
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)
}
}
orderStatus();
import json
import time
import base64
import hmac
import hashlib
import requests
def order_status():
try:
body = {
'orderId': '89912',
'type': 1
}
payload = {
"timestamp": int(time.time() * 1000), # to get timestamp in milliseconds
"body": body
}
api_key = 'API_KEY'
api_secret = 'API_SECRET'
payload = base64.b64encode(json.dumps(payload).encode()).decode()
signature = hmac.new(api_secret.encode(), payload.encode(), hashlib.sha512).hexdigest()
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json;charset=UTF-8',
'X-ONRAMP-SIGNATURE': signature,
'X-ONRAMP-APIKEY': api_key,
'X-ONRAMP-PAYLOAD': payload
}
url = 'https://api.onramp.money/onramp/api/v2/common/transaction/orderStatus'
response = requests.post(url, headers=headers, data=json.dumps(body))
print(response.json())
except Exception as e:
print(str(e))
order_status()
{
"status":1,
"code":200,
"data":{
"orderStatus":4
}
}
Onramp Explanation
status -> 0 is for unsuccessful request, 1 is for a successful one
status -> denotes the status of the order
-4 -> wrong amount sent
-3 -> bank and kyc name mismatch
-2 -> transaction abandoned
-1 -> transaction timed out
0 -> transaction created
1 -> referenceId claimed
2 -> deposit secured
3, 13 -> crypto purchased
4, 15 -> withdrawal complete
5, 16 -> webhook sent
11 -> order placement initiated
12 -> purchasing crypto
14 -> withdrawal initiated
Offramp Explanation (additional fields)
status -> denotes the status of the order
-4 -> amount mismatch
-2 -> transaction abandoned.
-1 -> transaction time out.
0 -> order created.
1 -> order confirmed i.e. hash generated.
2,10,11 -> hash found status.
3 -> over limit (If the user sends a quantity of cryptocurrency that exceeds their KYC limit, their funds will be withheld until reviewed manually).
4,12 -> crypto sold.
5,13,30,31,32,33,34,35,36 -> fiat withdrawal initiated to bank
6,14,40 -> fiat withdrawal processed.
7,15,41 -> webhook sent
17 -> provide alternate bank
18 -> processing to alternate bank
19 -> success
Last updated