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 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 β¬οΈ let hmac = crypto createhmac('sha256', apisecret); hmac update(json stringify(postbody)); let hash = hmac digest('hex'); assert(hash == headers\["x onmeta signature"]) 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 { "fiat" 100, "senderwalletaddress" "0x12e217bf293b242r1r1414fcw42g1", "selltokensymbol" "matic", "selltokenaddress" "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "orderid" "63c51a9e598f1f0fabbe8fbc", "status" "completed", "currency" "inr", "source" "", "chainid" 80001, "customer" { "id" "63c514c142e2ae343ed283ed", "name" "", "email" "test\@onmeta com", "phone" { "countrycode" "", "number" "" }, "created at" }, "created at" , "updated at" , "tenantid" "122345677", "transactionid" "s11fwknm931" "tokensdeducted" 1 22, "tds" 1, "eventtype" "offramp" } 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 pending this event is triggered when a user has initialised the order but crypto transfer is pending orderreceived this event is triggered when a user transfers crypto and the tokens are received by onmeta inprogress (optional) this event is triggered when the order is in progress on the blockchain while swapping tokens (in case of non base tokens) cryptoreceived when we successfully validate the crypto received from user we send this event payoutsuccess this event is triggered when the fiat amount is successfully deposited in the users bank account refunded this event is triggered when refund is successfully completed in case of amount/token mismatch example webhook request { "fiat" 100, "senderwalletaddress" "0xf12dcsdadefed2eeb4d0475de270447a92a481635caf4a", "selltokensymbol" "matic", "selltokenaddress" "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "chainid" 137, "orderid" "641c311afdsaddfwcd2768aa5e", "status" "payoutsuccess", "currency" "inr", "created at" "2023 03 23t10 59 38 494z", "updated at" "0001 01 01t00 00 00z", "source" "", "customer" { "id" "63b52390dsaddefsfefwfw25d377ae", "email" "documentation\@onmeta in", "phone" {}, "created at" "2023 01 04t06 58 24 968z" }, "tenantid" "", "transactionid" "trarefxxxxxxxxx", "tokensdeducted" 1051823 63, "tds" 1, "eventtype" "offramp", "metadata" {"submeta1" "metadata"} }