Webhooks is an event-driven push notification system; when an event (e.g., a rebill) occurs, we deliver a data post to a script you designed based on our Webhook Documentation.
Webhooks is an alternative to our Background Post to URL feature and an add-on feature to our ENS system. The Webhooks system is much more robust, providing real-time notifications and covering more event types.
In general terminology, Webhooks is an API that sends real-time push notifications to Webhook endpoints.
Simply put, when something happens (an event) with your account, CCBill’s Webhooks will send a notification to your URL (Webhook endpoint), providing you valuable insight into your online business.
For Merchants, Webhooks is a way of receiving valuable information as soon as it happens, rather than checking your account’s data continually and getting no valuable data most of the time. In many ways, Webhooks is just like receiving push notifications on your smartphone, i.e., Facebook sends you a notification whenever you receive a friend request. Similarly, CCBill Webhooks will send you a notification if, for example, a new sale was successfully performed. You can write this data to a database for record-keeping or pass it to another script.
Webhooks are especially helpful for:
A Webhook is an HTTP POST operation that occurs when something happens (e.g., a sale). It’s like an inverted API endpoint; instead of making an API call, you can have information sent to your callback URL. You register a URL that we will notify you each time an account event occurs.
The diagram below exemplifies how CCBill Webhooks work:
As noted, an Event is some action regarding your account. Every push notification is sent as an XML data package, and your URL should be a script, such as CGI, PHP, ASP, etc, programmed to receive and parse the information posted by CCBill.
Webhooks Post Example
POST /webhooks.php?clientAccnum=999999&clientSubacc=9999&eventType=Expiration&eventGroupType=Subscription HTTP/1.1
X-Allowed-Satellites: PHX,ASH,AMS
Content-Type: application/x-www-form-urlencoded
Content-Length: 102
Host: merchanturl.com
User-Agent: Java/1.6.0_03
Via: 1.1 wmq1.ccbill.com:3129 (squid/2.7.STABLE5), 1.0 internal
Cache-Control: max-age=0
Connection: keep-alive
clientAccnum=999999&clientSubacc=9999&subscriptionId=0913024401000012340×tamp=2013-01-25 03:22:44
Webhooks notifications are outlined in the Webhooks Documentation.
Events included are:
If you encounter any issues setting up Webhooks, please contact Merchant Support, and a member of our team will assist you immediately.