Developer Guide

Subscribe Plan

Subscribe user to a plan.

You need to register for a Reseller API key before using this REST API. Please visit Reseller Program page for the information of reseller account application.

Request

POST  http://api.fraudlabspro.com/v1/plan/subscribe
Parameter Description
key (required) Your reseller API key.
format (optional) Return the result in json or xml format. Default: xml
Valid values: json | xml
username (required) Username of the account.
plan (required) Plan code for the plan.
Valid values: MICRO | SMALL | MEDIUM | LARGE | ENTERPRISE

Only MICRO plan is accepted at this moment.

Response

Parameter Description
fraudlabspro_error Error code in this transaction.
fraudlabspro_message More information about the status of this transaction.
api_key API key for the plan subscribed.
plan_name Plan name for the plan subscribed.
query_limit Total query available for the plan subscribed.
rule_limit Maximum rules can be added to the plan.

Sample Codes

require_once 'lib/FraudLabsPro.php';

// Configures FraudLabs Pro Reseller key
FraudLabsPro\Configuration::resellerKey('YOUR_RESELLER_KEY');

// Subscribe to Micro plan
FraudLabsPro\Account::subscribe([
	'username'	=> $result->username,
	// Please refer to reference section for full list of plans
	'plan'		=> FraudLabsPro\Account::MICRO_PLAN,
]);
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

public class FLP {
	public static void main(String[] args) {
		try {

		URL url = new URL("https://api.fraudlabspro.com/v1/plan/subscribe?key=Your_Reseller_API_Key&format=json&username=demoaccount&plan=MICRO");
		HttpURLConnection conn = (HttpURLConnection) url.openConnection();
		conn.setRequestMethod("GET");
		conn.setRequestProperty("Accept", "application/json");

		if (conn.getResponseCode() != 200) {
			throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode());
		}

		BufferedReader br = new BufferedReader(new InputStreamReader(
			(conn.getInputStream())));

		String output;

		while ((output = br.readLine()) != null) {
			System.out.println(output);
		}

		conn.disconnect();

	  } catch (MalformedURLException e) {

		e.printStackTrace();

	  } catch (IOException e) {
		e.printStackTrace();
	  }
	}
}
Imports System.Net
Partial Public Class _Default
	Inherits System.Web.UI.Page

	Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
		Dim request As HttpWebRequest = Nothing
		Dim response As Net.HttpWebResponse = Nothing
		Dim stream As IO.Stream = Nothing

		Dim apiKey As String = "Your_Reseller_API_Key"
		Dim format As String = "json"
		Dim username As String = "demoaccount"
		Dim plan As String = "MICRO"

		request = Net.WebRequest.Create("https://api.fraudlabspro.com/v1/plan/subscribe?key=" & apiKey & _
		"&format=" & System.Web.HttpUtility.UrlEncode(format) & _
		"&username=" & System.Web.HttpUtility.UrlEncode(username) & _
		"&plan=" & System.Web.HttpUtility.UrlEncode(plan)

		request.Method = "GET"
		response = request.GetResponse()

		Dim reader As System.IO.StreamReader = New IO.StreamReader(response.GetResponseStream())

		Page.Response.Write(reader.ReadToEnd)
	End Sub
End Class
using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Net;

public partial class _Default : System.Web.UI.Page
{

	protected void Page_Load(object sender, System.EventArgs e)
	{
		HttpWebRequest request = null;
		System.Net.HttpWebResponse response = null;
		System.IO.Stream stream = null;

		string apiKey = "";
		string format = "json";
		string username = "demoaccount";
		string plan = "MICRO";

		request = System.Net.WebRequest.Create("https://api.fraudlabspro.com/v1/plan/subscribe?key=" + apiKey + "&format=" + System.Web.HttpUtility.UrlEncode(format) + "&username=" + System.Web.HttpUtility.UrlEncode(username) + "&plan=" + System.Web.HttpUtility.UrlEncode(plan));

		request.Method = "GET";
		response = request.GetResponse();

		System.IO.StreamReader reader = new System.IO.StreamReader(response.GetResponseStream());

		Page.Response.Write(reader.ReadToEnd());
	}
}
import httplib
import urllib

p = { 'key': 'Your_Reseller_API_Key', 'format': 'json', 'username': 'demoaccount', 'plan': 'MICRO' }

conn = httplib.HTTPConnection("api.fraudlabspro.com")
conn.request("GET", "/v1/plan/subscribe?" + urllib.urlencode(p))
res = conn.getresponse()
print res.read()
$ curl http://api.fraudlabspro.com/v1/account/create -X POST \
	-d "key=Enter_License_Key" \
	-d "format=json" \
	-d "username=demoaccount" \
	-d "plan=MICRO"