Skip to content

Migration Guide

This guide helps you migrate from the existing /v2/product-list and /v2/subproducts endpoints to the new Dynamic Product Catalog API.

Why Migrate?

Current ApproachNew Approach
Hardcoded product flows per product typeSingle dynamic form renderer for all products
Scattered validation logicBackend-driven validation rules
Implicit extras requirementsExplicit fulfillment mapping
Multiple endpoints for subproductsUnified /v2/options endpoint
App releases for new productsBackend configuration only
No wholesale pricing infoB2B pricing with costs and margins
Manual sync for catalog updatesWebhook notifications for real-time sync

API Versioning & Deprecation

Both the old endpoints (/v2/product-list, /v2/subproducts) and new endpoints (/v2/catalog, /v2/options) are currently supported.

EndpointStatusDeprecation DateSunset Date
/v2/product-listDeprecatedTBATBA
/v2/subproductsDeprecatedTBATBA
/v2/catalogActive--
/v2/optionsActive--

Migration Timeline

We recommend migrating to the new Catalog API as soon as possible. Deprecation notices will be announced at least 6 months before the old endpoints are sunset. Subscribe to our changelog for updates.

Endpoint Mapping

Old EndpointNew EndpointNotes
GET /v2/product-listGET /v2/catalogReturns products with field configurations
GET /v2/subproducts?product_code=JOMPAYGET /v2/options?product_code=JOMPAY&field_id=billerJomPAY billers
GET /v2/subproducts?product_code=HI&account_number=...GET /v2/options?product_code=HI&field_id=plan&account_number=...Mobile data plans
GET /v2/subproducts?product_code=PTPTN&account_number=...GET /v2/options?product_code=PTPTN&field_id=loan_account&account_number=...PTPTN accounts

Response Changes

Product List → Catalog

The biggest structural change. Instead of a flat array of products with implicit field requirements, the Catalog API returns a hierarchical tree for navigation and a products map with explicit field configurations, validation rules, and fulfillment mapping.

Key field changes:

  • denomination: "5,10,30,50,100"fields[].data_source pointing to /v2/options
  • account_label + keyboard_typefields[].type: "text" + input_mode with label and validation
  • has_subproductfields[].data_source.type: "dynamic"
  • Implicit extras → Explicit fulfillment mapping
  • No pricing info → pricing object with cost model and optional price adjustment

See the Catalog API Reference for the full product schema and complete product examples.

Denomination Mapping

This table shows how old denomination formats map to the new Catalog API:

Old API FieldOld ValueNew Field TypeNew Location
denomination"5,10,30,50,100"select/v2/options returns available amounts
denomination"1-30000"moneyvalidation.min/max in catalog
denomination_data_typeIntegermoneyinput_mode: "numeric"
denomination_data_typeDecimalmoneyinput_mode: "decimal"
has_subproduct: trueselectdata_source.type: "dynamic"

Subproducts → Options

All subproduct endpoints migrate to the unified /v2/options endpoint. The key field renames are consistent across all product types:

  • subproduct_codecode
  • display_namelabel
  • min/max (string) → min_amount/max_amount (structured Money objects with amount + currency)
  • denomination/face_value (number) → price (structured Money object)
  • links.nextmeta object with current_page, last_page, per_page, total

See the Options API Reference for the full response schema and per-product examples, including the complete field mapping table for migrating developers.

Pricing (New)

The old API provided no wholesale pricing info. The Catalog API includes a pricing object on each product with your cost model and optional price adjustments configured via Dashboard. See the Catalog API Reference for cost models, adjustment types, and calculation examples.

ModelUse CaseYour Cost Calculation
percentage_discountMobile reloads, postpaidprice × percentage_rate
fixed_discountUtility bills (TNB, water)price - abs(fixed_amount)

For game products, per-item price / cost / rrp values are returned directly in /v2/options responses. See the Options API Reference for details.

B2B Data

The cost and pricing fields are for your backend only. Do not expose wholesale pricing to end users.

What to Change in Your Code

The migration involves four key refactors. The pattern for each is the same: replace product-specific logic with generic, configuration-driven code that reads from the catalog.

1. Payment Request Builder

Replace product-specific switch statements for building /v2/topup requests with a generic function that reads the product's fulfillment mapping. The fulfillment object declares exactly how each field maps to account, amount, and extras — no product-specific branching needed. See the Catalog API Reference for the mapping spec.

2. Form Rendering

Replace per-product form views (e.g., PhoneInputWithAmounts, BillerSearchWithRefs) with a single dynamic form builder that iterates over product.fields and renders inputs based on type (text, number, select, money). Use input_mode for keyboard hints and data_source to know when to call /v2/options.

3. Validation

Replace scattered validation functions with a generic validator that reads field.validation. Pattern validation uses validation.pattern + validation.message. Min/max validation for money/number fields uses validation.min and validation.max.

4. Catalog Sync

Replace periodic polling of /v2/product-list with Catalog Webhooks for real-time push notifications. Webhook events cover products, options, categories, and groups.

Event PrefixTriggerPayload
product.*Product changesSingle product payload
option.*Option changesSingle option payload
category.*Category changesSingle category payload
group.*Group changesSingle group payload

During migration, both APIs can run in parallel — try the new catalog first, fall back to the old product-list if needed.

Migration Checklist

  • [ ] Update API client to support both /v2/catalog and /v2/options
  • [ ] Create generic field components for each type
  • [ ] Implement fulfillment mapping builder
  • [ ] Migrate validation logic to use field configurations
  • [ ] Update caching strategy for catalog using last_updated comparison
  • [ ] Handle data_source.depends_on for dynamic fields
  • [ ] Implement cost calculation for each pricing model
  • [ ] Register webhook for real-time catalog sync
  • [ ] Handle resource webhook events (product.*, option.*, category.*, group.*)
  • [ ] Test all product types with new endpoints
  • [ ] Remove product-specific hardcoded logic
  • [ ] Update error handling for new response formats

IIMMPACT API Documentation