Thursday,  June  22,  2017   |   02:00 GMT

Here we will provide information about CRXzone merchant services and on how to start accepting payments in supported cryptocurrencies from the customers around a world.

Getting Started

With cryptocurrency, there's no sensitive client information to collect and store, and there are no cards to charge. Clients simply send cryptocurrency (for instance bitcoin) from their computer or mobile device directly to a so called payment address.

CRXzone make accepting cryptocurrency and in particular bitcoin payments very easy both from a financial and technical point of view. Once received, CRXzone can convert the cryptocurrency to your preferred currency and adds the full amount of the payment to your CRXzone account. Funds are then per your request can be withdrawn to your bank account or to one of the supported e-currencies.

Note: In order to use the CRXzone merchant services you need to create and verify your account.

CRXzone provide different options for integration. Choose a method below to get started.

  1. Payments via Invoices - suitable for ordinary purchase of any goods or services.
  2. Payments via Addresses - convenient to use to replenish any customer accounts.

We created simple wizard-drived forms and provided descriptions on every step, so integration is possible even for people who have no special programming skills. But experienced developers can get the most using our rich set of APIs.

You will find more details about integration in appropriate sections of this guide.

Accept Payments by Invoice

Our seller features allow merchants to invoice and receive payment for services and goods in no time flat.

Generate payment buttons for your website directly through your merchant profile. No code-wrangling required – just copy and embed into your page.

To create a link forwarding customers to a payment checkout, you will have to use our payment link generator. Alternatively, you can create links manually/dynamically, below we describe how.

A typical scenario of payment link usage

Your customers can pay with just a few mouse clicks. A typical payment routine is as follows.

  1. You place a payment link (or graphic button with one of the offered designs) for any of your goods or services on a page on your website.
  2. Your customer clicks on this link and is transferred to a payment processing page at CRXzone. This page can contain a logo and contact information of the merchant. All these details will be displayed at the top of the payment processing page, so customers can request support if they have problems or questions about the purchase.
  3. Once payment is complete, the customer returns to your website and lands on the page that you specify in the Success URL.

Creating payment links and buttons

Payment links can be created in two different ways, which we describe below.

Automated generation of payment links

Your site is up, but how are customers going to pay you? The CRXzone Generate Payment Link page is the fastest way to set up online payment on your website.

You will find this generator very handy if you only sell a few products or services.

When you create a link or button, CRXzone responds by generating code that you can paste into your web page or document.

CRXzone-generated code for a link would be as follows:

This example shows HTML code for displaying a button to sell an item named "Cookies":

Dynamic creation of payment links

If your website sells goods or services in large volumes or if your products are stored in a database with descriptions, prices, etc., you will need to be able to create purchase links dynamically, i.e. "on the fly".

These dynamically created payment links will look and work exactly like those created by the generator, however they are made with the help of API. We provide a detailed description of the purpose, default values, maximum length, etc. of these variables in an appropriate section.

Graphic Buttons

Below is a list of the payment buttons offered in different graphic layouts.

Variable Reference

When you create a payment link you must specify the same HTML variables that you use when generating via webform in your account profile.

The following table provides additional information about these variables.

Variable Required Type Max. length Description
Title Yes String 50 Name for the goods or services that you are selling.
Price Yes Float 16 Price for the goods or services that you are selling.
PriceCurrency Yes String 3 Price currency tht you wish to receive from buyer.
Merchant Yes Integer 16 Personal merchant ID given by CRXzone system.
ReferenceID No Integer 64 Additional merchant identifier in case if needed.
IPNURL No String 250 The URL to which CRXzone posts information about the transaction.
SuccessURL No String 250 The URL to which CRXzone re-direct user once the transaction is completed.

Accept Payments by Address

Accepting payment to an address is the easiest way to receive regular cryptocurrency payments from your customers. The only thing you need to do is to create a special payment address in your CRXzone profile and then give it to your customers. Each time client sends money to this address you will automatically receive them to your CRXzone account. Subsequently, these funds can be automatically converted to fiat currency depending on your merchant settings.

Hint: Each such address can correspond to some exact client, this way every payment will be guaranteed to be linked to the specific client.

Attention! Do not forget to tell your customers for what cryptocurrency exactly this address was created (bitcoin, litecoin, dogecoin, etc). Otherwise, the payment can go to a foreign address, and will not be returned!

To create a payment address, you will have to use Generate Payment Address form located in your CRXzone Profile.

A Typical Scenario of Payment Address Usage

A typical payment routine is as follows.

  1. You create a payment address with the usage of our generator tool.
  2. You provide that address to the buyer.
  3. Each time buyer sends funds to this address your account in CRXzone will be repleniched with money.

Created address is lifetime valid. In case if you don't need a specific address, you can easily delete it using CRXzone webform. Any user can use this functionality, and there is no limitations for the number of addresses generated for every user.

Using the Address Generator

Use the CRXzone Generate Payment Address form to create a payment address that can be used for receiving payments from your customers in a specific cryptocurrency. The generated address can be sent to your customer like any other cryptocurrency address so that he can make a usual transfer of bitcoin or litecoin, etc.

1. Access the address generator
  1. After logging in to CRXzone, select Profile, then click Payment Adresses under Merchant section.
  2. You will see a Generate Payment Address link that will open a special form for creating a cryptocurrency address.
2. Specify details for your payment address
  1. Enter title for the payment address.
  2. Choose cryptocurrency for the address.
  3. Enter Reference ID if needed.
3. Generate the address

Once you click the Generate button you will see the address that can be used for receiving payments. Generated address will be displayed in the list of all adresses that can be found via Payment Addresses link under Merchant section of your profile.

Publishing Cryptocurrency Addresses

Then you created your new cryptocurrency address you need to show it to your customers by publishing on your website or sending via email.

It is very important to inform your client about the cryptocurrency for which this address was created (i.e bitcoin, litecoin, or dogecoin, etc).

Attention! Be careful when specifying addresses to your clients. Sending money to a wrong cryptocurrency address or address belonging to a different cryptocurrency means loss of the money.

Receive Payments Sent to Cryptocurrency Address

Generated address works as a usual crypto wallet. You can send funds to it the same way as for usual cryptocurrency address, to withdraw funds use corresponding links in your CRXzone account.

Each time client sends money to one of the addresses created in your CRXzone account you will automatically receive them to your CRXzone balance. At the same time, you will receive automatic email message from CRXzone with payment parameters.

Note: You can set up your account so these funds can be automatically converted to the selected fiat currency - this is done in Currency Settings under Merchant section of your profile.

Manage Your Payment Addresses

All your CRXzone cryptocurrency payment addresses are accessible by clicking Payment Addresses link under Merchant section of your profile.

  • Editing Addresses - to edit the payment address details please select the corresponding address in the list and click on its title. Make the required changes and click Save.
  • Deleting Addresses - to delete the payment address please select the corresponding address in the list and click Delete link.

Attention! Once the address is deleted, this process can't be reversed.

Handling IPN Messages

The IPN service notifies you when an event occurs that pertains to a transaction. Typically, these events represent various kinds of payments.

IPN is a message service that CRXzone uses to notify you about events, such as:

  1. Instant payments;
  2. Pending payments.

You receive and process IPN messages with a listener (sometimes called a handler), which is a program that you write. This program waits for IPNs and (typically) passes them to an administrative process that responds appropriately. CRXzone provides sample code that you can modify to implement a listener that handles IPN messages.

These actions to take when your listener is notified of an event are application-specific. Here are some common actions that applications take in response to IPN messages:

  1. Trigger order fulfillment or enable media downloads;
  2. Update a list of customers;
  3. Update accounting records;
  4. Create specialised "to do" lists.

In addition to IPN messages, you are notified of events by e-mail. However, unlike e-mail, IPN messages let you automate responses to events.

IPN Handler Setup

To setup IPN handler you will have to login to your CRXzone account. Go to the Profile section and click the Payment Notifications link.

You will see 2 different types of notofocations that can be set.

  • Email Notification - when customer makes a purchase, CRXzone system sends you notification email to your address thta you can provide in the appropriate field. Once you will provide an email and agree to receive notifications by email. CRXzone will use that email fro sending you notifications.
  • Notification URL - when customer makes a purchase, CRXzone system sends you operation ID to the URL that you can post in the apropriate field below, which you can send back to receive details on each payment operation.

Implementing a Generic IPN Listener

You write your IPN listener in the scripting or programming language of your choice and host it on your web server. You can use the sample code provided by CRXzone as a starting point.

As a good programming practice, as well as to keep things simple, your IPN listener should listen for a post from CRXzone and dispatch it immediately to another routine or process that handles the business logic associated with the message. If your listener is structured in this way, it will be a simple and tight loop that listens for a message and dispatches it for processing by your application logic.

Hint: For additional security we suggest hiding your IPN handler file from third parties, e.g. place the script in a secret folder and/or use non-obvious file names, do not allow search engine robots to scan that folder to prevent abuse of your script and corresponding business logic, etc.

IPN Sample Code

Since IPN handlers can be used for several different purposes, the handler's implementation will also vary, so you should look at examples of each individual application in the corresponding section of Code Samples.

Using API Functions

API Key Setup

Before calling protected API functions you need to setup an API Key in your CRXzone profile in the API Keys section (except functions listed under Market Information, which are open for everyone).

Important! For security purposes you can create several API Keys, and each API key can be configured in such a way to allow access only to certain functions. For instance, for your automated trading script you may not enable access to functions in 'Funding section', so even if hackers compromise your server and get access to your API Key they will be unable to steal your money.

To create new API Key click on corresponding link on API Keys page. New page will be opened where you will need to specify a name for the API Key, and set a password. Also, you have to select the functions you plan to call using this API Key. Click Save to obtain API Key ID. It will be shown in Existing API Keys List under ID column. This API Key ID among with API Key Password will be required later for protected API functions call.

Authorization Scheme

Some of the API functions require a special signature which is generated from the values ​​of variables that are sent to the function and are sorted by variables name in ascending order + password API, separated by colons (:).

For example, if the function is being called with the following parameters:

Order_Create (
	APIID = 123456,
	signature = ‘b32602bdf44c5165b14a86a7592d2b88’,
	currencyPairID = 1,
	price = 50.12345000,
	amount = 20.50000000,
	type = 0
)

First, we will put all the names of function parameters in alphabetical order (Important!):

  • Amount (=20.5)
  • APIID (=123456)
  • currencyPairID (=1)
  • price (=50.12345000)
  • type (=0)

Assuming that your API Key Password is ‘AABBCC’ (from your account settings). Then we get the md5 hash of the following string:

signature = md5 (‘20.5:123456:1:50.12345:0:AABBCC’)

The result of the md5 function is:

signature = ‘b32602bdf44c5165b14a86a7592d2b88’

Now having filled signature variable you are ready to call protected function Order_Create as shown above.

Making API Request

Most API requests need an authentication. You can find out more on authentication in section above (see Authorization Scheme above).

All requests need to be sent to the following URL:
https://www.crxzone.com/API/Invoice_Create?APIID=12345&title=Invoice%20Title&reference=01TST99&invoiceCurrencyCode=USD&price=20.5&payerCurrencyCode=LTC&payerEmail=test@example.com&payerIP=127.0.0.1

Where: FunctionName — Name of called function
            ?APIID=12345&title=Invoice%20Title&reference=01TST99&invoiceCurrencyCode=USD&price=20.5&payerCurrencyCode=LTC&payerEmail=test@example.com&payerIP=127.0.0.1 — Request parametres

Parameters can be sent both with POST or GET methods.

Important! All decimal numbers should be positive and no more than 8 characters after dot.

Response Example:

{
	"ErrorMessage":null,
	"IsSuccess":true,
	"Result":"11400-40058-1404"
}
Name Type Example Description
ErrorMessage String API_Wrong_Hash Error Code
IsSuccess Boolean true Operation Success
Result Array/Object   Result

API Functions List

All functions are logically divided into the following sections:

PaySystems() Function

[Array of PaymentSystem Objects] PaySystems ( )

Allows to get the list of the active supported payment systems.

Parameters: None.

Return value: Array of PaymentSystem Objects.

Response example:

{
	"ErrorMessage":null,
	"IsSuccess":true,
	"Result":[
		{
			"ID": 1,
			"Name": "OKPAY",
			"Code": "OKPAY"
		},
		{
			"ID": 2,
			"Name": "Crypto Currencies",
			"Code": "CRYPTO"
		},
		{
			"ID": 4,
			"Name": "Wire Transfer",
			"Code": "WIRE"
		},
		{
			"ID": 5,
			"Name": "EgoPay",
			"Code": "EGOPAY"
		},
		{
			"ID": 6,
			"Name": "Perfect Money",
			"Code": "PM"
		}
	]
}

Invoice_Create() Function

[String] Invoice_Create ( Integer APIID, String title, String reference, String invoiceCurrencyCode, Decimal price, String payerCurrencyCode, String payerEmail, String payerIP )

This function create new invoice and returns its code.

Parameters:

Name Type Example Description
APIID Integer None API Identifier
title String None Invoice title
reference String None Invoice reference
invoiceCurrencyCode String None Currency code
price Decimal None Total price
payerCurrencyCode String None Payer currency
payerEmail String None Payer email
payerIP String None Payer IP address

Return value: String.

Response example:

{
	"ErrorMessage":null,
	"IsSuccess":true,
	"Result":"11400-40058-1404"
}

Invoice_Get() Function

[Invoice Object] Invoice_Get ( Integer APIID, String invoiceCode, String signature )

This function allows to get data for single invoice.

Parameters:

Name Type Example Description
APIID Integer None API Identifire
invoiceCode String None Invoice Identifier

Return value: Invoice Object.

Response example:

{
	"ErrorMessage":null,
	"IsSuccess":true,
	"Result": {
		"Payments": [
			{
				"Amount": 0.0010000000,
				"Currency": "btc",
				"CryptoBlockNumber": "325284",
				"CryptoTxnId": "695e0476d97d280be352870c3d09617c701236d91b4b8afafe9edc26dc29bfac",
				"CryptoRcvAddress": "17geSgJU7VE5b5qYpPjuPSUuYRak3AaJfG",
				"PaymentId": 81168,
				"CryptoIsConfirmed": true
			},
			{
				"Amount": 0.0010000000,
				"Currency": "btc",
				"CryptoBlockNumber": "325284",
				"CryptoTxnId": "e1d544605b36fa7b1de9e63c628117e851d80c18ae5b7db2728149116b27e2fe",
				"CryptoRcvAddress": "17geSgJU7VE5b5qYpPjuPSUuYRak3AaJfG",
				"PaymentId": 81169,
				"CryptoIsConfirmed": true
			}
		],
		"InvoiceId": 11400,
		"Status": "Pending",
		"Title": "title",
		"ReferenceId": null,
		"InvoiceCurrency": "btc",
		"InvoicePrice": 0.0100000000,
		"PayerEmail": "noname@example.com",
		"PayerIP": "127.0.0.1",
		"PayerCurrency": "ltc",
		"PayerAmount": 1.0735414231,
		"FundsUnconfirmed": 0,
		"FundsConfirmed": 0,
		"ChangeSent": 0,
		"InvoiceURL": "https://www.crxzone.com/en/checkout/11400-40058-1404",
		"InvoiceCode": "11400-40058-1404",
		"TimeStamp": 1416837878
	}
}

Invoices_Get() Function

[Array of Invoice Objects] Invoices_Get ( Integer APIID, Integer startIndex, Integer recordsCount )

Get list of all invoices created in your account.

Parametres:

Name Type Example Description
APIID Integer None API Identifier
startIndex Integer None Start position
recordsCount Integer None Number of items to show

Return value: Array of Invoice Objects.

Response example:

{
	"ErrorMessage":null,
	"IsSuccess":true,
	"Result":{
		"Invoices": [
			{
				"Payments": null,
				"InvoiceId": 11400,
				"Status": "Pending",
				"Title": "title",
				"ReferenceId": null,
				"InvoiceCurrency": "btc",
				"InvoicePrice": 0.0100000000,
				"PayerEmail": "noname@example.com",
				"PayerIP": "127.0.0.1",
				"PayerCurrency": "ltc",
				"PayerAmount": 1.0735414231,
				"FundsUnconfirmed": 0,
				"FundsConfirmed": 0,
				"ChangeSent": 0,
				"InvoiceURL": "https://www.crxzone.com/en/checkout/11400-40058-1404",
				"InvoiceCode": "11400-40058-1404",
				"TimeStamp": 1416837878
			},
			{
				"Payments": null,
				"InvoiceId": 11296,
				"Status": "Expired",
				"Title": "Example title",
				"ReferenceId": "R00001ID",
				"InvoiceCurrency": "usd",
				"InvoicePrice": 111.0000000000,
				"PayerEmail": null,
				"PayerIP": "31.200.204.22",
				"PayerCurrency": "ltc",
				"PayerAmount": 31.7281554508,
				"FundsUnconfirmed": 0,
				"FundsConfirmed": 0,
				"ChangeSent": 0,
				"InvoiceURL": "https://www.crxzone.com/en/checkout/11296-40058-1243",
				"InvoiceCode": "11296-40058-1243",
				"TimeStamp": 1415277784
			}
		],
		"TotalRecordsCount": 27
	}
}

PaymentAddress_Create() Function

[PaymentAddress Object] PaymentAddress_Create ( Integer APIID, String walletName, String reference, String currencyCode )

This function creates new payment address in your account.

Parameters:

Name Type Example Description
APIID Integer None API Identifier
walletName String None Invoice title
reference String None Invoice reference
currencyCode String None Currency code

Return value: PaymentAddress Object.

Response example:

{
	"ErrorMessage":null,
	"IsSuccess":true,
	"Result": {
		"ID": 9117,
		"CurrencyCode": "BTC",
		"Reference": "TestReferenceID",
		"Address": "1GM8zeEeCR83Wppjn7THLCXXwaKPqHQ5Xu",
		"Name": "ExampleWalletName"
	}
}

PaymentAddress_Update() Function

[PaymentAddress Object] PaymentAddress_Update ( Integer APIID, Integer walletID, String walletName, String reference )

Create payment address

Parameters:

Name Type Example Description
APIID Integer None API Identifier
walletID Integer None Wallet ID
walletName String None Invoice title
reference String None Invoice reference
currencyCode String None Currency code

Return value: PaymentAddress Object.

Response example:

{
	"ErrorMessage":null,
	"IsSuccess":true,
	"Result": {
		"ID": 9117,
		"CurrencyCode": "BTC",
		"Reference": "NewReferenceID",
		"Address": "1GM8zeEeCR83Wppjn7THLCXXwaKPqHQ5Xu",
		"Name": "NewWalletName"
	}
}

PaymentAddress_Delete() Function

[Void] PaymentAddress_Delete ( Integer APIID, Integer walletID )

Function deletes payment address from your account.

Parameters:

Name Type Example Description
APIID Integer None API Identifier
walletID Integer None Wallet ID

Return value: None.

Response example:

{
	"ErrorMessage":null,
	"IsSuccess":true,
	"Result":null
}

PaymentAddresses_Get() Function

[Array of PaymentAddress Objects] PaymentAddresses_Get ( Integer APIID, String currencyCode, Integer startIndex, Integer recordsCount )

This function returns payment addresses list.

Parameters:

Name Type Example Description
APIID Integer None API Identifier
currencyCode String None Code of currency
startIndex Integer None Start position
recordsCount Integer None Number of items to show

Return value: Array of PaymentAddress Objects.

Response example:

{
	"ErrorMessage":null,
	"IsSuccess":true,
	"Result": {
		"Wallets": [
			{
				"ID": 8745,
				"CurrencyCode": "BTC",
				"Reference": "Reference 1",
				"Address": "1NGX1ATub3z8uyhqwhnK8W953ajUsSMTbx",
				"Name": "Wallet #1"
			},
			{
				"ID": 8756,
				"CurrencyCode": "BTC",
				"Reference": "Reference 2",
				"Address": "1M4gTRrqvDVgK9kB6uWX5EuFyrnZ7YjpoM",
				"Name": "Wallet #2"
			}
		],
		"TotalRecordsCount": 8
	}
}

Withdrawal() Function

[Integer] Withdrawal ( Integer APIID, String currencyCode, String paySystemCode, String remoteAddress, Decimal amount )

Initiate withdrawal process and returns withdrawal transaction ID.

Parameters:

Name Type Example Description
APIID Integer None API Identifier
currencyCode String None Code of currency
paySystemCode String None Code of payment system
remoteAddress String None Address/wallet ID/etc. in payment system
amount Decimal None Amount to withdrawal

Return value: Integer.

Response example:

{
	"ErrorMessage":null,
	"IsSuccess":true,
	"Result":81318
}

API Error Codes

Error Code Description
API_Wrong_Hash Wrong request signature. check parameters order and number format (must be eight signs decimal)
Order_Not_Found Wrong order ID
CurrencyPair_Not_Found Wrong currency pair ID
Parameter_Validation_Error Invalid parameter (null, empty or negative)
Negative_Balance_Is_Prohibited Not enough money to make this action

Data Structures

Object PaymentSystem
Name Type Example Description
ID Integer 2 Currency ID
Name String Crypto Currencies Payment system title
Code String CRYPTO Payment system internal code
Object Invoice
Name Type Example Description
Payments Array of Payment Example Description
InvoiceId Integer 11400 ID of Invoice
Status String Pending Invoice status
Title String MyInvoice Title Invoice Title
ReferenceId String REF000012 Reference ID
InvoiceCurrency String btc Invoice Currency
InvoicePrice Decimal 0.0100000000 Invoice Price
PayerEmail String noname@example.com Payer Email
PayerIP String 127.0.0.1 Payer IP
PayerCurrency String ltc Payer Currency
PayerAmount Decimal 1.0735414231 Amount to pay
FundsUnconfirmed Integer 0 Unconfirmed Funds
FundsConfirmed Integer 0 Сonfirmed Funds
ChangeSent Integer 0
InvoiceURL String https://www.crxzone.com/en/checkout/11400-40058-1404 Invoice URL
InvoiceCode String 11400-40058-1404 Invoice code
TimeStamp Integer 1416837878 UNIX Timestamp
Object PaymentAddress
Name Type Example Description
ID Integer 9117 Wallet ID
CurrencyCode String BTC Currency Code
Reference String TestReferenceID Wallet Reference
Address String 1GM8zeEeCR83Wppjn 7THLCXXwaKPqHQ5Xu Wallet Address
Name String ExampleWalletName Wallet Name
Object Payment
Name Type Example Description
Amount Decimal 0.0010000000 Payment amount
Currency String btc Payment currency
CryptoBlockNumber String 325284 Number of block in blockchain
CryptoTxnId String e1d544605b36fa7b 1de9e63c628117e8 51d80c18ae5b7db2 728149116b27e2fe Blockchain transaction ID
CryptoRcvAddress String 17geSgJU7VE5b5qYp PjuPSUuYRak3AaJfG Received to Address
PaymentId Integer 81169 Internal Payment ID
CryptoIsConfirmed Boolean true Is Payment Confirmed in Blockchain

References

Payment Methods

The following is a list that represent all possible funding and withdrawal methods.

Logotype Title Code
Crypto CurrenciesCrypto CurrenciesCRYPTO
Wire TransferWire TransferWIRE
Perfect MoneyPerfect MoneyPM
WebMoneyWebMoneyWM
SkrillSkrillSKRILL
PayzaPayzaPZ
OKPAYOKPAYOKPAY

Fiat Currency Codes

Below are selected world currencies along with their ISO 4217 Currency Code.

Country Currency Code
Euro Member Countries, Andorra, Austria, Azores, Baleares (Balearic Islands), Belgium, Canary Islands, Cyprus, Dutch (Netherlands), Eire (Ireland), Finland, France, French Guiana, French Southern Territories, Germany, Greece, Guadeloupe, Holland (Netherlands), Holy See, (Vatican City), Ireland (Eire), Italy, Luxembourg, Madeira Islands, Malta, Martinique, Mayotte, Miquelon and Saint Pierre, Monaco, Montenegro, Netherlands, Portugal, Reunion, Saint Pierre and Miquelon, Saint-Martin, San Marino, Slovakia, Slovenia, Spain Euro EUR
United States of America, American Samoa, American Virgin Islands, British Indian Ocean Territory, British Virgin Islands, Caicos and Turks Islands, Ecuador, El Salvador, Guam, Haiti, Mariana Islands (Northern), Marshall Islands, Micronesia (Federated States of), Midway Islands, Northern Mariana Islands, Palau, Panama, Puerto Rico, Samoa (American), United States Minor Outlying Islands, Wake Island U.S. Dollar USD
Singapore Singapore Dollar SGD

Crypto Currencies

Name Code
USDUSD
EUREUR
BTCBTC
LTCLTC
SGDSGD
DOGEDOGE
MYRMYR
ETHETH

 

Code Samples

PHP
 <?php
 	/**
 	* 
 	* API-call related functions
 	*
 	*/
 	class CRXzoneMerchantAPI {
 		protected $public_api = 'https://www.crxzone.com/API/';
 		
 		protected $api_id;
 		protected $api_key;
 		
 		public $CurrencyPairs = array();
 		public $Balances = array();
 		public $PaySystems = array();
 		
 		public function __construct($api_id, $api_key) {
 			$this->api_id = $api_id;
 			$this->api_key = $api_key;
 			
 			// Init currency pairs and balances
 			$this->RefreshCurrencyPairs();
 			$this->RefreshBalances();
 			$this->RefreshPaySystems();
 		}
 		
 		/**
 		* Call the API
 		*/
 		public function Query($method = '', $args = array(), $decode = TRUE) {
 			// Prepare request before send
 			$this->Prepare($args);
 			$url = $this->public_api.$method;
 			$ch = curl_init();
 			if(strtolower((substr($url,0,5))=='https')) {
 				curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
 				curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
 			}
 			curl_setopt($ch, CURLOPT_URL, $url);
 			curl_setopt($ch, CURLOPT_REFERER, $url);
 			curl_setopt($ch, CURLOPT_VERBOSE, 0);
 			curl_setopt($ch, CURLOPT_POST, 1);
 			#curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
 			curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
 			curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (Windows; U; Windows NT 5.0; En; rv:1.8.0.2) Gecko/20070306 Firefox/1.0.0.4");
 			curl_setopt($ch, CURLOPT_HEADER, 0);
 			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 			curl_setopt($ch, CURLOPT_TIMEOUT, 10);
 			$result = curl_exec($ch);
 			curl_close($ch);
 			if($decode)
 				return json_decode($result);
 			else
 				return $result;
 		}
 		
 		/**
 		* Prepare request
 		*/
 		private function Prepare(&$Params) {
 			// Sort array by key (ASC)
 			if(isset($Params['signature'])) {
 				unset($Params['signature']);
 			}
 			
 			$Params = array_reverse($Params, true);
 			$Params['APIID'] = $this->api_id;
 			$Params = array_reverse($Params, true); 
 			
 			$SortedParams = array();
 			$a1 = array_keys($Params);
 			foreach($a1 as $key) {
 				$SortedParams[strtolower($key)] = $Params[$key];
 			}
 			ksort($SortedParams);
 			
 			// Implode values and append API key
 			$Imploded = implode(":", $SortedParams).":".$this->api_key;
 			
 			$SortedParams['signature'] = md5($Imploded);
 			$Params = $SortedParams;
 		}
 		
 		/**
 		* Refresh currency pairs information
 		*/
 		public function RefreshCurrencyPairs() {
 			$CurrencyResult = $this->Query("CurrencyPairs");
 			if($CurrencyResult->IsSuccess) {
 				$this->CurrencyPairs = array();
 				foreach($CurrencyResult->Result as $Pair) {
 					$Code = $Pair->PrimaryCurrencyCode.$Pair->SecondaryCurrencyCode;
 					$this->CurrencyPairs[$Code] = array(
 						"ID" => $Pair->ID,
 						"MinimumOrderAmount" => $Pair->MinimumOrderAmount
 					);
 					$TickerResult = $this->Query("Ticker", array('currencyPairID' => $Pair->ID));
 					
 					if($TickerResult->IsSuccess) {
 						$this->CurrencyPairs[$Code]["Price"] = $TickerResult->Result->Last;
 					} else {
 						$this->CurrencyPairs[$Code]["Price"] = 0;
 					}
 					
 				}
 			} else {
 				throw new CRXzoneAPIFailureException('File: '.__FILE__.' Line: '.__LINE__.' API Error: '.$CurrencyResult->ErrorMessage);
 			}
 		}
 		
 		/**
 		* Refresh balances information
 		*/
 		public function RefreshBalances() {
 			$AccountsResult = $this->Query("Accounts");
 			if($AccountsResult->IsSuccess) {
 				$this->Balances = array();
 				foreach($AccountsResult->Result as $Account) {
 					$this->Balances[$Account->CurrencyCode] = array(
 						'Available'     => $Account->Available,
 						'InOrders'      => $Account->InOrders,
 						'InWithdrawals' => $Account->InWithdrawals,
 						'TotalHold'     => $Account->InOrders + $Account->InWithdrawals
 					);
 				}
 			} else {
 				throw new CRXzoneAPIFailureException('File: '.__FILE__.' Line: '.__LINE__.' API Error: '.$AccountsResult->ErrorMessage);
 			}
 		}
 		
 		/**
 		* Refresh PaySystems information
 		*/
 		public function RefreshPaySystems() {
 			$PaySystemsResult = $this->Query("PaySystems");
 			
 			if($PaySystemsResult->IsSuccess) {
 				$this->PaySystems = array();
 				foreach($PaySystemsResult->Result as $PaySystem) {
 					$this->PaySystems[$PaySystem->Code] = array(
 						'ID'   => $PaySystem->ID,
 						'Name' => $PaySystem->Name,
 						'Code' => $PaySystem->Code
 					);
 				}
 			} else {
 				throw new CRXzoneAPIFailureException('File: '.__FILE__.' Line: '.__LINE__.' API Error: '.$PaySystemsResult->ErrorMessage);
 			}
 		}
 		
 		
 		/**
 		* Working with invoices
 		* Get invoices list
 		*/
 		public function GetInvoicesList($StartIndex = 0, $RecordsCount = 10) {
 			if(empty($RecordsCount)) {
 				throw new CRXzoneAPIInvalidParameterException('File: '.__FILE__.' Line: '.__LINE__.' Error: recordsCount must be more than 0');
 			}
 			$InvoicesResult = $this->Query("Invoices_Get", array("startIndex" => $StartIndex, "recordsCount" => $RecordsCount));
 			$Result = array();
 			if($InvoicesResult->IsSuccess) {
 				foreach($InvoicesResult->Result as $Invoice) {
 					$Result[$Invoice->InvoiceId] = $Invoice;
 				}
 			} else {
 				throw new CRXzoneAPIFailureException('File: '.__FILE__.' Line: '.__LINE__.' API Error: '.$InvoicesResult->ErrorMessage);
 			}
 			return $Result;
 		}
 		
 		/**
 		* Create invoice
 		*/
 		public function CreateInvoice($Title = "", $Reference = "", $InvoiceCurrencyCode = "BTC", $Price = "1.00000000", $PayerCurrencyCode = "USD", $PayerEmail = "", $PayerIP = "") {
 			$Price = number_format($Price, 8, '.', '');
 			$CreateInvoiceResult = $this->Query("Invoice_Create",  array("title" => $Title, "reference" => $Reference, "invoiceCurrencyCode" => $InvoiceCurrencyCode, "price" => $Price, "payerCurrencyCode" => $PayerCurrencyCode, "payerEmail" => $PayerEmail, "payerIP" => $PayerIP));
 			if($CreateInvoiceResult->IsSuccess) {
 				return $CreateInvoiceResult->Result;
 			} else {
 				throw new CRXzoneAPIFailureException('File: '.__FILE__.' Line: '.__LINE__.' API Error: '.$CreateInvoiceResult->ErrorMessage);
 			}
 		}
 		
 		/**
 		* Get invoice by code
 		*/
 		public function InvoiceGet($InvoiceCode = "") {
 			$InvoiceGetResult = $this->Query('Invoice_Get', array("invoiceCode" => $InvoiceCode));
 			if($InvoiceGetResult->IsSuccess) {
 				return $InvoiceGetResult->Result;
 			} else {
 				throw new CRXzoneAPIFailureException('File: '.__FILE__.' Line: '.__LINE__.' API Error: '.$InvoiceGetResult->ErrorMessage);
 			}
 		}
 		
 		
 		/**
 		* Working with payment addresses
 		* Get addresses list
 		*/
 		public function GetAddressesList($CurrencyCode = "USD", $StartIndex = 0, $RecordsCount = 10) {
 			if(empty($RecordsCount)) {
 				throw new CRXzoneAPIInvalidParameterException('File: '.__FILE__.' Line: '.__LINE__.' Error: recordsCount must be more than 0');
 			}
 			$AddressesResult = $this->Query("PaymentAddresses_Get", array("currencyCode" => $CurrencyCode, "startIndex" => $StartIndex, "recordsCount" => $RecordsCount));
 			$Result = array();
 			if($AddressesResult->IsSuccess) {
 				foreach($Addresses->Result as $Address) {
 					$Result[$Address->ID] = $Address;
 				}
 			} else {
 				throw new CRXzoneAPIFailureException('File: '.__FILE__.' Line: '.__LINE__.' API Error: '.$AddressesResult->ErrorMessage);
 			}
 			return $Result;
 		}
 		
 		/**
 		* Create address
 		*/
 		public function CreateAddress($WalletName = "", $Reference = "", $CurrencyCode = "USD") {
 			$CreateAddressResult = $this->Query("PaymentAddress_Create",  array("walletName" => $WalletName, "reference" => $Reference, "currencyCode" => $CurrencyCode));
 			if($CreateAddressResult->IsSuccess) {
 				return $CreateAddressResult->Result;
 			} else {
 				throw new CRXzoneAPIFailureException('File: '.__FILE__.' Line: '.__LINE__.' API Error: '.$CreateAddressResult->ErrorMessage);
 			}
 		}
 		
 		/**
 		* Update address
 		*/
 		public function UpdateAddress($WalletID = 0, $WalletName = "", $Reference = "") {
 			$UpdateAddressResult = $this->Query("PaymentAddress_Update",  array("walletID" => $WalletID, "walletName" => $WalletName, "reference" => $Reference));
 			if($UpdateAddressResult->IsSuccess) {
 				return $UpdateAddressResult->Result;
 			} else {
 				throw new CRXzoneAPIFailureException('File: '.__FILE__.' Line: '.__LINE__.' API Error: '.$UpdateAddressResult->ErrorMessage);
 			}
 		}
 		
 		/**
 		* Delete address
 		*/
 		public function DeleteAddress($WalletID = 0) {
 			$DeleteAddressResult = $this->Query("PaymentAddress_Delete",  array("walletID" => $WalletID));
 			if($DeleteAddressResult->IsSuccess) {
 				return $DeleteAddressResult->Result;
 			} else {
 				throw new CRXzoneAPIFailureException('File: '.__FILE__.' Line: '.__LINE__.' API Error: '.$DeleteAddressResult->ErrorMessage);
 			}
 		}
 		
 		/**
 		* Withdrawal
 		*/
 		public function Withdrawal($CurrencyCode = "", $PaySystemCode = "", $RemoteAddress = "", $Amount = 0) {
 			$Amount = number_format($Amount, 8, '.', '');
 			$WithdrawalResult = $this->Query("Withdrawal",  array("currencyCode" => $CurrencyCode, "paySystemCode" => $PaySystemCode, "remoteAddress" => $RemoteAddress, "amount" => $Amount));
 			if($WithdrawalResult->IsSuccess) {
 				return $WithdrawalResult->Result;
 			} else {
 				throw new CRXzoneAPIFailureException('File: '.__FILE__.' Line: '.__LINE__.' API Error: '.$WithdrawalResult->ErrorMessage);
 			}
 		}
 	}
 	
 	/**
 	* Exceptions
 	*/
 	class CRXzoneAPIException extends Exception {}
 	class CRXzoneAPIFailureException extends CRXzoneAPIException {}
 	class CRXzoneAPIInvalidParameterException extends CRXzoneAPIException {}
 ?>
					
C#
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Net;
 using System.IO;
 using System.Security.Cryptography;
 using System.Security.Cryptography.X509Certificates;
 using System.Net.Security;
 using Newtonsoft.Json;
 using System.Web; //Add reference to System.Web
 using Newtonsoft.Json.Linq; //"Manage NuGet packages" -> Search for "newtonsoft json". -> click "install".
 namespace CRXZone
 {
 /*
                 {//Call anonymous method
                     var method = new CRXZone.API.MethodCall(CRXZone.API.API_Methods.CurrencyPairs);
                     method.Execute();
                     Console.WriteLine(method.Result.ToString());
                 }
 
                 {//Call secured method
                     var method = new CRXZone.API.MethodCall(CRXZone.API.API_Methods.Order_Create, 21235, "API_KEY_HERE");
                     method.AddParameter("currencyPairID", 1011);
                     method.AddParameter("price", 1M);
                     method.AddParameter("amount", 100M);
                     method.AddParameter("type", 1);
                     method.Execute();
                     Console.WriteLine(method.Result.ToString());
                 }
 */
     public class API
     {
         public enum SellBuy
         {
             Sell = 1,//BID
             Buy = 0,//ASK
         }
 
         public enum API_Methods 
         {
             PaySystems,
             CurrencyPairs,
             Ticker,
             Trades,
             Market_Depth,
             Accounts,
             Order_Cancel,
             Order_Create,
             Order_Get,
             Orders_Active,
             Orders_Closed,
             Withdrawal,
             Invoice_Get,
             Invoice_Create,
             Invoices_Get,
             PaymentAddress_Create,
             PaymentAddress_Update,
             PaymentAddress_Delete,
             PaymentAddresses_Get,
         }
 
         public class MethodCall 
         {
             const string APIURL = @"https://www.crxzone.com/API/";
 
             public long? APIID { get; set; }
             public string APIKey { get; set; }
             public string MethodName { get; set; }
             public JToken Result { get; private set; }
             private Dictionary<string, string> Parameters = new Dictionary<string, string>();
             
             public MethodCall(API_Methods method, long? APIID = null, string APIKey = null) : this(method.ToString(), APIID, APIKey) { }
             public MethodCall(string methodName, long? APIID = null, string APIKey = null)
             {
                 this.MethodName = methodName;
                 this.APIID = APIID;
                 this.APIKey = APIKey;
 
                 if (this.APIID.HasValue) 
                 {
                     this.AddParameter("APIID", APIID);
                 }
             }
 
             public void AddParameter(string name, object value) 
             {
                 Parameters.Add(name, value.ToString());
             }
 
             public void AddParameter(string name, long value)
             {
                 Parameters.Add(name, value.ToString());
             }
 
 
             public void AddParameter(string name, int value)
             {
                 Parameters.Add(name, value.ToString());
             }
 
             public void AddParameter(string name, short value)
             {
                 Parameters.Add(name, value.ToString());
             }
 
             public void AddParameter(string name, byte value)
             {
                 Parameters.Add(name, value.ToString());
             }
 
             public void AddParameter(string name, float value)
             {
                 Parameters.Add(name, value.ToString("0.00000000", System.Globalization.CultureInfo.InvariantCulture.NumberFormat));
             }
 
             public void AddParameter(string name, decimal value)
             {
                 Parameters.Add(name, value.ToString("0.00000000", System.Globalization.CultureInfo.InvariantCulture.NumberFormat));
             }
 
             public void Execute() 
             {
                 var tmpParameters = this.Parameters.ToDictionary(c => c.Key, c => c.Value);
                 var values = tmpParameters.OrderBy(c => c.Key).Select(c => c.Value).ToList();
                 if (!string.IsNullOrEmpty(this.APIKey)) 
                 {
                     values.Add(this.APIKey);
                     var original = string.Join(":", values);
                     tmpParameters.Add("signature",API.GetMd5Hash(original));
                 }
                 string url = APIURL + MethodName + "?" + string.Join("&", tmpParameters.Select(c => HttpUtility.UrlEncode(c.Key) + "=" + HttpUtility.UrlEncode(c.Value)));
                 string result = null;
                 try
                 {
                     using (WebClient wc = new WebClient())
                     {
                         result = wc.DownloadString(url);
                     }
                 }
                 catch
                 {
                     throw new CRXzoneAPIConnectionException();
                 }
                 JObject jObj;
                 string errorMessage;
                 try
                 {
                     jObj = JObject.Parse(result);
                     errorMessage = (string)jObj["ErrorMessage"];
                 }
                 catch 
                 {
                     throw new CRXzoneAPIInvalidAnswerException(); 
                 }
                 if (!string.IsNullOrEmpty(errorMessage))
                 {
                     throw new CRXzoneAPIException(errorMessage);
                 }
                 this.Result = jObj["Result"];
 
 
             }
 
         }
 
       
         internal static string GetMd5Hash(string input)
         {
             using (var md5 = System.Security.Cryptography.MD5.Create())
             {
                 var arr = System.Text.Encoding.ASCII.GetBytes(input);
                 arr = md5.ComputeHash(arr);
                 return BitConverter.ToString(arr).Replace("-", "");
             }
         }
     }
 
     public class CRXzoneAPIConnectionException : Exception
     {
 
     }
     public class CRXzoneAPIInvalidAnswerException : Exception
     {
 
     }
 
     public class CRXzoneAPIException : Exception
     {
         public CRXzoneAPIException(string message):base(message)
         {
         }
     }
 
 }
					
Python
 import hashlib, requests, json, sys
   
 DEBUG = True
   
 #   * API-call related functions
 class CRXzoneAPI(object):
     __BUY = '0'
     __SELL = '1'
     __public_api = 'https://www.crxzone.com/API/'
       
     __api_id = None
     __api_key = None
       
     CurrencyPairs = {};
     Balances = {};
           
     def __init__(self, api_id, api_key):
         self.__api_id = api_id
         self.__api_key = api_key
           
         self.__SESS = requests.Session()
         self.__SESS.headers.update({
             "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36",
         })
         self.__SESS.verify = False
         self.__SESS.timeout = 10
   
         # Init currency pairs and balances
         self.RefreshCurrencyPairs()
         self.RefreshBalances()
           
     # * Call the API
     def Query(self, method = '', args = {}):
         # // Prepare request before send
         self.__addSignature(args)
         url = self.__public_api + method
           
         try:        
             result = self.__SESS.post(url, headers={"Referer":url}, data=args)
             if DEBUG: print method, result.text[:500]
             return json.loads(result.text)
         except:
             if DEBUG: print method, sys.exc_info()
             return {"ErrorMessage":sys.exc_info(), "IsSuccess":False, "Result":None}
       
     # * Prepare request
     def  __addSignature(self, Params):
         if 'signature' in Params:
             del Params['signature']
           
         Params['APIID'] = self.__api_id
           
         p = {}
         for k,v in Params.items():
             p[str(k).lower()] = v
   
         Imploded = ""
         for k in sorted(p):
             Imploded += str(p[k])+":"
           
         Imploded += self.__api_key
           
         Params['signature'] = hashlib.md5(Imploded).hexdigest()
         return Params
       
     # * Refresh currency pairs information
     def RefreshCurrencyPairs(self):
         CurrencyResult = self.Query("CurrencyPairs")
         if CurrencyResult['IsSuccess']:
             self.CurrencyPairs = {}
             for Pair in CurrencyResult['Result']:
                 Code = "%s%s" % (Pair['PrimaryCurrencyCode'], Pair['SecondaryCurrencyCode'])
                 self.CurrencyPairs[Code] = {
                     "ID": Pair['ID'],
                     "MinimumOrderAmount": Pair['MinimumOrderAmount'],
                 }
                 TickerResult = self.Query("Ticker", {'currencyPairID': Pair['ID']})
                   
                 if TickerResult['IsSuccess']:
                     self.CurrencyPairs[Code]["Price"] = TickerResult['Result']['Last']
                 else:
                     self.CurrencyPairs[Code]["Price"] = 0
         else:
             # raise CRXzoneAPIFailureException('File: '__FILE__.' Line: '.__LINE__.' API Error: '.$CurrencyResult->ErrorMessage);
             raise CRXzoneAPIFailureException('RefreshCurrencyPairs API Error: %s' % (CurrencyResult['ErrorMessage'],))
           
     # * Refresh balances information
     def RefreshBalances(self):
         AccountsResult = self.Query("Accounts")
           
         if AccountsResult['IsSuccess']:
             self.Balances = {}
             for Account in AccountsResult['Result']:
                 self.Balances[Account['CurrencyCode']] = {
                     'Available'     : Account['Available'],
                     'InOrders'      : Account['InOrders'],
                     'InWithdrawals' : Account['InWithdrawals'],
                     'TotalHold'     : Account['InOrders'] + Account['InWithdrawals'],
                 }
         else:
             # throw new CRXzoneAPIFailureException('File: '__FILE__.' Line: '.__LINE__.' API Error: '.$AccountsResult->ErrorMessage);
             raise CRXzoneAPIFailureException('RefreshBalances API Error: %s' % (AccountsResult['ErrorMessage'],))
       
     # * Get last tick for currency pair
     def GetTicker(self, CurrencyPair):
         if CurrencyPair in self.CurrencyPairs:
             PairID = self.CurrencyPairs[CurrencyPair]["ID"]
             TickerResult = self.Query("Ticker", {'currencyPairID': PairID})
             if TickerResult['IsSuccess']:
                 return TickerResult['Result']
             else:
                 # throw new CRXzoneAPIFailureException('File: '__FILE__.' Line: '.__LINE__.' API Error: '.$TickerResult->ErrorMessage);
                 raise CRXzoneAPIFailureException('GetTicker API Error: %s' % (TickerResult['ErrorMessage'],))
         else:
             # throw new CRXzoneAPIInvalidParameterException('File: '__FILE__.' Line: '.__LINE__.' Error: Currency pair '.$CurrencyPair.' not found');
             raise CRXzoneAPIInvalidParameterException('GetTicker Error: Currency pair %s not found' % (CurrencyPair,));
       
     # * Get market depth
     def GetMarketDepth(self, CurrencyPair):
         if CurrencyPair in self.CurrencyPairs:
             PairID = self.CurrencyPairs[CurrencyPair]["ID"];
             DepthResult = self.Query("Market_Depth", {'currencyPairID': PairID})
             if DepthResult['IsSuccess']:
                 return TickerResult['Result']
             else:
                 # throw new CRXzoneAPIFailureException('File: '__FILE__.' Line: '.__LINE__.' API Error: '.$TickerResult->ErrorMessage);
                 raise CRXzoneAPIFailureException('GetMarketDepth API Error: %s ' % (TickerResult['ErrorMessage'],))
         else:
             # throw new CRXzoneAPIInvalidParameterException('File: '__FILE__.' Line: '.__LINE__.' Error: Currency pair '.$CurrencyPair.' not found');
             raise CRXzoneAPIInvalidParameterException('GetMarketDepth Error: Currency pair %s not found' % (CurrencyPair,))
       
     # * Get list of orders
     # // $CurrencyPair
     # // $Type = Active/Closed
     # // $RecordsCount = 0;
     # // $StartIndex = 0;
     def GetOrdersList(self, CurrencyPair, Type = 'Active', RecordsCount = 0, StartIndex = 0):
         if not CurrencyPair in self.CurrencyPairs:
             # throw new CRXzoneAPIInvalidParameterException('File: '__FILE__.' Line: '.__LINE__.' Error: Currency pair '.$CurrencyPair.' not found');
             raise CRXzoneAPIInvalidParameterException('GetOrdersList Error: Currency pair %s not found' % (CurrencyPair,))
   
         PairID = self.CurrencyPairs[CurrencyPair]["ID"]
         result = {}
         if Type == 'Active':
             OrdersResult = self.Query("Orders_Active", {'currencyPairID': PairID})
             if OrdersResult['IsSuccess']:
                 Orders = {}
                 StartIndex = 0 if StartIndex < 0 else StartIndex
                 OrdersTotal = len(OrdersResult['Result'])
                 if RecordsCount != 0:
                     Counter = 0
                     Index = 0
                     for Order in OrdersResult['Result']:
                         Index += 1
                         if StartIndex > Index:
                             continue
                         if Counter > RecordsCount:
                             break
                         Counter += 1
                         Orders[Order['ID']] = Order
                 else:
                     # // All orders
                     Index = 0
                     for Order in OrdersResult['Result']:
                         Index += 1
                         if StartIndex > Index:
                             continue
                         Orders[Order['ID']] = Order
                 result['Orders'] = Orders
                 result['TotalCount'] = OrdersTotal
             else:
                 # throw new CRXzoneAPIFailureException('File: '__FILE__.' Line: '.__LINE__.' API Error: '.$OrdersResult->ErrorMessage);
                 raise CRXzoneAPIFailureException('GetOrdersList API Error: %s' % (OrdersResult['ErrorMessage'],))
         else:
             OrdersResult = self.Query("Orders_Active", {'currencyPairID': PairID, 'recordsCount': RecordsCount, 'startIndex': StartIndex})
             if OrdersResult['IsSuccess']:
                 Orders = {}
                 for Order in OrdersResult['Result']:
                     Orders[Order['ID']] = Order
                 result['Orders'] = Orders
                 result['TotalCount'] = OrdersResult['TotalRecordsCount']
             else:
                 # throw new CRXzoneAPIFailureException('File: '__FILE__.' Line: '.__LINE__.' API Error: '.$OrdersResult->ErrorMessage);
                 raise CRXzoneAPIFailureException('GetOrdersList API Error: %s' (OrdersResult['ErrorMessage'],))
   
         return result;
       
     # * Get order by ID
     def GetOrderByID(self, OrderID):
         if isinstance(OrderID, int):
             OrderResult = self.Query("Order_Get", {'orderID': OrderID})
             if OrderResult['IsSuccess']:
                 return OrderResult['Result']
             else:
                 # throw new CRXzoneAPIFailureException('File: '__FILE__.' Line: '.__LINE__.' API Error: '.$OrderResult->ErrorMessage);
                 raise CRXzoneAPIFailureException('GetOrderByID API Error: %s' % (OrderResult['ErrorMessage'],))
         else:
             # throw new CRXzoneAPIInvalidParameterException('File: '__FILE__.' Line: '.__LINE__.' Error: Order ID must be Integer.');
             raise CRXzoneAPIInvalidParameterException('GetOrderByID Error: Order ID must be Integer.')
       
     # * Get market depth
     def CreateOrder(self, CurrencyPair, Price, Amount, Type = 'BUY'):
         if CurrencyPair in self.CurrencyPairs:
             Pair = self.CurrencyPairs[CurrencyPair]
             if Amount >= Pair['MinimumOrderAmount']:
                 if Type.upper()=='SELL':
                     OrderType = self.__SELL
                 else:
                     OrderType = self.__BUY
                 Amount = "%.8f" % Amount
                 Price = "%.8f" % Price
                 return self.Query("Order_Create", {'amount': Amount, 'currencyPairID': Pair['ID'], 'price': Price, 'type': OrderType})
             else:
                 # throw new CRXzoneAPIFailureException('File: '__FILE__.' Line: '.__LINE__.' API Error: '.$OrderResult->ErrorMessage);
                 # raise CRXzoneAPIFailureException('CreateOrder API Error: %s' % (OrderResult['ErrorMessage'],))
                 raise CRXzoneAPIFailureException('CreateOrder API Error: ! Amount >= Pair[MinimumOrderAmount]')
         else:
             # throw new CRXzoneAPIInvalidParameterException('File: '__FILE__.' Line: '.__LINE__.' Error: Currency pair '.$CurrencyPair.' not found');
             raise CRXzoneAPIInvalidParameterException('CreateOrder Error: Currency pair %s not found' % (CurrencyPair,))
       
     # * Get market depth
     def CancelOrder(self, OrderID):
         if isinstance(OrderID, int):
             OrderResult = self.Query("Order_Cancel", {'orderID': OrderID})
             if OrderResult['IsSuccess']:
                 return True
             else:
                 # throw new CRXzoneAPIFailureException('File: '__FILE__.' Line: '.__LINE__.' API Error: '.$OrderResult->ErrorMessage);
                 raise CRXzoneAPIFailureException('CancelOrder API Error: %s' % (OrderResult['ErrorMessage'],))
         else:
             # throw new CRXzoneAPIInvalidParameterException('File: '__FILE__.' Line: '.__LINE__.' Error: Order ID must be Integer.');
             raise CRXzoneAPIInvalidParameterException('CancelOrder Error: Order ID must be Integer.')
   
   
 #   /**
 #   * Exceptions
 #   */
 class CRXzoneAPIException(Exception):
     pass
 class CRXzoneAPIFailureException(CRXzoneAPIException):
     pass
 class CRXzoneAPIInvalidParameterException(CRXzoneAPIException):
     pass
   
   
   
 if __name__=='__main__':
     c = CRXzoneAPI(api_key='b&348fh)32k4', api_id='123456')