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
optional
String
application/json; charset=utf-8
X-Onmeta-Signature
required
String
{{signature-of-the-request}} as computed above.
Body Parameters
fiat
required
Number
fiat amount
senderWalletAddress
required
String
receiver Wallet address
sellTokenSymbol
required
String
token symbol ex: BTC/USDC
sellTokenAddress
required
String
smart contract of the token example : "0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889" for WMATIC
orderId
required
String
order ID - unique for a given ID
status
required
String
order status : "completed"
currency
required
Number
currency type example: "inr"
chainId
required
Number
block chain ID : example: "80001" for polygon testnet
customer
required
Object
created_at
required
String
created time
updated_at
required
String
updated time
tenantId
required
String
merchant Id
transactionId
required
String
unique transaction ID for payout.
tokensDeducted
required
Number
tokens deducted to create this order.
tds
required
Number
Tax Deducted at Source for this order.
eventType
required
String
onramp/offramp
source
required
String


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