Search
payment_subscriptions.search
Description
Search for user's subscription
staging: https://cs-m1.dvipdev.com/ production: https://cs-m1.dvipapp.com/ query: /api.json?cmd=payment_subscriptions.search&//input1//=some_value&//input2//=some_other_vaule
Input Parameters
Name | Type | Required | Description |
---|---|---|---|
string | No (at least 2*) | User's email address | |
username | string | No (at least 2*) | Username used to register with DatingVIP website |
ccname | string | No (at least 2*) | First name + Last name on credit card |
ccnum | string | No (at least 2*) | Last four digits of credit card number |
*Required are at least 2 parameters of above mentioned ones, except username+ccname
About search against username+ccnum
To perform search we must first find user by his username. Since we have 100+ systems with 100+ databases, full scale solution would require brute force over every single system(database), which is, obviously, too much. We discussed possible ways to make this happen somehow .. and since there are only partner websites(with merchant overrides) on m1 and a41(for now), we can make username+ccnum work on small number of systems - m1, a41 by default. As number of partner websites spreads over systems, at some point results will be incomplete. So, bottom line is, email is preferable, since there is no easy way to implement this kind of search that would completely support growth of partner websites across systems, but there are special cases - lower number of systems used - that are covered.
So, to allow at least some useful username+ccnum search in some cases, we have one more optional parameter, it is only relevant for username+ccnum.
Optional Input Parameters
Name | Type | Required | Description | Default value |
---|---|---|---|---|
systems | string | No(optional) | Comma separated list of systems on which to perform search against username | m1,a41 |
This parameter allows to define systems that will be used to search for user by username - if not passed defaults to m1,a41 - mainstream, porn2 - where partner websites(with merchant overrides) exist at the moment. Of course, if number of used systems grows over some max value, search will fail. When number of used systems grows, we can just add more systems to default, or execute api call with appropriate systems passed, but up to some reasonable number of systems.
Return
Returns array of subscription data grouped by it's status on DVIP, where status is:
Status | Description |
---|---|
-1 | Subscription is canceled - User is premium, at current cycle end won't be rebilled and will drop to free |
0 | Subscription is stopped - Subscriptions that expired |
1 | Subscription is active - User is premium, at current cycle end will be rebilled |
Subscription fields | ||||
---|---|---|---|---|
Name | Type | Description | Note | Important |
sub_id | int | Subscription ID | payment_subscription.edit | |
rebill_count | int | How many times subscription was rebilled | ||
status | string | DVIP Payment status | Don't mix this with subscription status on DVIP(-1,0,1) | |
next_rebill_amount | float | Amount to be used for next rebill only | ||
item_id | int | Item ID | payment_subscription.cancel | |
order_id | int | Order ID | ||
amount | float | Amount to be used for all rebills (except for next) | ||
trial_amount | float | Original trial amount | ||
trial_unit | string | Units of trial duration(month, day, etc.) | ||
trial_period | int | Number of units of trial duration | ||
rebill_unit | string | Units of rebill cycle(month, day, .etc) | ||
rebill_period | int | Number of units for rebill cycle duration | ||
max_rebill_count | int | How many times subscription will rebill | ||
description | string | What user paid and how much | ||
user_id | int | DVIP User ID | ||
transactions | array | Array of transactions data | Described in table bellow | |
username | string | Username | ||
site_domain | string | Domain of the DVIP website where user is registered | ||
site_name | string | Name of the DVIP website where user is registered | ||
system_id | string | DVIP System ID | payment_subscriptions.cancel payment_subscriptions.edit | |
descriptor | string | What credit card statement was billed as | ||
site_id | int | DVIP Website ID | ||
date_start | int | Timestamp of date subscription started | ||
date_stop | int | Timestamp of date subscription was stopped | Irrelevant for not stopped(0) subscriptions | |
date_cancel | int | Timestamp of date subscription was canceled | Irrelevant for active(1) subscriptions | |
date_rebill | int | Timestamp of date subscription will rebill, if status is active(1), Timestamp of date subscription will expire, if status is canceled(-1) | Irrelevant for stopped(0) subscriptions |
Transaction fields | ||
---|---|---|
Name | Type | Description |
tran_id | int | Transaction ID |
transaction_type | int | Transaction Type ('S' for sale, 'A' for auth, 'R' for refund) |
amount | float | Transaction Amount |
currency | string | Transaction currency |
description | string | Transaction Description |
status | string | Status (successful|failed|init) |
refunded_tran_id | int | Refunded transaction ID (if transaction is refund) |
refunded | int | Is transaction refunded |
refunded_amount | float | Refunded Amount |
ccnum | string | Credit Card Number |
ccname | string | Credit Card Name |
ccxpdate | string | Credit Card Expired Date |
cctype | string | Credit Card Type (I.e. visa) |
cccountry | string | Credit Card Country |
processor | string | Payment Processor short name (NB, RG ...) |
processor_name | string | Payment Processor full name (NetBilling, Rocket Gate, ...) |
date | string | Transaction Date (unix timestamp) |
Usage Example
example url:
/api.json?cmd=payment_subscriptions.search&email=knotiaw71@yahoo.com&ccnum=0474 /api.json?cmd=payment_subscriptions.search&email=knotiaw71@yahoo.com&ccname=Knotia Wilson
example of subscription found:
{ "meta": { "status": "OK" }, "result": { "data": { "1": [ { "sub_id": "1267827", "rebill_count": 1, "status": "rebill", "next_rebill_amount": "29.99", "item_id": "2671757", "order_id": "2635889", "amount": "29.99", "trial_amount": "4.99", "trial_unit": "day", "trial_period": "5", "rebill_unit": "month", "rebill_period": "1", "max_rebill_count": "-1", "description": "$4.99 5 day trial rebills at $29.99\/month", "user_id": "7967584", "transactions": [ { "tran_id": "6675677", "amount": "29.99", "currency": "USD", "status": "successful", "refunded_tran_id": "0", "refunded": 0, "refunded_amount": 0, "ccnum": "474472xxxxxx0474", "ccname": "Knotia Wilson", "ccxpdate": "2019-05-01", "cctype": "visa", "cccountry": "US", "processor": "RG", "processor_name": "RocketGate" }, { "tran_id": "6639402", "amount": "29.99", "currency": "USD", "status": "failed", "refunded_tran_id": "0", "refunded": 0, "refunded_amount": 0, "ccnum": "474472xxxxxx0474", "ccname": "Knotia Wilson", "ccxpdate": "2019-05-01", "cctype": "visa", "cccountry": "US", "processor": "RG", "processor_name": "RocketGate" }, { "tran_id": "6596588", "amount": "4.99", "currency": "USD", "status": "successful", "refunded_tran_id": "0", "refunded": 0, "refunded_amount": 0, "ccnum": "474472xxxxxx0474", "ccname": "Knotia Wilson", "ccxpdate": "2019-05-01", "cctype": "visa", "cccountry": "US", "processor": "RG", "processor_name": "RocketGate" } ], "username": "knotiaw71", "site_domain": "www.bbwtoday.com", "site_name": "BBW Today", "system_id": "m1", "descriptor": "DATINGCUSTSERV.COM 866-294-5787", "site_id": "5017", "date_start": "1459301206", "date_stop": "", "date_cancel": "", "date_rebill": "1462325204" } ] }, "id": 0 } }
example of failure response:
{ "meta": { "errors": [ { "code": "sub_not_found", "params": null, "sticky": false, "text": "No subscription found" } ], "status": "ERROR" }, "result": { "data": false, "id": 0 } }
- Last Author
- boris
- Last Edited
- Jan 6 2017, 08:34