PV2 is sending notifications to our partners regarding various actions on PV2. Notifications are always sent to the same URL defined for each partner along with hash and other related data. If partner doesn't respond to notification, PV2 will try to resend it.
Generally notifications will be sent in this format:
<table>
<tr>
<th>Param Name</th><th>Type</th><th>Description</th>
</tr>
<tr>
<td>command</td><td>string</td><td>The command that needs to be executed</td>
</tr>
<tr>
<td>hash</td><td>string</td><td>Hash</td>
</tr>
<tr>
<td>data</td><td>string</td><td>json encoded string with data array</td>
</tr>
</table>
After receiving notification partner should respond with [[projects/payment/partners/apidocs/notifications.hash.validate|notifications.hash.validate]] api call by sending received hash back, otherwise notification will be resent with this schedulle:
# After 1 minute
# After 5 minutes
# After 15 minutes
# After 30 minutes
# After 30 minutes
notifications.hash.validate call also has another important purpose, so partners can validate if the notification actually came from us.
This is list of notifications which will be send out.
=== transaction.success ===
Sent in case of successful transaction.
Data array (json encoded)
<table>
<tr>
<th>Param Name</th><th>Type</th><th>Description</th>
</tr>
<tr><td>tran_id</td><td>int</td><td>Transaction ID</td></tr>
<tr><td>status</td><td>string</td><td>Transaction status</td></tr>
<tr><td>ccdt_id</td><td>int</td><td>ccdt ID</td></tr>
<tr><td>transaction_type</td><td>string</td><td>Transaction Type (S for Sale, A for Auth, R for refund)</td></tr>
<tr><td>payment_code</td><td>int</td><td>Payment Code (700 on success)</td></tr>
<tr><td>user_id</td><td>int</td><td>PV2 user ID</td></tr>
<tr><td>tracking_user</td><td>int</td><td>User ID on partners' site</td></tr>
<tr><td>ptnr_id</td><td>int</td><td>Partner ID</td></tr>
<tr><td>items</td><td>array</td><td>array of items</td></tr>
</table>
=== transaction.failed ===
Sent in case of failed transaction.
Data array (json encoded)
<table>
<tr>
<th>Param Name</th><th>Type</th><th>Description</th>
</tr>
<tr><td>tran_id</td><td>int</td><td>Transaction ID</td></tr>
<tr><td>status</td><td>string</td><td>Transaction status</td></tr>
<tr><td>ccdt_id</td><td>int</td><td>ccdt ID</td></tr>
<tr><td>transaction_type</td><td>string</td><td>Transaction Type (S for Sale, A for Auth, R for refund)</td></tr>
<tr><td>payment_code</td><td>int</td><td>Payment Code</td></tr>
<tr><td>user_id</td><td>int</td><td>PV2 user ID</td></tr>
<tr><td>tracking_user</td><td>int</td><td>User ID on partners' site</td></tr>
<tr><td>ptnr_id</td><td>int</td><td>Partner ID</td></tr>
<tr><td>items</td><td>array</td><td>array of items</td></tr>
</table>
=== subscription.created ===
Sent in case of successfully created subscription
Data array (json encoded)
<table>
<tr>
<th>Param Name</th><th>Type</th><th>Description</th>
</tr>
<tr><td>sub_id</td><td>int</td><td>Subscription ID</td></tr>
<tr><td>item_id</td><td>int</td><td>Item ID</td></tr>
<tr><td>status</td><td>string</td><td>Subscription status (s/b initial on create, rebill after 1st rebill)</td></tr>
<tr><td>start_ts</td><td>int</td><td>Start timestamp</td></tr>
<tr><td>user_id</td><td>int</td><td>PV2 user ID</td></tr>
<tr><td>tracking_user</td><td>int</td><td>User ID on partners' site</td></tr>
<tr><td>ptnr_id</td><td>int</td><td>Partner ID</td></tr>
<tr><td>tracking_tag</td><td>int</td><td>Tracking Tag param</td></tr>
<tr><td>currency</td><td>string</td><td>Currency</td></tr>
<tr><td>hash</td><td>string</td><td>Hash</td></tr>
<tr><td>pp_name</td><td>string</td><td>PP Name</td></tr>
<tr><td>trial_unit</td><td>string</td><td>Trial Unit (day|week|month|year)</td></tr>
<tr><td>trial_period</td><td>int</td><td>Trial period</td></tr>
<tr><td>rebill_unit</td><td>string</td><td>Rebill Unit (day|week|month|year)</td></tr>
<tr><td>rebill_period</td><td>int</td><td>Rebill period</td></tr>
<tr><td>max_rebill_count</td><td>int</td><td>Max Rebill Count</td></tr>
<tr><td>tracking_item</td><td>int</td><td>Tracking item ID</td></tr>
<tr><td>next_rebill_ts</td><td>int</td><td>Next rebill ts</td></tr>
<tr><td>last_rebill_ts</td><td>int</td><td>Last rebill ts</td></tr>
</table>
=== subscription.trial ===
Sent in case of successfully created subscription
Data array (json encoded)
<table>
<tr>
<th>Param Name</th><th>Type</th><th>Description</th>
</tr>
<tr><td>sub_id</td><td>int</td><td>Subscription ID</td></tr>
<tr><td>item_id</td><td>int</td><td>Item ID</td></tr>
<tr><td>status</td><td>string</td><td>Subscription status (s/b initial on create, rebill after 1st rebill)</td></tr>
<tr><td>start_ts</td><td>int</td><td>Start timestamp</td></tr>
<tr><td>user_id</td><td>int</td><td>PV2 user ID</td></tr>
<tr><td>tracking_user</td><td>int</td><td>User ID on partners' site</td></tr>
<tr><td>ptnr_id</td><td>int</td><td>Partner ID</td></tr>
<tr><td>tracking_tag</td><td>int</td><td>Tracking Tag param</td></tr>
<tr><td>currency</td><td>string</td><td>Currency</td></tr>
<tr><td>hash</td><td>string</td><td>Hash</td></tr>
<tr><td>pp_name</td><td>string</td><td>PP Name</td></tr>
<tr><td>trial_unit</td><td>string</td><td>Trial Unit (day|week|month|year)</td></tr>
<tr><td>trial_period</td><td>int</td><td>Trial period</td></tr>
<tr><td>rebill_unit</td><td>string</td><td>Rebill Unit (day|week|month|year)</td></tr>
<tr><td>rebill_period</td><td>int</td><td>Rebill period</td></tr>
<tr><td>max_rebill_count</td><td>int</td><td>Max Rebill Count</td></tr>
<tr><td>tracking_item</td><td>int</td><td>Tracking item ID</td></tr>
<tr><td>next_rebill_ts</td><td>int</td><td>Next rebill ts</td></tr>
<tr><td>last_rebill_ts</td><td>int</td><td>Last rebill ts</td></tr>
</table>
=== subscription.stopped ===
Sent in case of stopped subscription (action initiated via api call)
Data array (json encoded)
<table>
<tr>
<th>Param Name</th><th>Type</th><th>Description</th>
</tr>
<tr><td>sub_id</td><td>int</td><td>Subscription ID</td></tr>
<tr><td>item_id</td><td>int</td><td>Item ID</td></tr>
<tr><td>status</td><td>string</td><td>Subscription status (s/b initial on create, rebill after 1st rebill)</td></tr>
<tr><td>start_ts</td><td>int</td><td>Start timestamp</td></tr>
<tr><td>user_id</td><td>int</td><td>PV2 user ID</td></tr>
<tr><td>tracking_user</td><td>int</td><td>User ID on partners' site</td></tr>
<tr><td>ptnr_id</td><td>int</td><td>Partner ID</td></tr>
<tr><td>tracking_tag</td><td>int</td><td>Tracking Tag param</td></tr>
<tr><td>currency</td><td>string</td><td>Currency</td></tr>
<tr><td>hash</td><td>string</td><td>Hash</td></tr>
<tr><td>pp_name</td><td>string</td><td>PP Name</td></tr>
<tr><td>trial_unit</td><td>string</td><td>Trial Unit (day|week|month|year)</td></tr>
<tr><td>trial_period</td><td>int</td><td>Trial period</td></tr>
<tr><td>rebill_unit</td><td>string</td><td>Rebill Unit (day|week|month|year)</td></tr>
<tr><td>rebill_period</td><td>int</td><td>Rebill period</td></tr>
<tr><td>max_rebill_count</td><td>int</td><td>Max Rebill Count</td></tr>
<tr><td>tracking_item</td><td>int</td><td>Tracking item ID</td></tr>
<tr><td>next_rebill_ts</td><td>int</td><td>Next rebill ts</td></tr>
<tr><td>last_rebill_ts</td><td>int</td><td>Last rebill ts</td></tr>
<tr><td>is_cancel</td><td>boolean</td><td>s/b true</td></tr>
</table>
=== subscription.suspended ===
Sent in case of suspended subscription (usually happens when we can't rebill user after defined number of attempts)
Data array (json encoded)
<table>
<tr>
<th>Param Name</th><th>Type</th><th>Description</th>
</tr>
<tr><td>sub_id</td><td>int</td><td>Subscription ID</td></tr>
<tr><td>item_id</td><td>int</td><td>Item ID</td></tr>
<tr><td>status</td><td>string</td><td>Subscription status (s/b initial on create, rebill after 1st rebill)</td></tr>
<tr><td>start_ts</td><td>int</td><td>Start timestamp</td></tr>
<tr><td>user_id</td><td>int</td><td>PV2 user ID</td></tr>
<tr><td>tracking_user</td><td>int</td><td>User ID on partners' site</td></tr>
<tr><td>ptnr_id</td><td>int</td><td>Partner ID</td></tr>
<tr><td>tracking_tag</td><td>int</td><td>Tracking Tag param</td></tr>
<tr><td>currency</td><td>string</td><td>Currency</td></tr>
<tr><td>hash</td><td>string</td><td>Hash</td></tr>
<tr><td>pp_name</td><td>string</td><td>PP Name</td></tr>
<tr><td>trial_unit</td><td>string</td><td>Trial Unit (day|week|month|year)</td></tr>
<tr><td>trial_period</td><td>int</td><td>Trial period</td></tr>
<tr><td>rebill_unit</td><td>string</td><td>Rebill Unit (day|week|month|year)</td></tr>
<tr><td>rebill_period</td><td>int</td><td>Rebill period</td></tr>
<tr><td>max_rebill_count</td><td>int</td><td>Max Rebill Count</td></tr>
<tr><td>tracking_item</td><td>int</td><td>Tracking item ID</td></tr>
<tr><td>next_rebill_ts</td><td>int</td><td>Next rebill ts</td></tr>
<tr><td>last_rebill_ts</td><td>int</td><td>Last rebill ts</td></tr>
</table>
=== subscription.rebill ===
Sent after successfully made rebill. It will be sent right after transaction.success
Data array (json encoded)
<table>
<tr>
<th>Param Name</th><th>Type</th><th>Description</th>
</tr>
<tr><td>sub_id</td><td>int</td><td>Subscription ID</td></tr>
<tr><td>item_id</td><td>int</td><td>Item ID</td></tr>
<tr><td>status</td><td>string</td><td>Subscription status (s/b initial on create, rebill after 1st rebill)</td></tr>
<tr><td>start_ts</td><td>int</td><td>Start timestamp</td></tr>
<tr><td>user_id</td><td>int</td><td>PV2 user ID</td></tr>
<tr><td>tracking_user</td><td>int</td><td>User ID on partners' site</td></tr>
<tr><td>ptnr_id</td><td>int</td><td>Partner ID</td></tr>
<tr><td>tracking_tag</td><td>int</td><td>Tracking Tag param</td></tr>
<tr><td>currency</td><td>string</td><td>Currency</td></tr>
<tr><td>hash</td><td>string</td><td>Hash</td></tr>
<tr><td>pp_name</td><td>string</td><td>PP Name</td></tr>
<tr><td>trial_unit</td><td>string</td><td>Trial Unit (day|week|month|year)</td></tr>
<tr><td>trial_period</td><td>int</td><td>Trial period</td></tr>
<tr><td>rebill_unit</td><td>string</td><td>Rebill Unit (day|week|month|year)</td></tr>
<tr><td>rebill_period</td><td>int</td><td>Rebill period</td></tr>
<tr><td>max_rebill_count</td><td>int</td><td>Max Rebill Count</td></tr>
<tr><td>tracking_item</td><td>int</td><td>Tracking item ID</td></tr>
<tr><td>next_rebill_ts</td><td>int</td><td>Next rebill ts</td></tr>
<tr><td>last_rebill_ts</td><td>int</td><td>Last rebill ts</td></tr>
</table>
=== subscription.completed ===
Sent after completed subscription (happens only on subs with limited number of rebills).
Data array (json encoded)
<table>
<tr>
<th>Param Name</th><th>Type</th><th>Description</th>
</tr>
<tr><td>sub_id</td><td>int</td><td>Subscription ID</td></tr>
<tr><td>item_id</td><td>int</td><td>Item ID</td></tr>
<tr><td>status</td><td>string</td><td>Subscription status (s/b initial on create, rebill after 1st rebill)</td></tr>
<tr><td>start_ts</td><td>int</td><td>Start timestamp</td></tr>
<tr><td>user_id</td><td>int</td><td>PV2 user ID</td></tr>
<tr><td>tracking_user</td><td>int</td><td>User ID on partners' site</td></tr>
<tr><td>ptnr_id</td><td>int</td><td>Partner ID</td></tr>
<tr><td>tracking_tag</td><td>int</td><td>Tracking Tag param</td></tr>
<tr><td>currency</td><td>string</td><td>Currency</td></tr>
<tr><td>hash</td><td>string</td><td>Hash</td></tr>
<tr><td>pp_name</td><td>string</td><td>PP Name</td></tr>
<tr><td>trial_unit</td><td>string</td><td>Trial Unit (day|week|month|year)</td></tr>
<tr><td>trial_period</td><td>int</td><td>Trial period</td></tr>
<tr><td>rebill_unit</td><td>string</td><td>Rebill Unit (day|week|month|year)</td></tr>
<tr><td>rebill_period</td><td>int</td><td>Rebill period</td></tr>
<tr><td>max_rebill_count</td><td>int</td><td>Max Rebill Count</td></tr>
<tr><td>tracking_item</td><td>int</td><td>Tracking item ID</td></tr>
<tr><td>next_rebill_ts</td><td>int</td><td>Next rebill ts</td></tr>
<tr><td>last_rebill_ts</td><td>int</td><td>Last rebill ts</td></tr>
</table>