> ## Documentation Index
> Fetch the complete documentation index at: https://docs.singapay.id/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.



## OpenAPI

````yaml https://biller-b2b.singapay.id/docs post /api/v3/get-product-category-tree
openapi: 3.0.0
info:
  title: B2B Biller API
  description: >-
    API documentation for the B2B Biller service. Provides endpoints for bill
    payments (postpaid/prepaid), transaction management, balance checking, and
    authentication.
  version: 1.0.0
servers:
  - url: https://sandbox-biller-b2b.singapay.id
    description: Sandbox
  - url: https://biller-b2b.singapay.id
    description: Production
security: []
tags:
  - name: Authentication
    description: OAuth2 token generation
  - name: General
    description: Bill transaction listing, detail, balance, and utilities
  - name: Postpaid V1
    description: Postpaid bill inquiry and payment (V1)
  - name: Prepaid V1
    description: Prepaid inquiry and payment — PLN Token, Pulsa, Paket Data (V1)
  - name: Postpaid V2
    description: Postpaid bill inquiry and payment (V2)
  - name: Prepaid V2
    description: Prepaid inquiry, payment, and game topup (V2)
  - name: Postpaid V3
    description: >-
      Postpaid bill inquiry and payment with flat category validation (V3) —
      adds educ, prop, pbb
  - name: Prepaid V3
    description: >-
      Prepaid inquiry, payment, and game topup with flat category validation
      (V3) — adds strmg, emoney, ewallet, cashwd
  - name: Product V3
    description: >-
      Product, flat category, synthetic category tree, and product config
      listing (V3)
  - name: General V3
    description: >-
      Transaction detail with flat category (V3). check-balance,
      list-bill-transaction and list-bill-statement stay on v1;
      reset-customer-id has no version (/api/reset-customer-id).
paths:
  /api/v3/get-product-category-tree:
    post:
      tags:
        - Product V3
      summary: Get Product Category Tree (v3, synthetic)
      description: >-
        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.
      operationId: getProductCategoryTreeV3
      parameters:
        - name: X-PARTNER-ID
          in: header
          description: Your unique partner API key
          required: true
          schema:
            type: string
        - name: Accept
          in: header
          required: true
          schema:
            type: string
            default: application/json
        - name: Content-Type
          in: header
          required: true
          schema:
            type: string
            default: application/json
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - command
              properties:
                command:
                  type: string
                  enum:
                    - get-product-category-tree
                  example: get-product-category-tree
                data:
                  properties:
                    active_only:
                      description: Only active flat categories
                      type: boolean
                      default: true
                  type: object
              type: object
            example:
              command: get-product-category-tree
              data:
                active_only: true
      responses:
        '200':
          description: Tree retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CategoryTreeV3Response'
              example:
                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
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponse'
        '422':
          description: Validation error (04)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '500':
          description: Failed to fetch product category tree (99)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillerErrorV3Response'
      security:
        - bearerAuth: []
components:
  schemas:
    CategoryTreeV3Response:
      description: V3 synthetic 2-level category tree response
      properties:
        command:
          type: string
          example: get-product-category-tree
        response_code:
          type: string
          example: '00'
        response_text:
          type: string
          example: Operation completed successfully
        data:
          properties:
            categories:
              description: >-
                Synthetic 2-level tree: PREPAID/POSTPAID roots with flat
                categories as children
              type: array
              items:
                properties:
                  code:
                    description: Virtual root code
                    type: string
                    example: PREPAID
                  name:
                    type: string
                    example: Prepaid
                  children:
                    type: array
                    items:
                      properties:
                        id:
                          type: integer
                          example: 1
                        code:
                          type: string
                          example: PULSA
                        name:
                          type: string
                          example: Pulsa Prabayar
                        name_en:
                          type: string
                          example: Prepaid Credit
                          nullable: true
                        payment_type_detail:
                          description: >-
                            Payment flow: *-with-inquiry needs prepaid/inquiry
                            or postpaid/inquiry first (reference_number),
                            prepaid-without-inquiry goes straight to
                            prepaid/payment
                          type: string
                          enum:
                            - prepaid-with-inquiry
                            - prepaid-without-inquiry
                            - postpaid-with-inquiry
                          example: prepaid-without-inquiry
                        image:
                          type: string
                          nullable: true
                        is_active:
                          type: boolean
                          example: true
                        products_count:
                          type: integer
                          example: 42
                      type: object
                type: object
          type: object
      type: object
    UnauthorizedErrorResponse:
      description: Unauthorized error response (HTTP 401)
      required:
        - status
        - success
        - error
      properties:
        status:
          type: integer
          example: 401
        success:
          type: boolean
          example: false
        error:
          properties:
            code:
              type: integer
              example: 401
            message:
              type: string
              example: Unauthorized merchant, please sign in
          type: object
      type: object
    ValidationErrorResponse:
      description: Validation error response (HTTP 422)
      required:
        - command
        - response_code
        - response_text
        - data
      properties:
        command:
          type: string
          example: detail-bill-transaction
        response_code:
          type: string
          example: '04'
        response_text:
          type: string
          example: Rejected Format Error
        data:
          description: Field-level error messages
          type: object
          example:
            data: The data field is required.
            data.transaction_id: The data.transaction id field is required.
          additionalProperties:
            type: string
      type: object
    BillerErrorV3Response:
      description: >-
        V3 biller error response. Common codes: 04 invalid argument / wrong
        password / missing reference_number (422), payment product_code or
        customer_id differ from the inquiry (400), 06 product not found, product
        or flat category inactive, reference_number used or expired (404) — or
        product not in the flat category of the command / wrong payment type /
        unknown command (400), 16 credential not found (422), 17 insufficient
        balance (400), 22/89 vendor error (503), 99 internal error (500). Full
        list: docs/feature-flow/RESPONSE_CODE_ALL.md.
      required:
        - command
        - response_code
        - response_text
      properties:
        command:
          type: string
          example: plnpos
        response_code:
          description: Error code (see schema description)
          type: string
          example: '06'
        response_text:
          type: string
          example: 'Product SPPLNPOS is not available: product is inactive'
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      description: JWT Bearer token obtained from /api/v1.0/access-token/b2b
      bearerFormat: JWT
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.