GoUrl.io Bitcoin/Altcoin API

  • bitcoin payment api
  • litecoin payment api
  • paycoin payment api
  • dogecoin payment api
  • dash payment api
  • speedcoin payment api
  • reddcoin payment api
  • potcoin payment api
  • feathercoin payment api
  • vertcoin payment api
  • monetaryunit payment api
  • vericoin payment api
  • peercoin payment api
  • swiscoin payment api

Welcome Developers!

Here you will find everything you need to get started coding for bitcoin/altcoin - PHP, ASP, Python, Java, C#, Node.js, etc.



API for PHP Websites


Please use our official free PHP Bitcoin/Altcoin Payment Class -

 PHP Examples »    PHP Instruction »    Download from Github




API for Wordpress Plugins/Themes


You can easily integrate crypto payments to your own wordpress plugin using our official Wordpress Bitcoin Gateway Plugin -

  WP Instructions for Plugins »      WP Instructions for Themes »





API for Other Languages (ASP, Python, Java, C#, etc)


Please use general instructions below to add bitcoin/altcoin payments to scripts/websites -

  API Instructions Below





Affiliate Program for Web Developers


33.3% lifetime revenue share - 0.50% from each bitcoin/altcoin payment made by users through your scripts with GoUrl Bitcoin/Altcoin Payment Gateway installed on various websites -

  Read more







Developer's Guide


Simple instructions on how to integrate GoUrl Payment Gateway to your scripts/website (ASP, Python, Java, C#, Node.js, etc).

If you use PHP language, please goto here, for other languages - read below.

Cryptocoin Payment Box and Crypto Captcha ("CRYPTOBOX") are very easy to use ! They are identical technically except their visual effect and will automatically display successful message if payment has been received. Default box size: 530 x 230 px






API Instruction - Python, ASP, Java, C#, Node.js...



GoUrl Bitcoin/Altcoin Gateway operates as follows -


bitcoin api



GoUrl Payment Integrations. Please do the following steps -

  1. Register or Login on our website
  2. Create new bitcoin/altcoin payment box (you will get Public and Private keys of new created box)

  3. Step A - Create html empty iframe element on your webpage and call javascript function cryptobox_show(..), function description below. It will generate iframe html bitcoin/altcoin payment box on webpage. Example

  4. Step B - When a user has paid, our server will automatically send full payment data (userID, orderID, amount, etc) to your website on url specified in field Callback URL

  5. Then your website can process that data (for example, update user membership, etc.)
Also see full presentation how gateway works ( from buyer and seller sides ).





A. Javascript function cryptobox_show(..)



Please download javascript file from here.

Javascript function cryptobox_show (boxID, coinName, public_key, amount, amountUSD, period, language, iframeID, userID, userFormat, orderID, cookieName, webdev_key, hash, width, height) - generate a html iframe with a bitcoin/altcoin payment box on your webpage

Function cryptobox_show() Parameters -

  • boxID
    Cryptocoin Payment BoxID from your new payment box. Example
  • coinName
    Crypotcoin name from your new payment box. Example
  • public_key
    Crypotcoin Payment Box Public Key from your new payment box. Example
  • amount
    Amount of cryptocoins which will be used in the payment box, precision is 4 (number of digits after the decimal), example: 0.0001, 2.444, 100, 2455, etc. We will use this value of cryptocoins in the payment box with a small fraction after the decimal point to uniquely identify each of your visitors individually - (for example, if you enter 0.011 BTC, one of your user will see 0.011308 BTC, and another will see 0.011832 BTC, etc). How It Works
  • amountUSD
    You can directly specify your price in USD (float values allowed) and cryptobox will automatically convert that USD amount to cryptocoin amount using today live cryptocurrency exchange rates (updated every 30min). For example, if you select BITCOIN currency and amountUSD = 14.6 USD - we will convert it to bitcoins and it will be 0.063 BTC. We will display it in crypto payment box for payment by the user.
    User will pay you all times the actual price which is linked on current exchange price in USD on the datetime of purchase. Also you can use Poloniex.com, Bitstamp.net, etc autosell feature and auto trade your cryptocoins to USD/BTC after payment received. Using that functionality (price in USD), you don't need to worry if cryptocurrency prices go down or go up. You can use in cryptobox options one variable only: amount or amountUSD. You cannot place values of those two variables together.
  • period
    Period after which the payment becomes obsolete and new Cryptocoin Payment Box will be shown (you can use it to take new payments from existing users periodically on a daily/monthly basis). Allow values: NOEXPIRY, 1 MINUTE - 90 MINUTE, 1 HOUR - 90 HOURS, 1 DAY - 90 DAYS, 1 WEEK - 90 WEEKS, 1 MONTH - 90 MONTHS
  • language
    Cryptobox localisation. Languages currently available for GoUrl Payment Box: en - English, es - Spanish, fr - French, de - German, ru - Russian, nl - Dutch, pt - Portuguese, fa - Persian, ko - Korean, ar - Arabic, cn - Simplified Chinese, zh - Traditional Chinese, hi - Hindi. We can add your language localisation in the cryptocoin payment box (all texts can be displayed in your local language). To do this please first download this language file with the text in English. At the end of each line, please add your translation from English and send this text file with your translation back to us on email and we will include your translation.
  • iframeID
    Html iframe cryptobox element id; allow symbols: a..Z0..9. See example below
  • userID
    A unique identifier for each of your users; allow symbols: a..Z0..9_-@.; max size: 50 symbols. Examples: 'user1', 'user2', '3vIh9MjEis'
  • userFormat
    Please use value 'MANUAL' all time. Other values available for PHP websites only.
  • orderID
    Your order id; allow symbols: a..Z0..9_-@.; max size: 50 symbols. Examples: 'order3332', 'product123
    A few of your users can have the same orderID but combination 'orderID'+'userID' should be unique. For example, on premium page you can use for all users: orderID="premium_access" and userID - user1, user2, etc
  • cookieName
    Please use empty value '' all time. Other values available for PHP websites only.
  • webdev_key
    Optional, your gourl affiliate key or leave empty value.
  • hash
    Security md5 all values hash. You should generate it on your server and place value in script; it protects payment box iframe parameters from changes by end user in web browser. HASH value generate as: md5($boxID . $coinName . $public_key . $private_key . $webdev_key . $amount . $period . $amountUSD . $language . $amount . $iframeID . $amountUSD . $userID . $userFormat . $orderID . $width . $height). As example, see md5 php code.
    Also we can activate debug mode for your bitcoin/altcoin payment box (show md5 hash calculation). Contact us
  • width
    Iframe html payment box width in pixels. Integer values. Default: 530
  • height
    Iframe html payment box height in pixels. Integer values. Default: 230

Notes: if you use the same public_key, orderID and userID in your multiple cryptocoin payment boxes on different your website pages and a user has made payment; a successful result for that user will be returned on all those pages (of course if period time not expired).


HTML Iframe Payment Box Example with cryptobox.js -

<html>
<head>
	<script src="cryptobox.js" type="text/javascript"></script>
</head>
<body>
	<div align="center" style="min-width:530px">
		<iframe id="box1913" style="border-radius:15px;border:1px solid #eee;padding:3px 6px;margin:10px;" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" width="530" height="230"></iframe>
	</div>
	<script type="text/javascript"> <!-- Amount $5.50 -->
		cryptobox_show(1514, 'bitcoin', '1514AAf8QICBitcoin77BTCPUB7XBxPbmc4uK79CCWHEB5DAmY', 0, 5.5, '60 MINUTE', 'en', 'box1913', 'user4', 'MANUAL', 'product1', '', '', 'f2cea21af212b8a60a1620bc46ea8f79', 530, 230);
	</script>
</body>
</html>


Result -







B. Instant Payment Notification/Callback


  • When a user has made a payment, our server will send payment data using HTTP POST method on your callback url specified in field Callback URL of your crypto payment box.
  • Your script, should check whether the payment box private key recieved in POST["private_key"] is correct. It will guarantee that payment data are valid and sent from our server.
  • You should publish result text on your callback webpage. Allow text - "Only POST Data Allowed", "cryptobox_newrecord", "cryptobox_updated", "cryptobox_nochanges"; it use for synchronise data store on our server with data on your website. No other text output on callback webpage! Example below.

Example of Your Callback Webpage -


Example in PHP. Simple convert that code to your own website language (ASP, Python, C#, etc). See full php version of script below here

<?
	$html = "";
	if (isset($_POST["status"]) && in_array($_POST["status"], array("payment_received", "payment_received_unrecognised")) &&
		$_POST["box"] && $_POST["box"] > 0 && $_POST["amount"] && $_POST["amount"] > 0 &&
		$_POST["private_key"] == "..place-here-your-paymentbox-private-key..")
		{
			// check if new payment; sql example
			$obj = run_sql("select paymentID, txConfirmed from my_payments where boxID = ".intval($_POST["box"])." && 
							orderID = '".addslashes($_POST["order"])."' && userID = '".addslashes($_POST["user"])."' && 
							txID = '".addslashes($_POST["tx"])."' limit 1"); 
			$paymentID		= ($obj) ? $obj->paymentID : 0;
			$txConfirmed	= ($obj) ? $obj->txConfirmed : 0; 
			
			// Save new payment details in your database
			if (!$paymentID)
			{
				// your code here; for example update user membership
				$html = "cryptobox_newrecord"; // don't change text; it use by gourl.io server
			}
			// Update record; payment confirmed
			elseif ($_POST["confirmed"] && !$txConfirmed)
			{
				// your code here
				$html = "cryptobox_updated"; // don't change text
			}
			else 
			{
				// your code here
				$html = "cryptobox_nochanges"; // don't change text
			}
		}
	else
		$html = "Only POST Data Allowed"; // don't change text
		
	echo $html;	
?>



$_POST DATA which will receive your website callback url


For example, your user with userID = user26 bought product with orderID = order15620A. Product price was 11.5 USD and user paid in Bitcoins.

If payment received with correct amount, function receive status = 'payment_received'. If incorrectly paid amount, the system can not recognize user; status = 'payment_received_unrecognised'

Your callback url receive POST data -
'user' - user who has made payment, 'order' current order ID,
'amount' = 0.0479166 BTC paid by User (~11.5 USD),
private_key - your private key for validation that data has been sent from Gourl Gateway Server
etc.

		
		I. IPN POST DATA (correct amount)
		{
			"status":"payment_received"
			"err":""
			"private_key":"1206lO6HX76cw9Bitcoin77DOGED82Y8eyBExZ9kZpX"
			"box":"120"
			"boxtype":"paymentbox"
			"order":"order15620A"
			"user":"user26"
			"usercountry":"USA"
			"amount":"0.0479166"
			"amountusd":"11.5"
			"coinlabel":"BTC"
			"coinname":"bitcoin"
			"addr":"14dt2cSbvwghDcETJDuvFGHe5bCsCPR9jW"
			"tx":"95ed924c215f2945e75acfb5650e28384deac382c9629cf0d3f31d0ec23db08d"
			"confirmed":0
			"timestamp":"1422624765	"
			"date":"30 January 2015"
			"datetime":"2015-01-30 13:32:45"
		}
		 



Or if User Has Made INCORRECT Payment (wrong amount) -


We use amount value of cryptocoins in the payment box with a small fraction after the decimal point to uniquely identify each of your users individually. If user pay wrong amount on your internal wallet address, GoUrl Gateway cannot identify that user. You need to process all unrecognised payments manually. We forward you ALL coins received on your internal wallet address/es including all payments with incorrect amounts (unrecognised payments).

POST DATA - User paid wrong/incorrect amount in 0.05 BTC to you -


		II. IPN POST DATA (wrong amount)
		{
			"status":"payment_received_unrecognised"
			"err":"An incorrect bitcoin amount has been received"
			"private_key":"1206lO6HX76cw9Bitcoin77DOGED82Y8eyBExZ9kZpX"
			"box":"120"
			"boxtype":"paymentbox"
			"order":""
			"user":""
			"usercountry":""
			"amount":"0.05"
			"amountusd":"12.26"
			"coinlabel":"BTC"
			"coinname":"bitcoin"
			"addr":"14dt2cSbvwghDcETJDuvFGHe5bCsCPR9jW"
			"tx":"6f1c6f34189a27446d18e25b9c79db78be55b0bb775b1768b5aa4520f27d71a8"
			"confirmed":0
			"timestamp":"1422623712"
			"date":"30 January 2015"
			"datetime":"2015-01-30 13:15:12"
		}
		 



POST Fields Description -


  • status - 'payment_received' (payment received with correct amount) or 'payment_received_unrecognised'
  • err - optional, error description
  • private_key - your private key for validation that data has been sent from Gourl Gateway Server
  • box - your cryptobox id, the same as on gourl.io member page
  • boxtype - 'paymentbox' or 'captchabox'
  • order - your order id
  • user - identifier for every user
  • usercountry - your user location country, 3 letter ISO country code
  • amount - paid cryptocurrency amount
  • amountusd - approximate paid amount in USD with exchange rate on datetime of payment made
  • coinlabel - cryptocurrency label
  • coinname - cryptocurrency name
  • addr - your internal wallet address on gourl.io which received this payment
  • tx - transaction id
  • confirmed - 0 - unconfirmed transaction/payment or 1 - confirmed transaction/payment with 6+ confirmations
  • timestamp - transaction timestamp (GMT time)
  • date - transaction date (GMT time)
  • datetime - transaction datetime (GMT time)



Usually your callback url will automatically appear for each new payment two times :

  • a) when a new payment is received and unconfirmed yet, values: POST[confirmed] = 0, etc.
  • b) and a second time when existing payment is confirmed (6+ confirmations) with values: POST[confirmed] = 1, etc. All other values are the same.

But sometimes if the payment notification is delayed for 20-30min (for example, your site was unavailable and GoUrl Gateway auto re-send data later), the payment/transaction will already be confirmed and the function will appear once with values: POST[confirmed] = 1, etc.




Testing environment -


You can use 110 free Speedcoins or Dogecoins for testing. The minimum account balance on GoUrl.io which our system will automatically transfer from your GoUrl internal wallet address to your external wallet address is 2 x mining fee. For Bitcoin this is 0.0005 BTC, and for Speedcoin and Dogecoin it is 5 coins, etc










CONTACT US


We offer Free Support in the integration of our GoUrl Crypto Payment Gateway in your scripts/plugins/website.

Please feel free to contact us if you have any questions

Contact Us











January 2017
Back to Top