Get Product Category Tree (v3, synthetic)
curl --request POST \
--url https://sandbox-biller-b2b.singapay.id/api/v3/get-product-category-tree \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--header 'X-PARTNER-ID: <x-partner-id>' \
--data '
{
"command": "get-product-category-tree",
"data": {
"active_only": true
}
}
'import requests
url = "https://sandbox-biller-b2b.singapay.id/api/v3/get-product-category-tree"
payload = {
"command": "get-product-category-tree",
"data": { "active_only": True }
}
headers = {
"X-PARTNER-ID": "<x-partner-id>",
"Accept": "<accept>",
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-PARTNER-ID': '<x-partner-id>',
Accept: '<accept>',
'Content-Type': '<content-type>',
Authorization: 'Bearer <token>'
},
body: JSON.stringify({command: 'get-product-category-tree', data: {active_only: true}})
};
fetch('https://sandbox-biller-b2b.singapay.id/api/v3/get-product-category-tree', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-biller-b2b.singapay.id/api/v3/get-product-category-tree",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'command' => 'get-product-category-tree',
'data' => [
'active_only' => true
]
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Authorization: Bearer <token>",
"Content-Type: <content-type>",
"X-PARTNER-ID: <x-partner-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-biller-b2b.singapay.id/api/v3/get-product-category-tree"
payload := strings.NewReader("{\n \"command\": \"get-product-category-tree\",\n \"data\": {\n \"active_only\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-PARTNER-ID", "<x-partner-id>")
req.Header.Add("Accept", "<accept>")
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox-biller-b2b.singapay.id/api/v3/get-product-category-tree")
.header("X-PARTNER-ID", "<x-partner-id>")
.header("Accept", "<accept>")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"command\": \"get-product-category-tree\",\n \"data\": {\n \"active_only\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-biller-b2b.singapay.id/api/v3/get-product-category-tree")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-PARTNER-ID"] = '<x-partner-id>'
request["Accept"] = '<accept>'
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"command\": \"get-product-category-tree\",\n \"data\": {\n \"active_only\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"command": "get-product-category-tree",
"response_code": "00",
"response_text": "Operation completed successfully",
"data": {
"categories": [
{
"code": "PREPAID",
"name": "Prepaid",
"children": [
{
"id": 1,
"code": "PULSA",
"name": "Pulsa Prabayar",
"name_en": "Prepaid Credit",
"payment_type_detail": "prepaid-without-inquiry",
"image": null,
"is_active": true,
"products_count": 42
},
{
"id": 4,
"code": "TOPUPG",
"name": "Topup Games",
"name_en": "Game Top-up",
"payment_type_detail": "prepaid-with-inquiry",
"image": null,
"is_active": true,
"products_count": 150
}
]
},
{
"code": "POSTPAID",
"name": "Postpaid",
"children": [
{
"id": 10,
"code": "PLNPOS",
"name": "PLN Pascabayar",
"name_en": "PLN Postpaid",
"payment_type_detail": "postpaid-with-inquiry",
"image": null,
"is_active": true,
"products_count": 3
},
{
"id": 16,
"code": "PUTK",
"name": "BPJS TK Penerima Upah",
"name_en": "BPJS Employment (PU)",
"payment_type_detail": "postpaid-with-inquiry",
"image": null,
"is_active": true,
"products_count": 1
}
]
}
]
}
}{
"status": 401,
"success": false,
"error": {
"code": 401,
"message": "Unauthorized merchant, please sign in"
}
}{
"command": "detail-bill-transaction",
"response_code": "04",
"response_text": "Rejected Format Error",
"data": {
"data": "The data field is required.",
"data.transaction_id": "The data.transaction id field is required."
}
}{
"command": "plnpos",
"response_code": "06",
"response_text": "Product SPPLNPOS is not available: product is inactive"
}Product Catalog
Get Product Category Tree (v3, synthetic)
Backward-compatible category tree built from the flat categories: two virtual roots (PREPAID, POSTPAID) with the flat categories as children, ordered by id. Replaces the old 4-5 level recursive tree. Products are not included; use list-product.
POST
/
api
/
v3
/
get-product-category-tree
Get Product Category Tree (v3, synthetic)
curl --request POST \
--url https://sandbox-biller-b2b.singapay.id/api/v3/get-product-category-tree \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--header 'X-PARTNER-ID: <x-partner-id>' \
--data '
{
"command": "get-product-category-tree",
"data": {
"active_only": true
}
}
'import requests
url = "https://sandbox-biller-b2b.singapay.id/api/v3/get-product-category-tree"
payload = {
"command": "get-product-category-tree",
"data": { "active_only": True }
}
headers = {
"X-PARTNER-ID": "<x-partner-id>",
"Accept": "<accept>",
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-PARTNER-ID': '<x-partner-id>',
Accept: '<accept>',
'Content-Type': '<content-type>',
Authorization: 'Bearer <token>'
},
body: JSON.stringify({command: 'get-product-category-tree', data: {active_only: true}})
};
fetch('https://sandbox-biller-b2b.singapay.id/api/v3/get-product-category-tree', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-biller-b2b.singapay.id/api/v3/get-product-category-tree",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'command' => 'get-product-category-tree',
'data' => [
'active_only' => true
]
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Authorization: Bearer <token>",
"Content-Type: <content-type>",
"X-PARTNER-ID: <x-partner-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-biller-b2b.singapay.id/api/v3/get-product-category-tree"
payload := strings.NewReader("{\n \"command\": \"get-product-category-tree\",\n \"data\": {\n \"active_only\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-PARTNER-ID", "<x-partner-id>")
req.Header.Add("Accept", "<accept>")
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox-biller-b2b.singapay.id/api/v3/get-product-category-tree")
.header("X-PARTNER-ID", "<x-partner-id>")
.header("Accept", "<accept>")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"command\": \"get-product-category-tree\",\n \"data\": {\n \"active_only\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-biller-b2b.singapay.id/api/v3/get-product-category-tree")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-PARTNER-ID"] = '<x-partner-id>'
request["Accept"] = '<accept>'
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"command\": \"get-product-category-tree\",\n \"data\": {\n \"active_only\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"command": "get-product-category-tree",
"response_code": "00",
"response_text": "Operation completed successfully",
"data": {
"categories": [
{
"code": "PREPAID",
"name": "Prepaid",
"children": [
{
"id": 1,
"code": "PULSA",
"name": "Pulsa Prabayar",
"name_en": "Prepaid Credit",
"payment_type_detail": "prepaid-without-inquiry",
"image": null,
"is_active": true,
"products_count": 42
},
{
"id": 4,
"code": "TOPUPG",
"name": "Topup Games",
"name_en": "Game Top-up",
"payment_type_detail": "prepaid-with-inquiry",
"image": null,
"is_active": true,
"products_count": 150
}
]
},
{
"code": "POSTPAID",
"name": "Postpaid",
"children": [
{
"id": 10,
"code": "PLNPOS",
"name": "PLN Pascabayar",
"name_en": "PLN Postpaid",
"payment_type_detail": "postpaid-with-inquiry",
"image": null,
"is_active": true,
"products_count": 3
},
{
"id": 16,
"code": "PUTK",
"name": "BPJS TK Penerima Upah",
"name_en": "BPJS Employment (PU)",
"payment_type_detail": "postpaid-with-inquiry",
"image": null,
"is_active": true,
"products_count": 1
}
]
}
]
}
}{
"status": 401,
"success": false,
"error": {
"code": 401,
"message": "Unauthorized merchant, please sign in"
}
}{
"command": "detail-bill-transaction",
"response_code": "04",
"response_text": "Rejected Format Error",
"data": {
"data": "The data field is required.",
"data.transaction_id": "The data.transaction id field is required."
}
}{
"command": "plnpos",
"response_code": "06",
"response_text": "Product SPPLNPOS is not available: product is inactive"
}Authorizations
Headers
Body
application/json
