Top Up
API to top up prepaid products.
A thing to know
- For the first time, top up will always response PROCESSING. IDSL 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 | api/top-up |
Request Body
| Attributes | Type | Description | Mandatory |
|---|---|---|---|
| username | String | Your registered phone number | Yes |
| ref_id | String | Your order number / reference ID ( must unique ) | Yes |
| customer_id | String | Customer ID. Supports test case numbers in the last 8 digits for sandbox | Yes |
| product_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)
- voucher: Random Number with format 08xxx (12 digits)
- esim-international: Random Number with format 08xxx (12 digits)
- 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. - international: For international products, especially Alipay, the phone number format is CountryCode_PhoneNumber|Name example 62|62812345678_IDSL.
{
"username" : "123123123",
"ref_id" : "order001",
"customer_id" : "0817777215",
"product_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 |
| product_code | String | Product Code | Yes |
| customer_id | 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,
"product_code": "xld25000",
"customer_id": "0817777215",
"price": 25000,
"message": "PROCESS",
"balance": 997061249,
"tr_id": 3482,
"rc": "39"
}
}
Live Testing
Request URL
https://prepaid.iak.dev/api/top-up
Request Method
Request Header
Content-Type: application/json
Body
Result
Table of Contents