Version 3 vs 4
Version 3 vs 4
Content Changes
Content Changes
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 [[public/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>
<tr><td>cancel_reason</td><td>string</td><td>Optional, not always sent. If it has value 'cancel_reason_rebill_bin_filter' it means that subscription was stopped because BIN used for purchase is not allowed to rebill.</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>
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 [[public/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>
<tr><td>cancel_reason</td><td>string</td><td>Optional, not always sent. If it has value 'cancel_reason_rebill_bin_filter' it means that subscription was stopped because BIN used for purchase is not allowed to rebill.</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>
=== subscriptions.prerebill ===
(WIP) Sent from cron job that runs at 1h frequency.
Data consists of subscriptions that are due to rebill in next X days, where X is configurable from cron manager.
(one value of X per one cron job instance)
Data array (json encoded)
<table>
<tr>
<th>Param Name</th><th>Type</th><th>Description</th>
</tr>
<tr><td>interval</td><td>string</td><td>When from now should rebill happen ('2 day', '3 day', 'X day')</td></tr>
<tr><td>subscriptions</td><td>array</td><td>Array of data related to subscriptions rebills (see below)</td></tr>
</table>
Subscriptions 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>next_rebill_ts</td><td>int</td><td>Next rebill timestamp</td></tr>
<tr><td>ptnr_id</td><td>int</td><td>Partner ID</td></tr>
<tr><td>tracking_user</td><td>int</td><td>User ID on partners' site</td></tr>
<tr><td>tracking_tag</td><td>int</td><td>Tracking Tag param</td></tr>
<tr><td>bin</td><td>string</td><td>BIN of card for this susbcription</td></tr>
<tr><td>ccnum_last4</td><td>string</td><td>Last 4 digits of card for this susbcription</td></tr>
<tr><td>currency</td><td>string</td><td>Currency</td></tr>
<tr><td>order_type</td><td>string</td><td>Order type ('basic' | 'xsale')</td></tr>
<tr><td>item_id</td><td>int</td><td>Item ID</td></tr>
<tr><td>cc_type</td><td>string</td><td>Card type ('visa' ...)</td></tr>
<tr><td>pp_name</td><td>string</td><td>PP Name</td></tr>
<tr><td>bin_high_risk</td><td>int</td><td>Is BIN on High Risk List (1|0)</td></tr>
<tr><td>bin_blocked_for_rebill</td><td>int</td><td>Is BIN blocked for rebill (1|0)</td></tr>
</table>
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 [[public/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>
<tr><td>cancel_reason</td><td>string</td><td>Optional, not always sent. If it has value 'cancel_reason_rebill_bin_filter' it means that subscription was stopped because BIN used for purchase is not allowed to rebill.</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>
=== subscriptions.prerebill ===
(WIP) Sent from cron job that runs at 1h frequency.
Data consists of subscriptions that are due to rebill in next X days, where X is configurable from cron manager.
(one value of X per one cron job instance)
Data array (json encoded)
<table>
<tr>
<th>Param Name</th><th>Type</th><th>Description</th>
</tr>
<tr><td>interval</td><td>string</td><td>When from now should rebill happen ('2 day', '3 day', 'X day')</td></tr>
<tr><td>subscriptions</td><td>array</td><td>Array of data related to subscriptions rebills (see below)</td></tr>
</table>
Subscriptions 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>next_rebill_ts</td><td>int</td><td>Next rebill timestamp</td></tr>
<tr><td>ptnr_id</td><td>int</td><td>Partner ID</td></tr>
<tr><td>tracking_user</td><td>int</td><td>User ID on partners' site</td></tr>
<tr><td>tracking_tag</td><td>int</td><td>Tracking Tag param</td></tr>
<tr><td>bin</td><td>string</td><td>BIN of card for this susbcription</td></tr>
<tr><td>ccnum_last4</td><td>string</td><td>Last 4 digits of card for this susbcription</td></tr>
<tr><td>currency</td><td>string</td><td>Currency</td></tr>
<tr><td>order_type</td><td>string</td><td>Order type ('basic' | 'xsale')</td></tr>
<tr><td>item_id</td><td>int</td><td>Item ID</td></tr>
<tr><td>cc_type</td><td>string</td><td>Card type ('visa' ...)</td></tr>
<tr><td>pp_name</td><td>string</td><td>PP Name</td></tr>
<tr><td>bin_high_risk</td><td>int</td><td>Is BIN on High Risk List (1|0)</td></tr>
<tr><td>bin_blocked_for_rebill</td><td>int</td><td>Is BIN blocked for rebill (1|0)</td></tr>
</table>