Endpoint

https://XXX.XXXXXXX.XXXXXX.id/api/v2/partner/balance

Request

Here is examples of how to send a check balance request to the OpenAPI system.

A Sample fetch balance request

curl -X POST/ https://XXX.XXXXX.XXXX.id/api/v2/partner/balance 
  -H 'Content-Type: application/json' 
  -H 'KEY: API Key' 
  -H 'TOKEN: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiJheW9wb3AifQ.rvAJRJYqxAM8tMlE3yiw8-fECIQfy7ZXknxfapR-cFc' 
  -H 'VERSION: 1.0' 
  -H 'accept: application/json' 
  -H 'cache-control: no-cache'
package main
import (
    "fmt"
    "net/http"
    "io/ioutil"
)
func main() {
    url := "https://dev.openapi.ayopop.id/api/v1/partner/balance"
    req, _ := http.NewRequest("POST", url, nil)
    req.Header.Add("accept", "application/json")
    req.Header.Add("KEY", "API Key")
    req.Header.Add("TOKEN", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiI3MGE4YjE3Zi02ZDkwLTRlMjYtYjZmMC02OTJkOWI1ODFhZDgiLCJhY2NvdW50TnVtYmVyIjoiNTQ3MTAyOTAxNTAwIiwiYW1vdW50IjoxOTU4OTYsInByb2R1Y3RDb2RlIjoiVExQUCIsInJlZk51bWJlciI6IjY1NDkiLCJpbnF1aXJ5SWQiOjMwNTd9.sPbm__SsSFhD3dkTybTY8o19RMopgG5vYYfsac7a2m8")
    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/partner/balance",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  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: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiI3MGE4YjE3Zi02ZDkwLTRlMjYtYjZmMC02OTJkOWI1ODFhZDgiLCJhY2NvdW50TnVtYmVyIjoiNTQ3MTAyOTAxNTAwIiwiYW1vdW50IjoxOTU4OTYsInByb2R1Y3RDb2RlIjoiVExQUCIsInJlZk51bWJlciI6IjY1NDkiLCJpbnF1aXJ5SWQiOjMwNTd9.sPbm__SsSFhD3dkTybTY8o19RMopgG5vYYfsac7a2m8",
    "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/partner/balance",
  method: "POST",
  headers: {
    accept: "application/json",
    KEY: "API Key",
    TOKEN:
      "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiI3MGE4YjE3Zi02ZDkwLTRlMjYtYjZmMC02OTJkOWI1ODFhZDgiLCJhY2NvdW50TnVtYmVyIjoiNTQ3MTAyOTAxNTAwIiwiYW1vdW50IjoxOTU4OTYsInByb2R1Y3RDb2RlIjoiVExQUCIsInJlZk51bWJlciI6IjY1NDkiLCJpbnF1aXJ5SWQiOjMwNTd9.sPbm__SsSFhD3dkTybTY8o19RMopgG5vYYfsac7a2m8",
    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"
  }
};
$.ajax(settings).done(function(response) {
  console.log(response);
});

Sample body payload

{
  "partnerId": "partner_api_key"
}

The body for the token is defined below

ParameterTypeDescription
partnerIdSTRINGPartner API key provided

Response

This API is called to check current available Balance.

Sample response for Balance Request

{
    "responseCode": 0,
    "success": true,
    "message": {
        "ID": "sukses",
        "EN": "success"
    },
    "data": {
        "balance": 5523560,
        "currency": "IDR",
        "partnerId": "partner_api_key"
    }
}

Below are details for each field and the value type.

TOP LEVEL

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

DATA OBJECT

ParameterTypeDescription
balanceFLOATCurrent available balance.
currencySTRINGBalance currency format.
partnerIdSTRINGPartnerID associated with this request