subscription.list
subscription.list
Description
Return List of subscriptions
Input Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| page | Int | No | Page |
| limit | Int | No | Limit to certain number of records (default 100) |
| order_field | string | No | Order by which field (default tran_id) |
| order_dir | String | No | (asc|desc) |
| on_date | Date | No | On Date (YYYY-MM-DD) |
| from_date | Date | No | From Date (YYYY-MM-DD) |
| to_date | Date | No | To date (YYYY-MM-DD) |
| from_id | Int | No | Return only tran_id's greater than from_id |
| to_id | Int | No | Return only tran_id's lesser than to_id |
| name | Int | No | First/Last name string (i.e. John*) to get only those starting with that |
| Int | No | ||
| ccnum | String | No | Credit Card Number |
| hour | Int | No | Filter to specific hour (0-23). I.e. 8 will return only transactions between 8 and 9 |
| type | String | No | Transaction Type (signup|rebill|refund) |
| nocache | Int | No | Whether to get cached result (default is 0 and 1 should be used only for debugging purposes) |
| tracking_tag | mixed | No | Tracking Tag (can be sent as int or as array so you send more at once |
| currency | mixed | No | Currency (can be sent as String or as array so you send more at once) |
| tracking_user | mixed | No | Tracking User (can be sent as Int or as array so you send more at once) |
| sub_id | mixed | No | sub_id (can be sent as int or as array so you send more at once) |
| order_id | mixed | No | order_id (can be sent as int or as array so you send more at once) |
| tran_id | mixed | No | tran_id (can be sent as int or as array so you send more at once) |
| status | mixed | No | Transaction Status (successful|failed|init) (can be sent as string or as array so you send more at once) |
| pp_type | mixed | No | PP Type (NB|RG|PO|...)(can be sent as string or as array so you send more at once) |
| item_id | mixed | No | Item ID (can be sent as Int or as array so you send more at once) |
| refunded_tran_id | mixed | No | refunded_tran_id (can be sent as Int or as array so you send more at once) |
| sub_ids | (string) | no | Comma separated list of requested sub_id |
| exclude | (array) | no | Comma separated list of excluded sub_id(s) |
Return
array with data
Note:next_rebill_amount and next_rebill_shcedule will be empty shortly after transaction.finish (create) commands. They will contain data once subscription got scheduled by our background tasks to be re-billed
Subscriptions possible statuses list:
initial - new created subscription
trial - new created subscription with trial_amount defined
rebill - successfully re-billed subscription (can be re-activated)
manual - new with rebill_period = -1
changed - after subscription.change when sub status was different than 'stopped'
suspended - suspended by rebill script (few possible reasons)
stopped - cancelled by api call (or no recurring processor type like Dc24)
completed - when max_rebill_count reached (max rebills for item)
Usage Example
<?php $curl = new \Dinke\CurlHttpClient; //setup payment url and timeout $payment_url = 'https://dev-payment.datingvip.com/api.json'; $timeout = 30; $curl->setCredentials('some-token', 'some-pass'); $post_data = array( 'cmd' => 'subscription.list', 'data' => array('limit' => 1) ); $response = $curl->sendPostData($payment_url, $post_data, null, $timeout); if($response === false) { //handle errors } //decode json to get array $response = json_decode($response, true); var_dump($response);
Excepted output after running this script should be:
array (size=1)
'result' =>
array (size=8)
'code' => int 700
'status' => string 'Action completed succesfully' (length=28)
'command' => string 'subscription.list' (length=17)
'result' =>
array (size=1)
0 =>
array (size=48)
'sub_id' => string '258' (length=3)
'next_rebill_shcedule' => string '0' (length=1)
'rebill_count' => string '0' (length=1)
'status' => string 'trial' (length=5)
'date' => string '1429201466' (length=10)
'end_date' => string '0' (length=1)
'next_rebill_amount' => string '0.00' (length=4)
'item_id' => string '20544' (length=5)
'order_id' => string '545' (length=3)
'amount' => string '39.99' (length=5)
'trial_amount' => string '39.99' (length=5)
'trial_unit' => string 'day' (length=3)
'trial_period' => string '90' (length=2)
'rebill_unit' => string 'day' (length=3)
'rebill_period' => string '90' (length=2)
'max_rebill_count' => string '-1' (length=2)
'description' => string '3 месяца - $13.33USD/месяц||7882' (length=43)
'tracking_item' => string '0' (length=1)
'uprc_id' => string '0' (length=1)
'ptnr_id' => string '55' (length=2)
'user_id' => string '435' (length=3)
'pp_id' => string '6' (length=1)
'ppac_id' => string '109' (length=3)
'force_mid' => string '' (length=0)
'ccdt_id' => string '393' (length=3)
'tracking_order' => string '0' (length=1)
'tracking_tag' => string '512' (length=3)
'first_name' => string 'Nerty' (length=5)
'last_name' => string 'Ben' (length=3)
'street' => string '' (length=0)
'city' => string '' (length=0)
'state' => string 'dev' (length=3)
'zipcode' => string '10001' (length=5)
'country' => string 'US' (length=2)
'email' => string 'yuliapaid@gmail.com' (length=19)
'ip' => string '66.154.2.78' (length=11)
'host' => string '66.154.2.78' (length=11)
'currency' => string 'USD' (length=3)
'hash' => string '14292014665482f2015ee30f487cf670' (length=32)
'rebill_transaction_id' => string '1980' (length=4)
'order_status' => string 'completed' (length=9)
'ts' => string '1429201466' (length=10)
'type' => string 'basic' (length=5)
'step_down' => string '0' (length=1)
'tax_rate' => string '0.00' (length=4)
'tax_amount' => string '0.00' (length=4)
'tracking_user' => string '10166584' (length=8)
'processor' => string 'RG' (length=2)
'request' =>
array (size=4)
'cmd' => string 'subscription.list' (length=17)
'data' =>
array (size=1)
'limit' => string '1' (length=1)
'token' => string 'some-token' (length=26)
'pass' => string 'some-pass' (length=32)
'ts' => int 1429562553
'origin_ip' => string '93.87.220.184' (length=13)
'errors' => null- Last Author
- aplawecki
- Last Edited
- Mar 16 2021, 08:38