This is a way SwitchWallet Notifies our Merchants of deposits being made to the wallet addresses They generated, Thus: ("Alert" in our Traditional Fiat Banking system).
Merchants are to provide this "Responds Url" to send this webhooks
So to "Add" or "Update" your webhooks Url
Here is a sample
PUT BaseUrl/api/v1/merchant/remittancewebhook
PUT
BaseUrl/api/v1/merchant/remittancewebhook
webHookUrl
String
https://yoursite.com/webhook
publicKey
Your PublicKey
``` PUT /api/v1/merchant/remittancewebhook HTTP/1.1 Host: testnet.switchwallet.io Authorization: ApiKey 5128620015083006430 Content-Type: application/json Content-Length: 93 { "webHookUrl": "http://webhook.site", "publicKey": "Your publicKey" } ```
var myHeaders = new Headers(); myHeaders.append("Authorization", "ApiKey 5128620015083006430"); myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify({ "webHookUrl": "http://webhook.site", "publicKey": "Your publicKey" }); var requestOptions = { method: 'PUT', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("https://testnet.switchwallet.io/api/v1/merchant/remittancewebhook", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));
After updating your Webhook Url, SwitchWallet sends the following webhooks
Deposit Webhook
Withdrawal Webhook
Remittance Webhook
1) Currency
2) Network
3) TransactionStatus
4) TransactionTypeEnum
Click on Currency and Network above to view their schema
ABOUT_TO_INITIATE
1
PENDING
2
CONFIRMED
3
FAILED
4
NOT_PROPAGATED
5
DEPOSIT
WITHDRAW
TRANSFER
MERCHANT_DEPOSIT
REMITTANCE
Last updated 2 years ago