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
POSTv1/legacy/index

Request Body

AttributesTypeDescriptionMandatory
commandsStringValue: topupYes
usernameStringYour registered phone numberYes
ref_idStringYour order number / reference ID ( must unique )Yes
hpStringCustomer IDYes
pulsa_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: MSISDN for games voucher (we don't send SMS). See here for example.
    Notes: for Steam Sea products, the customer_id format is 081xxx.
  5. subcsriber number for tv
  6. international: For international products, especially Alipay, the phone number format is CountryCode_PhoneNumber|Name example 62|62812345678_IAK.


{
  "commands"   : "topup",
  "username"   : "123123123",
  "ref_id"     : "order001",
  "hp"         : "0817777215",
  "pulsa_code" : "xld25000",
  "sign"       : "96e1028f6beaa817ee3670a39c01c69d"
}
<?xml version="1.0" ?>
<mp>
  <commands>topup</commands>
  <username>123123123</username>
  <ref_id>order001</ref_id>
  <hp>0817777215</hp>
  <pulsa_code>xld25000</pulsa_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
codeStringProduct CodeYes
hpStringCustomer IDYes
priceDoubleProduct priceYes
messageStringMessageYes
balanceDoubleFinal BalanceYes
tr_idIntegerTransaction IDYes
rcStringResponse code. See response code listYes
{
  "data": {
    "ref_id": "order001",
    "status": 0,
    "code": "xld25000",
    "hp": "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>
  <code>xld25000</code>
  <hp>0817777215</hp>
  <price>25000</price>
  <message>PROCESS</message>
  <balance>69000</balance>
  <tr_id>6159309</tr_id>
  <rc>39</rc>
</mp>

Live Testing

Request URL
https://testprepaid.mobilepulsa.net/v1/legacy/index
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.