Yaman

Get started

The Maxicard API provides gateway to order epin products services via online.

To use this API, you need an API username and API password. Please contact us at info@maxigame.org to get your own API information.

POST REQUEST


# Here is a php example
$xml = '<?xml version="1.0" encoding="utf-8"?>
	<APIRequest>
		<params>
			<username>api_username</username>
			<password>api_password</password>
			<cmd>epinadd</cmd>
			<epinusername>username_on_your_site</epinusername>
			<epincode>Epin_code</epincode>
			<epinpass>Epin_password</epinpass>
		</params>
	</APIRequest>';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.maxigame.org/api/index.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1) ;
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'data='.urlencode($xml));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
$result = curl_exec($ch);  	
$curl_error = curl_errno($ch);
curl_close($ch);

$result_xml = simplexml_load_string($result);
	
if(trim($result_xml->params->durum) == 'ok' && intval(trim($result_xml->params->siparis_no)) > 0){//response success
 //use result
}else{
  echo 'Error!! '.trim($result_xml->params->aciklama); 
}  

#Response Success Example:
<?xml version="1.0" encoding="utf-8"?>
<APIResponse>
	<params>
		<durum>ok</durum>
		<aciklama><![CDATA[ok: Yükleme talebi işlem listesine alındı ]]></aciklama>
		<siparis_no>5</siparis_no>
		<tutar>25</tutar>
		<komisyon>0.75</komisyon>
	</params>
</APIResponse>

#Response Error Example:
<?xml version="1.0" encoding="utf-8"?>
	<APIResponse>
		<params>
			<durum>bayi_hata</durum>
			<aciklama><![CDATA[ Bayi adı veya şifre hatalı ]]></aciklama>
		</params>
	</APIResponse>

API Endpoint:

https://www.maxigame.org/epin/yukle.php

Request Method:

POST

Request Type:

XML

Response Type:

XML

POST PARAMETERS

Field Type Description Required
username String Your Maxigame API username required
password String Your Maxigame API password required
cmd String epinadd required
epinusername String Username to add balance on your site required
epincode String Maxicard Epin code required
epinpass String Maxicard Epin password required

RESPONSE SUCCESS PARAMETERS

Field Type Description Possible Options
durum String Response status ok - Reqest success.
siparis_no İnteger Order ID -
tutar Float Order Total -
komisyon Float Merchant Commission -
aciklama String Order status Yükleme işlemi başarılı - order fulfilled, completed.

RESPONSE ERROR PARAMETERS

Field Type Description Possible Options
durum String Response status hata - Common error.
bayi_hata - Api username or password wrong.
bayi_aktif_hata - Api user is not active
hesap_hata - Api user not found.
ip_hata - Unauthorized IP address.
kod_hata - Epin code or password wrong.
kod_tekrar_hata - Used card code.
fiyat_hata - Amount uncertain or is unregistered in merchant.
komut_hata - Api command is missing.
eksik_alan - Required field is missing.
dbhata - System error. Try again later
aciklama String Error reason message -

1 - POST all required data to API endpoint in data field.
2 - if response success, use process data (in response xml).
Check example

Errors


#Response Error Example:
<?xml version="1.0" encoding="utf-8"?>
	<APIResponse>
		<params>
			<durum>bayi_hata</durum>
			<aciklama><![CDATA[ Bayi adı veya şifre hatalı ]]></aciklama>
		</params>
	</APIResponse>

The Maxigame API return error with durum field. all errors with described in "aciklama" field.

ERROR CODES

Code Description
hataCommon error.
bayi_hataApi username or password wrong.
bayi_aktif_hataApi user is not active
hesap_hataApi user not found.
ip_hataUnauthorized IP address.
kod_hataEpin code or password wrong.
kod_tekrar_hataUsed card code.
fiyat_hataAmount uncertain or is unregistered in merchant.
komut_hataApi command is missing.
eksik_alanRequired field is missing.
dbhataSystem error. Try again later

API INFO

Version 1.0.