Cancelation

📘

  • Cancel API can not be applied to all product categories
  • Products that have Cancel API can be checked in Categories Response

Request

Here are examples of how to send a cancel request to the OpenAPI system.

The body for the token is defined below

ParameterTypeMandatoryDescription
partnerIdSTRINGYesPartner API key provided
account_NumberSTRINGYesenrollmentId which was received in the callback enrollment
ref_numberSTRINGYesPartner ref_number sent in enrollment request

Sample Inquiry request

curl -X POST 
{api-url}/api/v2/bill/cancel 
-H 'cache-control: no-cache' 
-H 'content-type: application/json' 
-H 'key: test-key' 
-H 'token: token' 
-H 'version: 2.0'
package main
import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)
func main() {
    url := "{api-url}/api/v2/bill/cancel"
    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/cancel",
  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/cancel",
  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": "ayopop",
    "account_number": "43554",
    "ref_number": "5324354"
}

Sample Inquiry Response (Prepaid) - Success

{
    "responseCode": 600,
    "success": true,
    "message": {
        "ID": "Pembatalan Sukses",
        "EN": "Cancellation Successful"
    },
    "data": {
        "refNumber": "2074134",
        "transactionId": 0,
        "accountNumber": "0812300001",
        "amount": 1000,
        "totalAdmin": 0,
        "processingFee": 0,
        "denom": "",
        "productCode": "PPLSTEK1",
        "productName": "Rp. 1.000",
        "category": "",
        "token": "",
        "customerDetails": [],
        "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
accountNumberSTRINGThe enrollmentId which was received in the callback enrollment
productCode STRINGThe product code sent by the partner towards the transaction
productNameSTRINGName of the Brand and Product whose inquiry is being done.
categorySTRINGCategory of the product
amountINTFinal amount to be paid for the product / bill. This amount already includes Total Admin Fee.
totalAdminINTTotal Administrative charges.
processingFeeINTAdditional processing fee that is added on behalf of the partner towards its customers
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.