Inquiry

Request*

Here is an example of how to send an inquiry request to the OpenAPI system.

The body for the token is defined below

ParameterTypeMandatoryDescription
partnerIdSTRINGYesPartner API key provided
accountNumberSTRINGYesThe account number for which the inquiry is being done.
productCodeSTRINGYesThe product code provided
amountINTYes / NoIt will be based on the category
zoneIdSTRINGNoThe zoneId is required for the Games Voucher category.
monthINTNoThe 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

ParameterTypeDescription
responseCodeINTStatus of the payment request. Refer to the Response code section/document for more details
successBOOLEANStatus of Inquiry
messageJSONMessages in Bahasa and English describing the RC above.
dataJSONThe main payload with the Bill details.

DATA OBJECT

ParameterTypeDescription
inquiryIdINTInquiry ID generated by OpenAPI which is used towards payment.
accountNumberSTRINGThe account number / IDPEL / Email address towards the payment.
productCode STRINGThe product code sent by the partner toward the transaction
customerNameSTRINGThe name of the customer whose bill/payment is done.
productNameSTRINGName of the Brand and Product whose inquiry is being done.
categorySTRINGCategory of the product
amountINTThe final amount to be paid for the product/bill. This amount already includes the Total Admin Fee.
totalAdminINTTotal Administrative charges.
processingFeeINTAdditional processing fee that is added on behalf of the partner towards its customers
validitySTRINGValidity of the product if available.
customerDetailsJSON nested objectKey / Value structure nest JSON object. This object provides customer-specific details regarding the bill.
billDetailsJSON nested objectKey / Value structure nest JSON object. This object provides bill-specific details regarding the bill. More details about this section below
productDetailsJSON nested objectKey / Value structure nest JSON object. This object provides product-specific details regarding the bill.
extraFieldsJSON nested objectKey / 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.

ParameterTypeDescription
billIDSTRINGID of the individual bill item. If 0, Bill item cannot be skipped in payment.
billInfoJSON ObjectKey / 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