Product List

Endpoint

https://XXXXXXXX.XXXXX.XXXXX.id/api/v1/partner/products

Request

Here is examples of how to send a Product fetch request to the OpenAPI system.

Sample fetch Product list request

curl -X POST \
  https://XXXXX.XXXXXX.XXXXXXX.id/api/v2/partner/products
  -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/products"
  method := "POST"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("KEY", "API Key")
  req.Header.Add("TOKEN", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiJheW9wb3AifQ.rvAJRJYqxAM8tMlE3yiw8-fECIQfy7ZXknxfapR-cFc")
  req.Header.Add("VERSION", "1.0")
  req.Header.Add("accept", "application/json")
  req.Header.Add("cache-control", "no-cache")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://dev.openapi.ayopop.id/api/v1/partner/products',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'KEY: API Key',
    'TOKEN: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiJheW9wb3AifQ.rvAJRJYqxAM8tMlE3yiw8-fECIQfy7ZXknxfapR-cFc',
    'VERSION: 1.0',
    'accept: application/json',
    'cache-control: no-cache'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var settings = {
  "url": "https://dev.openapi.ayopop.id/api/v1/partner/products",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/json",
    "KEY": "API Key",
    "TOKEN": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiJheW9wb3AifQ.rvAJRJYqxAM8tMlE3yiw8-fECIQfy7ZXknxfapR-cFc",
    "VERSION": "1.0",
    "accept": "application/json",
    "cache-control": "no-cache"
  },
};

$.ajax(settings).done(function (response) {
  console.log(response);
});

Sample payload for the token

{
  "partnerId": "partner_api_key"
}

The body for the token is defined below

ParameterTypeMandatoryDescription
partnerIdSTRINGYesPartner API key provided
productCodeSTRINGNoThis parameter returns details of the specific productCode in api response
categorySTRINGNoThis parameter returns all products that belong to the specified category
billerSTRINGNoThis parameter returns all products that belong to the specified biller
statusSTRINGNoThis parameter returns details of the specific product status either it is active or Inacti

Response

This API is called to check all Product list.

Sample response for Product list Request

{
    "responseCode": 0,
    "success": true,
    "message": {
        "ID": "sukses",
        "EN": "success"
    },
    "data": [
        {
            "name": "Pulsa Telkomsel 11.000",
            "description": "",
            "code": "PLTK11",
            "logo": "",
            "amount": 11000,
            "adminFee": 0,
            "biller": "Telkomsel",
            "category": "Pulsa",
            "active": true,
            "type": "prepaid"
        },
        {
            "name": "Indosat 5.000",
            "description": "",
            "code": "PLID05",
            "logo": "",
            "amount": 5001,
            "adminFee": 0,
            "biller": "Indosat",
            "category": "Pulsa",
            "active": false,
            "type": "prepaid"
        },
        {
            "name": "Indosat 25.000",
            "description": "",
            "code": "PLID25",
            "logo": "",
            "amount": 25003,
            "adminFee": 0,
            "biller": "Indosat",
            "category": "Pulsa",
            "active": false,
            "type": "prepaid"
        },
        {
            "name": "BPJS Kesahatan",
            "description": "",
            "code": "BPJSKES",
            "logo": "",
            "amount": 0,
            "adminFee": 0,
            "biller": "BPJS Kesehatan",
            "category": "BPJS",
            "active": true,
            "type": "postpaid"
        },
        {
            "name": "PDAM",
            "description": "",
            "code": "PMSP",
            "logo": "",
            "amount": 0,
            "adminFee": 0,
            "biller": "Kota Sungai Penuh",
            "category": "PDAM",
            "active": true,
            "type": "postpaid"
        },
        {
            "name": "PLN Postpaid",
            "description": "",
            "code": "LSPP",
            "logo": "",
            "amount": 0,
            "adminFee": 0,
            "biller": "PLN Postpaid",
            "category": "Listrik",
            "active": true,
            "type": "postpaid"
        }
]
}

Below are details for each field and the value type.

TOP LEVEL

ParameterTypeDescription
responseCodeINTStatus of the product list request. Refer to the Response code section / document for more details
messageJSONMessages in Bahasa and English describing the RC above.
successBOOLEANStatus of api
dataARRAYList of products

DATA OBJECT

ParameterTypeDescription
nameSTRINGProduct name.
descriptionSTRINGProduct description.
codeSTRINGProduct code
logoSTRINGLogo of each product
amountFLOATProduct amount
adminFeeFLOATProduct admin fee
activeBOOLEANProduct status
typeSTRINGType of product (postpaid,prepaid)
billerSTRINGBiller Name
categorySTRINGCategory Name