Subscriptions & webhooks

Today we are announcing a new webhook subscription service which is more robust & fault tolerant.

Sankaet Pathak
Nov 10, 2015 · 3 min read

Today we are announcing a new webhook service that we have been working on.

Quite a few of our existing customers wanted a way to receive updates on not just transactions but also on nodes and users. Others have asked for a more robust webhook service that is more fault tolerant than our current one.

So keeping both in mind today, we are introducing a new webhook service that does three things well:

  1. Robust subscriptions.
  2. More fault tolerant.
  3. Logging.

Robust subscriptions

The new subscriptions lets developers subscribe to all 3 objects: Users, Nodes & Transactions.

On top of that, you can even fine tune the types of updates you wish to receive. For instance, if you just want notifications when a user is created with your gateway credentials, you can just subscribe to that.

Creating a subscription is easy. It just requires a POST to /api/v3/subscription/add in CORE V3, or a POST to /api/3/subscriptions in REST.

Example of a CORE V3 request:

curl -X POST -H "Content-Type: application/json" -d '{
"client":{
"client_id":"e3f19e4bd4022c86e7f2",
"client_secret":"11c94ba6bad74d24a0158bc707f0fc19a86dc08f"
},
"url":"http://requestb.in/15k15qr1",
"scope":[
"USERS|POST",
"NODES|POST",
"TRANS|POST"
]
}' 'https://sandbox.synapsepay.com/api/v3/subscription/add'

Example of a REST V3 request:

curl -X POST -H "Content-Type: application/json" -H "X-SP-GATEWAY: e3f19e4bd4022c86e7f2|11c94ba6bad74d24a0158bc707f0fc19a86dc08f" -H "X-SP-PROD: NO" -H "X-SP-LANG: EN" -d '{
"url":"http://requestb.in/15k15qr1",
"scope":[
"USERS|POST",
"NODES|POST",
"TRANS|POST"
]
}' 'https://sandbox.synapsepay.com/api/3/subscriptions'

The subscription syntax is very simple. It works the following way:

You can also provide scope for specific objects as well. More details regarding the syntax are right here in the API docs.

Fault Tolerant

The new webhook service is much more robust than before. If for some reason we fail to deliver a webhook to you, we will continue trying to send the request every 10 minutes until we are successful in delivering the webhook,for up to 24 hours since its origination.

This gives you enough time to be notified if your webhook receiver is down, and you can get it up and running without missing out on updates from us.

Logging

We are also adding logging for every webhook. Regardless of whether it succeeds or fails, you will be able to access the request, response and the status of the webhooks right from your dashboard.

With the new subscription service, we anticipate developers being able to build applications that are always in sync with their data. From KYC updates, node balance updates and also transaction updates.

As always, we constantly work hard to make SynapsePay the best payments network for you. In the coming weeks we will announce more exciting updates, so stay tuned!

Synapse

Operating System For Modern Banking

Thanks to SynapsePay

Sankaet Pathak

Written by

Founder and CEO @synapsefi

Synapse

Synapse

Operating System For Modern Banking

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade