Webhooks & Notifications

Introduction

Webhooks allow your application to receive real-time updates about payment statuses from Resmic Pro. This ensures that you are notified immediately when a payment is completed, pending, or failed. You can either provide an endpoint to receive webhook notifications or opt for email updates (not recommended for real-time processing).

Configuring Webhooks

To receive automatic updates, configure a webhook endpoint in your Resmic Pro dashboard:

  1. Just append the web_hook url while initiating the payment session

Whenever a payment status is updated, Resmic Pro will send a POST request to the configured URL.

You will required Webhook secret to verify the data you received is correct.

To generate the webhook secret visit: https://dashboard.resmic.com/developer

Example Server Webhook Response

{
    session_id,
    amount, 
    blockchain, 
    token,
    from_wallet_address,
    transaction_hash,
    txTime,
    status:true
}   

If you prefer, you can opt to receive payment updates via email instead of webhooks.

To enable email notifications:

Just add email address at the webhook_url while initiating the payment

Whenever a payment status is updated, you will receive an email notification containing the payment details.

Handling Webhook Notifications

When you receive a webhook notification, your server should:

  1. Parse the JSON payload.

  2. Verify the session_id and status fields.

  3. Update your database accordingly.

  4. Respond with a 200 OK to acknowledge receipt.

E.g. Success Payment response

`req.body`

Failed Payment response

`req.body`

Sample Webhook endpoint

Conclusion

By configuring webhooks, you can automatically track payment updates in real-time. If webhooks are not an option, email notifications can serve as an alternative.

Last updated