Google Play Gift-card API

We provide Google play recharge code (Gift card) which can be used for purchasing various products or for making in-app purchases


To use this API, you need an API key.
Please login to your account and navigate to dashboard > API configuration

Learn how to authenticate the APIs.

Initiate New Transaction

Use the below endpoint to initiate a new transaction (Ippocloud supported Countries: india)

/voucher/google-play/initiate-transaction
curl -X POST https://ippocloud.com/api/v1
/voucher/google-play/initiate-transaction
-H "Authorization: Basic bGl2ZV82MzAzZT...."
-H "Content-Type: application/json"
-d "{\"amount\":\"100\", \"customer_email\":\"team@ippocloud.com\",
\"reference_id\":\"Vk2BIsM5aTwk2\"}"
$url = "https://ippocloud.com/api/v1
/voucher/google-play/initiate-transaction";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$headers = array(
   "Authorization: Basic bGl2ZV82MzAzZT....",
   "Content-Type: application/json",
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$data = '{"amount":"100", "customer_email":"team@ippocloud.com",
"reference_id":"Vk2BIsM5aTwk2"}';
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);
var url = "https://ippocloud.com/api/v1
/voucher/google-play/initiate-transaction";
var xhr = new XMLHttpRequest();
xhr.open("POST", url);
xhr.setRequestHeader("Authorization", "Basic bGl2ZV82MzAzZT....");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.onreadystatechange = function () {
   if (xhr.readyState === 4) {
      console.log(xhr.status);
      console.log(xhr.responseText);
   }};
var data = '{"amount":"100", "customer_email":"team@ippocloud.com",
"reference_id":"Vk2BIsM5aTwk2"}';
xhr.send(data);
import requests
from requests.structures import CaseInsensitiveDict
url = "https://ippocloud.com/api/v1
/voucher/google-play/initiate-transaction"
headers = CaseInsensitiveDict()
headers["Authorization"] = "Basic bGl2ZV82MzAzZT...."
headers["Content-Type"] = "application/json"
data = '{"amount":"100", "customer_email":"team@ippocloud.com",
"reference_id":"Vk2BIsM5aTwk2"}'
resp = requests.post(url, headers=headers, data=data)
print(resp.status_code)
URL url = new URL("https://ippocloud.com/api/v1
/voucher/google-play/initiate-transaction");
HttpURLConnection http = (HttpURLConnection)url.openConnection();
http.setRequestMethod("POST");
http.setDoOutput(true);
http.setRequestProperty("Authorization", "Basic bGl2ZV82MzAzZT....");
http.setRequestProperty("Content-Type", "application/json");
String data = "{\"amount\":\"100\", \"customer_email\":\"team@ippocloud.com\",
\"reference_id\":\"Vk2BIsM5aTwk2\"}";
byte[] out = data.getBytes(StandardCharsets.UTF_8);
OutputStream stream = http.getOutputStream();
stream.write(out);
System.out.println(http.getResponseCode() + " " + http.getResponseMessage());
http.disconnect();
var url = "https://ippocloud.com/api/v1
/voucher/google-play/initiate-transaction";
var httpRequest = (HttpWebRequest)WebRequest.Create(url);
httpRequest.Method = "POST";
httpRequest.Headers["Authorization"] = "Basic bGl2ZV82MzAzZT....";
httpRequest.ContentType = "application/json";
var data = "{\"amount\":\"100\", \"customer_email\":\"team@ippocloud.com\",
\"reference_id\":\"Vk2BIsM5aTwk2\"}";
using (var streamWriter = new StreamWriter(httpRequest.GetRequestStream()))
{
   streamWriter.Write(data);
}
var httpResponse = (HttpWebResponse)httpRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
   var result = streamReader.ReadToEnd();
}
Console.WriteLine(httpResponse.StatusCode);
{
    "data": {
        "entity": "googleplay_voucher",
        "transaction_id": 76534823,
        "operator": "Google Play",
        "type": "VOUCHER",
        "bill_amount": "₹100.00",
        "discount": "₹0.00",
        "paid": "₹100.00",
        "customer_email": "team@ippocloud.com",
        "transaction_status": "SUCCESS",
        "redeem_code": XXXX-XXXX-XXXX-XXXX,
        "reference_id": "Vk2BIsM5aTwk2",
        "datetime": "2018-10-17 01:40:56"
    }
}

Request parameters

amount

mandatory

integer Voucher amount

customer_email

optional

string Optionally provide your customer email for code delivery

reference_id

optional

string a unique identifier assigned for the transaction by client.

Response Parameters

data

object contains all the details such entity, transaction_id, operator, type, redeem code

entity

string something that exists separately from something else and has its own identity

transaction_id

integer Unique transaction ID assigned by system for every transaction

operator

string Operator name

type

string Transaction type VOUCHER

bill_amount

string Voucher amount

discount

string Discount is an amount that you've received for making this transaction

paid

string Net amount that you've paid for this transaction after subtracted discount amount with bill amount

customer_email

string Customer email

transaction_status

string Returns the transaction status

  • SUCCESS

  • PENDING

  • FAILED

redeem_code

string voucher redeem code. XXXX-XXXX-XXXX-XXXX

reference_id

string a unique identifier assigned for the transaction by client

datetime

string current datetime of the transaction

Webhook

Webhooks let you build or set up integrations that subscribe to certain events. When one of these events is triggered, we send an HTTP POST payload in JSON to the webhook's configured URL

To configure WebhooK URL, Please login to your account and navigate to dashboard > API configuration

Whenever the transaction status changed from PENDING to SUCCESS or FAILED, we will send an HTTP POST payload in JSON to the webhook's configured URL

Sample webhook JSON payload

Webhooks deliver the responses to your configured URL in JSON format. here's what a complete payload looks like when it's delivered to a webhook:

{
    "data": {
        "entity": "webhook",
        "webhook_event": "event.googleplay_voucher",
        "webhook_password": "UzmyhfRVBAL0RAG",
        "payload": {
            "entity": "googleplay_voucher",
            "transaction_id": 76534823,
            "operator": "Google Play",
            "type": "VOUCHER",
            "bill_amount": "₹100.00",
            "discount": "₹0.00",
            "paid": "₹100.00",
            "customer_email": "team@ippocloud.com",
            "transaction_status": "SUCCESS",
            "redeem_code": "XXXX-XXXX-XXXX-XXXX",
            "reference_id": "Vk2BIsM5aTwk2",
            "datetime": "2018-10-17 01:40:56"
        }
    }
}
Do you need help to implement this API? contact us