Private APIs

Private APIs are lightweight GET APIs created to fetch specific data that’s not available through standard APIs and can be used through Neo dataflow. These APIs help to address custom requirements without modifying existing standard APIs. Neo acts as the orchestration layer to call these private APIs. Additionally, you can expose a private API as a public endpoint through Neo and make it a Public API, allowing external systems to access it directly. The Private APIs that are exposed only for specific organisations are called Local APIs, and the ones that can be used across organisations are called Global APIs.

Note: Private APIs can be used only to retrieve data.

Example use case - Using private APIs and displaying specific ledger info

Scenario

A retail brand wants to show only selected ledger details on its customer-facing UI. However, the existing Get Customer Ledger Info API returns a large response where each ledger entry maps to a specific event log ID. The API internally calls the Get Customer Ledger Explode API, which processes only 10 event log IDs at a time. As a result, processing the entire response becomes inefficient and unsustainable.

Challenge

  • Large payload from the default API slows down the UI.
  • The Explode API is rate-limited.
  • Direct transformation of this data isn't scalable.

Solution

Use Neo to orchestrate multiple private APIs, each focused on retrieving only specific attributes based on query parameters and event types.

Step-by-step Flow

  1. Start Neo dataflow
    Trigger the dataflow on request.

  2. Check for alternate currency
    Use a script block to evaluate if the query parameter contains alternateCurrencyNames.

  3. Invoke ledger entry API

    • If no alternate currency is present, call getLedgerEntriesWithEventId.
    • If alternate currency is present, call getACLedgerEntriesWithEventId.
  4. Group eventLogIds
    Use a script block to group the returned eventLogIds by eventName. This prepares the payload for downstream event-specific API requests.

  5. Prepare request payloads
    Construct payloads dynamically based on the grouped event types (e.g., TransactionAdd, Redemption, etc.).

  6. Invoke event-specific private APIs
    Call only the necessary APIs based on event types using API request blocks. Examples:

    • getTransactionAddExplodeLedger
    • getPointsRedemptionExplodeLedger
    • getTargetCompletedExplodeLedger
    • getManualPointsAdjustmentExplodeLedger
  7. Assemble final response
    Use a final script block to consolidate outputs from all invoked private APIs and prepare a clean response with only the necessary data.

Private APIs Used

Private APIPurpose
getLedgerEntriesWithEventIdFetches event log IDs for Credit/Debit transactions.
getACLedgerEntriesWithEventIdFetches event log IDs for alternate currency transactions.
getTransactionAddExplodeLedgerFetches custom field values for TransactionAdd events.
getPointsRedemptionExplodeLedgerFetches notes field from redemptionDetails in redemption events.
getTargetCompletedExplodeLedgerFetches targetDescription and targetGroupName from TargetCompletedDetails.
getManualPointsAdjustmentExplodeLedgerFetches reason field from manualPointsAdjustmentDetails.

Example use case - Exposing private API as public API

Scenario
An airline customer wants to view coupon redemption details, including the redemption date, source, and the PNR against which the redemption occurred.

Challenge
The source, PNR, and redemption date are stored as custom fields, and no standard APIs are available to retrieve the custom field details associated with a coupon redemption.

Solution

  • Create a private API to retrieve the custom fields associated with coupon redemption using the coupon redemption ID.

  • Integrate the private API into a Neo dataflow and expose it so that external systems can access it using the organisation's Intouch authentication.

  • Use an API to display the redemption details along with the custom field information (PNR, source, and date of redemption) in the customer-facing UI.

List of private APIs

API EndpointPurposeAvailable as
getCouponRedemptionCustomFieldsDataRetrieve the custom fields associated with coupon redemption✅ GLOBAL
getPaDetailsByEventIdRetrieve the point allocation details using the event ID.✅ GLOBAL
getPAIdsForProvidedDateRangeRetrieves information about points allocated to customers that will expire within a specified date range.✅ GLOBAL
getExpiredPointsByCustomerIdAndYearRetrieve the points that expired for a customer, grouped by year.❌ LOCAL
getLedgerEntriesWithEventIdRetrieves event log IDs for Credit or Debit point transactions.❌LOCAL
getACLedgerEntriesWithEventIdRetrieves event log IDs for Credit or Debit transactions of the specified alternate currencies.❌LOCAL
getTransactionAddExplodeLedgerRetrieves custom field values for the event log IDs related to TransactionAdd events.❌LOCAL
getPointsRedemptionExplodeLedgerRetrieves points redemption details for the event log IDs related to redemption events.❌LOCAL
getTargetCompletedExplodeLedgerRetrieves target completion details for the event log IDs related to TargetCompleted events.❌LOCAL
getManualPointsAdjustmentExplodeLedgerRetrieves the manual points adjustment details for event log IDs for manualPointsAdjustment events.❌LOCAL