Page MenuHomeDatingVIP

subscription.list
Updated 1,130 Days AgoPublic

subscription.list

Description

Return List of subscriptions

Input Parameters
NameTypeRequiredDescription
pageIntNoPage
limitIntNoLimit to certain number of records (default 100)
order_fieldstringNoOrder by which field (default tran_id)
order_dirStringNo(asc|desc)
on_dateDateNoOn Date (YYYY-MM-DD)
from_dateDateNoFrom Date (YYYY-MM-DD)
to_dateDateNoTo date (YYYY-MM-DD)
from_idIntNoReturn only tran_id's greater than from_id
to_idIntNoReturn only tran_id's lesser than to_id
nameIntNoFirst/Last name string (i.e. John*) to get only those starting with that
emailIntNoEmail
ccnumStringNoCredit Card Number
hourIntNoFilter to specific hour (0-23). I.e. 8 will return only transactions between 8 and 9
typeStringNoTransaction Type (signup|rebill|refund)
nocacheIntNoWhether to get cached result (default is 0 and 1 should be used only for debugging purposes)
tracking_tagmixedNoTracking Tag (can be sent as int or as array so you send more at once
currencymixedNoCurrency (can be sent as String or as array so you send more at once)
tracking_usermixedNoTracking User (can be sent as Int or as array so you send more at once)
sub_idmixedNosub_id (can be sent as int or as array so you send more at once)
order_idmixedNoorder_id (can be sent as int or as array so you send more at once)
tran_idmixedNotran_id (can be sent as int or as array so you send more at once)
statusmixedNoTransaction Status (successful|failed|init) (can be sent as string or as array so you send more at once)
pp_typemixedNoPP Type (NB|RG|PO|...)(can be sent as string or as array so you send more at once)
item_idmixedNoItem ID (can be sent as Int or as array so you send more at once)
refunded_tran_idmixedNorefunded_tran_id (can be sent as Int or as array so you send more at once)
sub_ids(string)noComma separated list of requested sub_id
exclude(array)noComma 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

Event Timeline

boris moved this document from Unknown Object (Phriction Wiki Document).Mar 11 2015, 13:31
boris changed the visibility from "Public (No Login Required)" to "All Users".
boris changed the visibility from "All Users" to "Public (No Login Required)".
boris shifted this object from the Restricted Space space to the S6 Everyone space.Aug 8 2018, 08:24