Top Up
API to top up prepaid products.
A thing to know
- 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
- 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
Method | Path |
---|---|
POST | v1/legacy/index |
Request Body
Attributes | Type | Description | Mandatory |
---|---|---|---|
commands | String | Value: topup | Yes |
username | String | Your registered phone number | Yes |
ref_id | String | Your order number / reference ID ( must unique ) | Yes |
hp | String | Customer ID | Yes |
pulsa_code | String | Product Code. You can get list of product code in pricelist api or from pricelist here | Yes |
sign | String | Signature. Value: md5(username+api_key+ref_id) | Yes |
A thing to know
Here is the customer ID for each product type:
- pulsa: Phone Number / MSISDN
- data: Phone Number / MSISDN
- pln: Meter Number (11 digits)
- 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. - subcsriber number for tv
- 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"
}
Response
Attributes | Type | Description | Mandatory |
---|---|---|---|
ref_id | String | Your order number / reference ID ( must unique ) | Yes |
status | Double | Transaction Status. List of status: 0:PROCESS 1:SUCCESS 2:FAILED | Yes |
code | String | Product Code | Yes |
hp | String | Customer ID | Yes |
price | Double | Product price | Yes |
message | String | Message | Yes |
balance | Double | Final Balance | Yes |
tr_id | Integer | Transaction ID | Yes |
rc | String | Response code. See response code list | Yes |
{
"data": {
"ref_id": "order001",
"status": 0,
"code": "xld25000",
"hp": "0817777215",
"price": 25000,
"message": "PROCESS",
"balance": 997061249,
"tr_id": 3482,
"rc": "39"
}
}
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.
Table of Contents