🚧

Any RC outside the range of 0-399 (timeout, bad gateway, etc) should be considered as "processing" and It requires the partner to hit API status after 150 seconds.

Endpoint
https://XXXXXX.XXXXXX.XXXXX.id/api/v2/bill/payment

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

Sample Payment request

curl --location --request POST 'https://XXXXXX.XXXXXX.XXXXX.id/api/v2/bill/payment' \
--header 'KEY: UP0t6fB4qZ7j' \
--header 'TOKEN: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXJ0bmVySWQiOiJVUDB0NmZCNHFaN2oiLCJwcm9kdWN0Q29kZSI6IlBQTFNUSzEwIiwiYWNjb3VudE51bWJlciI6IjA4MTI2NTUyNjUyIiwiaW5xdWlyeUlkIjoxNDMxNDYxNzMsImFtb3VudCI6MTA1NTAsImNhbGxiYWNrVXJscyI6WyJodHRwczovL3dlYmhvb2suc2l0ZS8yYjgzNmI3ZS0xNWYzLTQ4NGItYTQxMC0wODkyYTI4N2NhZmYiXSwicmVmTnVtYmVyIjoicHJkdGVzdHRkMTEzNDUifQ.9msTNlH6YXf5tDB-Tvmeg3-0ybRg2Arxgec9kpySbhg' \
--header 'VERSION: 2.0' \
--header 'Content-Type: application/json'
package main
import (
    "fmt"
    "net/http"
    "io/ioutil"
)
func main() {
    url := "https://dev.openapi.ayopop.id/api/v1/bill/payment"
    req, _ := http.NewRequest("POST", url, nil)
    req.Header.Add("accept", "application/json")
    req.Header.Add("KEY", "API Key")
    req.Header.Add("TOKEN", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpbnF1aXJ5SWQiOjMxMTgyLCJhY2NvdW50TnVtYmVyIjoiMDgxMzM5MzcyMzg5IiwicHJvZHVjdENvZGUiOiJQTFRLMTEiLCJhbW91bnQiOjExMDAwLCJyZWZOdW1iZXIiOiIxMTIzMzIyMjMzZmcxMiIsInBhcnRuZXJJZCI6InBhcnRuZXJfYXBpX2tleSIsImJ1eWVyRGV0YWlscyI6eyJidXllckVtYWlsIjoidGVzdEBnbWFpbC5jb20iLCJwdWJsaWNCdXllcklkIjoiMTEyMjQ1N0hHMjMifSwiQ2FsbGJhY2tVcmxzIjpbImh0dHBzOi8vd2ViaG9vay5zaXRlL2U2N2ZiN2E5LWY0YWUtNDBhMy1hN2RmLTJmYjQyZTQ4MDAyZSJdfQ.nPLObDgqhSlnIMXfEXW_y7m56YZwp8TVR3CgpNnIRUQ")
    req.Header.Add("VERSION", "1.0")
    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("Cache-Control", "no-cache")
    req.Header.Add("Host", "dev.openapi.ayopop.id")
    req.Header.Add("Accept-Encoding", "gzip, deflate")
    req.Header.Add("Content-Length", "")
    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 => "https://dev.openapi.ayopop.id/api/v1/bill/payment",
  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: ",
    "Content-Type: application/json",
    "Host: dev.openapi.ayopop.id",
    "KEY: API Key",
    "TOKEN: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpbnF1aXJ5SWQiOjMxMTgyLCJhY2NvdW50TnVtYmVyIjoiMDgxMzM5MzcyMzg5IiwicHJvZHVjdENvZGUiOiJQTFRLMTEiLCJhbW91bnQiOjExMDAwLCJyZWZOdW1iZXIiOiIxMTIzMzIyMjMzZmcxMiIsInBhcnRuZXJJZCI6InBhcnRuZXJfYXBpX2tleSIsImJ1eWVyRGV0YWlscyI6eyJidXllckVtYWlsIjoidGVzdEBnbWFpbC5jb20iLCJwdWJsaWNCdXllcklkIjoiMTEyMjQ1N0hHMjMifSwiQ2FsbGJhY2tVcmxzIjpbImh0dHBzOi8vd2ViaG9vay5zaXRlL2U2N2ZiN2E5LWY0YWUtNDBhMy1hN2RmLTJmYjQyZTQ4MDAyZSJdfQ.nPLObDgqhSlnIMXfEXW_y7m56YZwp8TVR3CgpNnIRUQ",
    "VERSION: 1.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: "https://dev.openapi.ayopop.id/api/v1/bill/payment",
  method: "POST",
  headers: {
    accept: "application/json",
    KEY: "API Key",
    TOKEN:
      "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpbnF1aXJ5SWQiOjMxMTgyLCJhY2NvdW50TnVtYmVyIjoiMDgxMzM5MzcyMzg5IiwicHJvZHVjdENvZGUiOiJQTFRLMTEiLCJhbW91bnQiOjExMDAwLCJyZWZOdW1iZXIiOiIxMTIzMzIyMjMzZmcxMiIsInBhcnRuZXJJZCI6InBhcnRuZXJfYXBpX2tleSIsImJ1eWVyRGV0YWlscyI6eyJidXllckVtYWlsIjoidGVzdEBnbWFpbC5jb20iLCJwdWJsaWNCdXllcklkIjoiMTEyMjQ1N0hHMjMifSwiQ2FsbGJhY2tVcmxzIjpbImh0dHBzOi8vd2ViaG9vay5zaXRlL2U2N2ZiN2E5LWY0YWUtNDBhMy1hN2RmLTJmYjQyZTQ4MDAyZSJdfQ.nPLObDgqhSlnIMXfEXW_y7m56YZwp8TVR3CgpNnIRUQ",
    VERSION: "1.0",
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    Host: "dev.openapi.ayopop.id",
    "Accept-Encoding": "gzip, deflate",
    "Content-Length": "",
    Connection: "keep-alive",
    "cache-control": "no-cache"
  },
  processData: false,
  data: ""
};
$.ajax(settings).done(function(response) {
  console.log(response);
});

Sample Payment body payload

{
  "inquiryId": 31182,
  "accountNumber": "081339372389",
  "productCode": "PLTK11",
  "amount": 11000,
  "refNumber": "1123322233fg12",
  "partnerId": "partner_api_key",
  "buyerDetails": {
    "buyerEmail": "[email protected]",
    "publicBuyerId": "1122457HG23",
    "phoneNumber": "081339372389" 
  },
  "CallbackUrls": [
    "https://XXXXXX.XXXXXXX/XXXXXX-XXXX-XX-XXXX-XXXXXXXXX"
  ]
}

The body for the token is defined below

ParameterTypeMandatoryDescription
partnerIdSTRINGYesPartner API key provided
accountNumberSTRINGYesThe account number for which payment is being done.
productCodeSTRINGYesThe product code provided
inquiryIdINTYesThe ID of the inquiry for which the payment is being done. This has to be a previously done successful inquiry.
amountINTYesThe amount of the bill to be paid. This amount has to match the product price or a valid bill amount.
refNumberSTRINGYesA unique reference number provided by the partner towards each payment. One ref number can only be used towards one payment request.
MonthINTNoIt is required for BPJS category. Specify the number of months for which payment is to be done.
billIdsARRAYNoIt is required for Edukasi category.Send the billIds for which payment is to be done.
buyerDetailsJSON OBJECTNoThis is an additional functionality provided where users will receive email of transaction details for success transactions.
callbackUrlsARRAYNoSpecify list of Callback Urls for receiving payment response

Sample Payment Response(Prepaid) - Processing

{
    "responseCode": 299,
    "success": true,
    "message": {
        "ID": "Transaksi sedang dalam proses",
        "EN": "Your transaction is being processed"
    },
    "data": {
        "refNumber": "pldny_005",
        "transactionId": 49656,
        "accountNumber": "0822300005",
        "amount": 1000,
        "totalAdmin": 0,
        "processingFee": 0,
        "denom": "",
        "productCode": "PLSTK01",
        "productName": "Telkomsel Pulsa",
        "category": "Pulsa",
        "token": "",
        "customerDetails": [],
        "billDetails": [],
        "productDetails": [],
        "extraFields": []
    }
}

Sample Payment Response(Prepaid) - Success

{
    "responseCode": 4,
    "success": true,
    "message": {
        "ID": "Transaksi Anda Telah Berhasil",
        "EN": "Your transaction was successful"
    },
    "data": {
        "refNumber": "art_55",
        "transactionId": 52722,
        "accountNumber": "0814111111200",
        "amount": 25100,
        "totalAdmin": 0,
        "processingFee": 0,
        "denom": "",
        "productCode": "PLSPRIDA25K",
        "productName": "Indosat Pulsa 25.000",
        "category": "Pulsa",
        "token": "1908202085666581",
        "customerDetails": [
            {
                "key": "Nama Pelanggan",
                "value": "N/A"
            },
            {
                "key": "Waktu & Tanggal Pembayaran",
                "value": "05 May 2021 | 19:58"
            },
            {
                "key": "Nomor Kontrak",
                "value": "0814111111200"
            }
        ],
        "billDetails": [],
        "productDetails": [
            {
                "key": "SN Number",
                "value": "1908202085666581"
            }
        ],
        "extraFields": []
    }
}

Sample Payment Response(Prepaid) - Failed

{
    "responseCode": 199,
    "success": false,
    "message": {
        "ID": "Transaction has failed.Please try again.",
        "EN": "Transaction has failed.Please try again."
    },
    "data": {
        "refNumber": "la004",
        "transactionId": 42080,
        "accountNumber": "82330289494",
        "amount": 10000,
        "totalAdmin": 0,
        "processingFee": 0,
        "denom": "",
        "productCode": "LAEM10",
        "productName": "LinkAja Rp 10.000",
        "category": "eMoney",
        "token": "N/A",
        "customerDetails": [],
        "billDetails": [],
        "productDetails": [],
        "extraFields": []
    }
}

Sample Payment Response(Postpaid) - Processing

{
    "responseCode": 299,
    "success": true,
    "message": {
        "ID": "Transaksi sedang dalam proses",
        "EN": "Your transaction is processing"
    },
    "data": {
        "refNumber": "3475853745WE24",
        "transactionId": 8840,
        "accountNumber": "044123123000564",
        "amount": 3999700,
        "totalAdmin": 7500,
        "processingFee": 200,
        "productCode": "PASF",
        "productName": "Smart Finance",
        "category": "Pembayaran Angsuran",
        "token": "",
        "customerDetails": [],
        "billDetails": [],
        "productDetails": [],
        "extraFields": []
    }
}

Below are details for each field and the value type.

TOP LEVEL

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

DATA OBJECT

ParameterTypeDescription
refNumberSTRINGThis is the reference number sent by partner. Unique per payment.
transactionIdINTThe transaction ID of OpenAPI.
accountNumberSTRINGThe account number / IDPEL / Email address towards the payment.
productCodeSTRINGThe product code sent by partner towards the transaction
customerNameSTRINGThe name of the customer whose bill / payment is done.
productNameSTRINGName of the Brand and Product whose payment 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
validitySTRINGValidity of the product if available.
tokenSTRINGIt is the reference number recieved on successful recharge.
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 billID parameter, which if applicable will be the bill Item ID, corresponding 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 Categorised Response