Interface MoesifConnector


  • public interface MoesifConnector
    Handles integration with Moesif APIs for product catalog, billing meters, and usage data.
    • Method Detail

      • getCollectorAppId

        String getCollectorAppId​(String organization)
      • getTotalRevenue

        Map<String,​String> getTotalRevenue​(String apiIdentifier,
                                                 List<MoesifPlanInfo> moesifPlanList,
                                                 String usageFrom,
                                                 String usageTo,
                                                 String organization,
                                                 String env)
                                          throws MonetizationException
        Retrieves total revenue aggregated for a given API.
        Parameters:
        apiIdentifier - Unique API identifier (UUID or name-version).
        moesifPlanList - List of Moesif plan information
        usageFrom - Start date for usage period
        usageTo - End date for usage period
        organization - Tenant organization.
        env - environment
        Returns:
        Map containing total revenue and related metadata.
        Throws:
        MonetizationException - if revenue retrieval fails
      • syncBillingUser

        void syncBillingUser​(String billingCustomerId,
                             String userEmail,
                             String organization,
                             String env)
                      throws MonetizationException
        Sync a billing user to Moesif.
        Parameters:
        billingCustomerId - billing customer ID (e.g., Stripe customer ID)
        userEmail - user email for Moesif user metadata
        organization - organization
        env - environment
        Throws:
        MonetizationException - if sync fails
      • provisionCommercialPlans

        List<Map<String,​Object>> provisionCommercialPlans​(String organization,
                                                                String env,
                                                                List<Map<String,​Object>> plans,
                                                                String billingEngine,
                                                                String action)
                                                         throws MonetizationException
        Provision commercial plans and assigned prices
        Parameters:
        organization - organization
        env - environment
        plans - list of plans to provision
        billingEngine - billing engine (stripe, etc)
        action - action to perform (add, update, delete)
        Returns:
        updated list of plans with productId/priceId populated
        Throws:
        MonetizationException - if provisioning fails
      • createBillingMeters

        List<Map<String,​Object>> createBillingMeters​(String organization,
                                                           String env,
                                                           String apiId,
                                                           List<Map<String,​Object>> plans,
                                                           String billingProvider)
                                                    throws MonetizationException
        Create billing meters for multiple API plans
        Parameters:
        organization - organization
        env - environment
        apiId - API identifier
        plans - list of plans to create meters for
        billingProvider - billing provider
        Returns:
        list of plans with billingMeterId populated
        Throws:
        MonetizationException - if meter creation fails
      • deleteBillingMeters

        void deleteBillingMeters​(String organization,
                                 String env,
                                 List<String> meterIds)
                          throws MonetizationException
        Delete billing meters for an API
        Parameters:
        organization - organization
        env - environment
        meterIds - list of meter IDs to delete
        Throws:
        MonetizationException - if meter deletion fails