Floowie - API

API Structure

Floowie API requests are done to an url http://www.floowie.com/api with HTTP GET parameters. There are 3 basic mandatory parameters for every request. For other parameters please see appropriate request documentation. Parameters don't have mandatory order.

key value
apikey *  contains your API key
action *  defines an action for the request
hash *  contains a security verification for the request, the process of creation is described below

* - mandatory fields

Creating hash 

Hash is a md5 checksum of all of the GET parameters of the URL (everything that follows after "?"), with the exception of the hash parameter itself, appended to the private key.

Hiding user e-mail 

E-mail is a sensitive data of user, and thus has to be kept in secret. All email parameters are required to be encrypted with your Private Key. There's a PHP function for encoding:

function encodeEmail( $email, $privateKey )
	$j = 0;
	$hash = '';
	$privateKey = sha1($privateKey);
	$strLen = strlen($email);
	$keyLen = strlen($privateKey);
	for ($i = 0; $i < $strLen; $i++) {
		$ordStr = ord(substr($email,$i,1));
		if ($j == $keyLen) { $j = 0; }
		$ordKey = ord(substr($privateKey,$j,1));
		$hash .= strrev(base_convert(dechex($ordStr + $ordKey),16,36));
	return $hash;


Let's assume the following keys:

Private key: abcdefghijklmnopqrstuwvxyz123456

An e-mail "user@host.com" will be encrypted into z5l474v5k4b4v5o416o274s5j4, thus the request parameters may look as follows:

email : z5l474v5k4b4v5o416o274s5j4
format : php
action : prepaidOrder
title : 10
amounttype : 0
amount : 5
date : 978303600

the hash will be calculated as (in terms of PHP):


which is


and can be inserted anywhere within the parameters of the URL



The API supports 4 output formats: PHP, json, plain, csv and XML. Default output format is json, but it can be overridden by paramater format in the request. Data in plain format are separated by tab character (\t) and a newline (\n)

key value
lang  language of output and e-mails sent to the user
possible values: en, sk, cs; default: en
format  specifies output format of the data. Possible values: xml, php, json, plain, csv


json PHP XML plain csv
 [key1] => data1
 [key2] => data2


key1	data1
key2 data2


If not stated otherwise, the output is either an error code (key 'error') with an error message (key 'message') or a value 'OK' with a key of the action requested.

 [order] => OK

 [error] => 100
 [message] => "Error message"