Request*
Here is an example of how to send an inquiry request to the OpenAPI system.
The body for the token is defined below
Parameter | Type | Mandatory | Description |
---|---|---|---|
partnerId | STRING | Yes | Partner API key provided |
accountNumber | STRING | Yes | The account number for which the inquiry is being done. |
productCode | STRING | Yes | The product code provided |
amount | INT | Yes / No | It will be based on the category |
zoneId | STRING | No | The zoneId is required for the Games Voucher category. |
month | INT | No | The month is required for the BPJS category. Specify the number of months for which inquiry is to be done. |
Sample Inquiry request
curl --location --request POST '{api-url}/api/v2/bill/check' \
--header 'KEY: UP0t6fB4qZ7j' \
--header 'VERSION: 2.0' \
--header 'Content-Type: application/json' \
--header 'Token: token'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "{api-url}/api/v2/bill/check"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("accept", "application/json")
req.Header.Add("KEY", "API Key")
req.Header.Add("TOKEN", "token")
req.Header.Add("VERSION", "2.0")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Cache-Control", "no-cache")
req.Header.Add("Accept-Encoding", "gzip, deflate")
req.Header.Add("Content-Length", "2")
req.Header.Add("Connection", "keep-alive")
req.Header.Add("cache-control", "no-cache")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "{api-url}/api/v2/bill/check",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{}",
CURLOPT_HTTPHEADER => array(
"Accept-Encoding: gzip, deflate",
"Cache-Control: no-cache",
"Connection: keep-alive",
"Content-Length: 2",
"Content-Type: application/json",
"KEY: API Key",
"TOKEN: token",
"VERSION: 2.0",
"accept: application/json",
"cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
var settings = {
async: true,
crossDomain: true,
url: "{api-url}/api/v2/bill/check",
method: "POST",
headers: {
accept: "application/json",
KEY: "API Key",
TOKEN:"token",
VERSION: "2.0",
Content-Type: "application/json",
Cache-Control: "no-cache",
Accept-Encoding: "gzip, deflate",
Content-Length: "2",
Connection: "keep-alive",
cache-control: "no-cache"
},
processData: false,
data: "{}"
};
$.ajax(settings).done(function(response) {
console.log(response);
});
Sample Inquiry body payload
{
"partnerId": "partner-id",
"productCode": "product-code",
"accountNumber": "811081215474224"
}
Sample Inquiry Response (Prepaid) - Success
{
"responseCode": 300,
"success": true,
"message": {
"ID": "Inkuiri berhasil",
"EN": "Inquiry is successful"
},
"data": {
"inquiryId": 626479,
"accountNumber": "0814111111200",
"customerName": "",
"productName": "product-name",
"productCode": "product-code",
"category": "Pulsa",
"amount": 25100,
"totalAdmin": 0,
"processingFee": 0,
"denom": "",
"validity": "",
"customerDetail": [],
"billDetails": [],
"productDetails": [],
"extraFields": []
}
}
Sample Inquiry Response (Prepaid) - Failed
{
"responseCode": 313,
"success": false,
"message": {
"ID": "The inquiry amount must be greater than the minimum plus admin fees",
"EN": "The inquiry amount must be greater than the minimum plus admin fees"
},
"data": {
"inquiryId": 1919706,
"accountNumber": "06285714208600",
"customerName": "",
"productName": "product-name",
"productCode": "product-code",
"category": "Pulsa",
"amount": 25100,
"totalAdmin": 0,
"processingFee": 0,
"denom": "",
"validity": "",
"customerDetail": [],
"billDetails": [],
"productDetails": [],
"extraFields": []
}
}
TOP LEVEL
Parameter | Type | Description |
---|---|---|
responseCode | INT | Status of the payment request. Refer to the Response code section/document for more details |
success | BOOLEAN | Status of Inquiry |
message | JSON | Messages in Bahasa and English describing the RC above. |
data | JSON | The main payload with the Bill details. |
DATA OBJECT
Parameter | Type | Description |
---|---|---|
inquiryId | INT | Inquiry ID generated by OpenAPI which is used towards payment. |
accountNumber | STRING | The account number / IDPEL / Email address towards the payment. |
productCode | STRING | The product code sent by the partner toward the transaction |
customerName | STRING | The name of the customer whose bill/payment is done. |
productName | STRING | Name of the Brand and Product whose inquiry is being done. |
category | STRING | Category of the product |
amount | INT | The final amount to be paid for the product/bill. This amount already includes the Total Admin Fee. |
totalAdmin | INT | Total Administrative charges. |
processingFee | INT | Additional processing fee that is added on behalf of the partner towards its customers |
validity | STRING | Validity of the product if available. |
customerDetails | JSON nested object | Key / Value structure nest JSON object. This object provides customer-specific details regarding the bill. |
billDetails | JSON nested object | Key / Value structure nest JSON object. This object provides bill-specific details regarding the bill. More details about this section below |
productDetails | JSON nested object | Key / Value structure nest JSON object. This object provides product-specific details regarding the bill. |
extraFields | JSON nested object | Key / Value structure nest JSON object. This object provides additional details regarding the bill. |
BILL DETAILS OBJECT
Each billDetails
object has a structure like defined below. Each object will have abillId
parameter, which if applicable will be the bill Item ID, which corresponds to an individual bill.
Parameter | Type | Description |
---|---|---|
billID | STRING | ID of the individual bill item. If 0 , Bill item cannot be skipped in payment. |
billInfo | JSON Object | Key / Value pair of the item details with name and amount. |
**Note: All the above responses are for a specific category and Responses may vary based on the categories.
For the category-specific response please refer to