Top Up

API to top up prepaid products.

A thing to know

  1. For the first time, top up will always response PROCESSING. IAK will send callback once the transaction become > success / failed. Learn more about callback here
  2. If you top up again with the same ref_id, then it we will not proceed the transaction but it will become check status. Learn more about check status here

Path

MethodPath
POSTapi/top-up

Request Body

AttributesTypeDescriptionMandatory
usernameStringYour registered phone numberYes
ref_idStringYour order number / reference ID ( must unique )Yes
customer_idStringCustomer IDYes
product_codeStringProduct Code. You can get list of product code in pricelist api or from pricelist hereYes
signStringSignature. Value: md5(username+api_key+ref_id)Yes

A thing to know

Here is the customer_id for each product type:

  1. pulsa: Phone Number / MSISDN
  2. data: Phone Number / MSISDN
  3. pln: Meter Number (11 digits)
  4. games: Phone Number for games voucher (we don't send SMS) / Game ID for direct topup. See here for direct topup Game ID.
    Notes: for Steam Sea products, the customer_id format is 081xxx.
  5. international: For international products, especially Alipay, the phone number format is CountryCode_PhoneNumber|Name example 62|62812345678_IAK.


{
  "username"      : "123123123",
  "ref_id"        : "order001",
  "customer_id"   : "0817777215",
  "product_code"  : "xld25000",
  "sign"          : "96e1028f6beaa817ee3670a39c01c69d"
}
<?xml version="1.0" ?>
<mp>
  <username>123123123</username>
  <ref_id>order001</ref_id>
  <customer_id>0817777215</customer_id>
  <product_code>xld25000</product_code>
  <sign>96e1028f6beaa817ee3670a39c01c69d</sign>
</mp>

Response

AttributesTypeDescriptionMandatory
ref_idStringYour order number / reference ID ( must unique )Yes
statusDoubleTransaction Status. List of status:
0:PROCESS 1:SUCCESS 2:FAILED
Yes
product_codeStringProduct CodeYes
customer_idStringCustomer IDYes
priceDoubleProduct priceYes
messageStringMessageYes
balanceDoubleFinal BalanceYes
tr_idIntegerTransaction IDYes
rcStringResponse code. See response code listYes
{
  "data": {
    "ref_id": "order001",
    "status": 0,
    "product_code": "xld25000",
    "customer_id": "0817777215",
    "price": 25000,
    "message": "PROCESS",
    "balance": 997061249,
    "tr_id": 3482,
    "rc": "39"
  }
}
<?xml version="1.0" ?>
<mp>
  <ref_id>order001</ref_id>
  <status>0</status>
  <product_code>xld25000</product_code>
  <customer_id>0817777215</customer_id>
  <price>25000</price>
  <message>PROCESS</message>
  <balance>69000</balance>
  <tr_id>6159309</tr_id>
  <rc>39</rc>
</mp>

Live Testing

Request URL
https://prepaid.iak.dev/api/top-up
Request Method
Request Header
Content-Type: application/json
Body
Result

Tutorial Video

You can see this video for top up code explanation using Laravel.

Or you can see this video for top up code explanation using PHP.