Offramp API Integration.

Web hook - Offramp

5min

This section explains the steps to configure callback URLs for receiving events about the completed transaction.

Configuring Webhook

Webhooks are configured in merchant dashboard.

InsideΒ API SetupΒ section, webhook can be added and modified under Callback URL's section

Document image
ο»Ώ

Generating HMAC

Signature is computed using Hash-based message authentication code (HMAC) using a secret key. The secret key is the API Secret present in your merchant dashboard.

The example implementation in Nodejs is show below ⬇️

Node.js
ο»Ώ
This callback will be triggered when the crypto coins are deposited to the given receiver address. will use the configured webhook url to send order completed details in POST body.
POST
Request
Header Parameters
Content-Type
String
optional
application/json; charset=utf-8
X-Onmeta-Signature
String
required
{{signature-of-the-request}} as computed above.
Body Parameters
fiat
Number
required
fiat amount
senderWalletAddress
String
required
receiver Wallet address
sellTokenSymbol
String
required
token symbol ex: BTC/USDC
sellTokenAddress
String
required
smart contract of the token example : "0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889" for WMATIC
orderId
String
required
order ID - unique for a given ID
status
String
required
order status : "completed"
currency
Number
required
currency type example: "inr"
chainId
Number
required
block chain ID : example: "80001" for polygon testnet
customer
Object
required
created_at
String
required
created time
updated_at
String
required
updated time
tenantId
String
required
merchant Id
transactionId
String
required
unique transaction ID for payout.
tokensDeducted
Number
required
tokens deducted to create this order.
tds
Number
required
Tax Deducted at Source for this order.
eventType
String
required
onramp/offramp
source
String
required
ο»Ώ

eventType will be offramp for this order

Make sure you have firewall rule allowed for receiving the webhook body if not your firewall might block our webhook requests.

Sample body

JS
ο»Ώ

Offramp Webhook Events

Onmeta offramp flow allows you to receive real-time notifications through webhook events when certain events occur. There are four types of webhook events that are supported in this flow:

  1. pending - This event is triggered when a user has initialised the order but crypto transfer is pending.
  2. orderReceived - This event is triggered when a user transfers crypto and the tokens are received by Onmeta.
  3. InProgress (Optional) - This event is triggered when the order is in-progress on the blockchain while swapping tokens (in case of non-base tokens).
  4. CryptoReceived - When we successfully validate the crypto received from user we send this event.
  5. PayoutSuccess - This event is triggered when the fiat amount is successfully deposited in the users bank account
  6. refunded - This event is triggered when refund is successfully completed in case of amount/token mismatch

Example Webhook Request :

JSON
ο»Ώ

ο»Ώ