Receive real time notifications
Receive real time notifications for programs, transactions, merchants
Step 1 . Go to My Account >> Tools
Step 2 . Fill in the Postback Url and the Postback Password ( Postback Url must be a public url from your side which will be called by our platform every time when a program state is changed from joined to not_joined, when a transaction is recorded in our platform, when a merchant is manually suppressed or unsupressed)
Step 3 . Prepare your Postback Url to receive the data according with the following format we send for different type of notifications
Not Joined Notification
{
"notification_type":"not_joined",
"token":"97ef5cc129d8e2a804c081164d6150b5",
"notification_data":[{"program_id":"12345"},{"program_id":"23456"}]
}
Transaction Notification
{
"notification_type":"commission",
"token":"bc24d9b2d5b0dfddb6959a93bab2c021",
"notification_data":{
"program_id":11,
"status":"pending",
"statistics_date":"2015-01-01 23:56:01",
"click_date":"2015-01-01 23:56:01",
"tracking_id":"fre234DD23",
"user_member_id":"23",
"sales":245.2,
"commission_confirmed":0,
"commission_unconfirmed":2,
"currency_id":1
"source_id":0,
"action":"2"}
}
Manually Supress Notification
{
"notification_type":"suppress_add",
"token":"97ef5cc129d8e2a804c081164d6150b5",
"notification_data":[18427,43798,42545]
}
Manually Unsupress Notification
{
"notification_type":"suppress_remove",
"token":"97ef5cc129d8e2a804c081164d6150b5",
"notification_data":[18427,43798,42545]
}
The data is json encoded and sent through the POST method using parameter "notification"
<?php
$notification = (isset($_POST['notification']) && $_POST['notification'] <> '') ? $_POST['notification'] : FALSE;
if ($notification)
{
$data = json_decode($notification);
if (json_last_error() == JSON_ERROR_NONE && $data->token == MD5(YOUR_PASSWORD))
{
print_r($data);
}
}
?>