Skip to content

get_plan_recommendation

get_plan_recommendation(
    segment: CustomerSegment,
    app_type: PlanRecommendationAppType,
    actions: BillableActionList,
    *,
    config_overrides: Optional[AppMonetizationClientConfig] = None,
    app_name: Optional[PlanRecommendationAppName] = None,
    value_kind: Optional[ValueKind] = None,
    hourly_rate: Optional[HourlyRate] = None,
    value_share: Optional[ValueShare] = None,
    features: Optional[FeatureScores] = None,
    costs: Optional[CostInputs] = None,
    alternatives: Optional[AlternativeInputs] = None,
    market: Optional[MarketInputs] = None,
    plan_options: Optional[PlanOptions] = None,
    context: Optional[RequestContext] = None,
) -> GetPlanRecommendationResponse

Returns a recommended pricing model and plan set for an app, calculated from the billable actions, costs, customer types, alternatives and preferences in the request. Built to be called by an agent working with the developer: most inputs are estimates the agent gathers from the app's code and from the developer (who the users are, what an action saves them, what it costs to serve), and each optional member's documentation says what its absence means, so send only the inputs you have a basis for. Stateless: nothing is stored, no app is required, and repeating a request returns the same recommendation unless the service has been updated in between. Every response carries the rendered texts summary and details. Smallest call (MEDIUM confidence): {"segment":"CONSUMER","appType":"DAILY_WORKFLOW","actions":[{"unitCost":0.02,"typicalMonthlyUsage":30,"valuePerUse":0.40}]}.

Parameters:

  • app_name (Optional[PlanRecommendationAppName], default: None ) –

    Display name of the app, used in the rendered text. Absent: your app.

  • segment (CustomerSegment) –

    Who buys the app.

  • app_type (PlanRecommendationAppType) –

    Kind of app. It sets the service's usage and value benchmarks for this kind of app.

  • value_kind (Optional[ValueKind], default: None ) –

    What kind of value the app gives its users. Absent: PRODUCTIVITY. An experiential app has no time or money value, so with EXPERIENTIAL each of actions[].minutesSaved, actions[].moneySaved, actions[].valuePerUse, hourlyRate and valueShare that is sent is rejected. With EXPERIENTIAL, no planOptions.publishedPrice and no comparables used, a CONSUMER app is valued at the typical monthly price of public apps of its appType (there is none for API_WRAPPER), shown as an estimate. That estimate is not used when it is too close to a typical user's usage cost, so the estimate alone never makes the verdict NOT_MONETIZABLE. The estimate exists only for CONSUMER: a PROSUMER or ENTERPRISE experiential app with no planOptions.publishedPrice and no usable comparables is priced from cost (verdict COST_ONLY, or COST_NOT_CHECKED when costs are not checked: no unitCost, or costs.source NONE; confidence LOW).

  • actions (BillableActionList) –

    The things that your app charges for, each with its cost to serve, typical usage, and value to a customer. Names must be unique. Give a value basis (minutesSaved, moneySaved or valuePerUse, one per action) on every action or on none: when no action has a value basis and there is no experiential estimate (see valueKind), the price is based on cost (and comparables, if opted in, or planOptions.publishedPrice) and the confidence is LOW. Give unitCost on every action or on none.

  • hourly_rate (Optional[HourlyRate], default: None ) –

    What one hour of a customer's time is worth, in USD: the hourly rate of the person whose time the app saves. Required when any action has minutesSaved. There is no default. It is used only with actions[].minutesSaved: sent when no action has minutesSaved, or with valueKind EXPERIENTIAL, it is rejected.

  • value_share (Optional[ValueShare], default: None ) –

    The most a typical customer would pay for the app, as a share of the time value it saves them (minutesSaved / 60 times hourlyRate). Above 1 when the minutes understate the value. The value of one use of an action with minutesSaved is minutesSaved / 60 times hourlyRate times the share; the share does not apply to moneySaved or valuePerUse. When an action's value is above 0, each outside option's monthlyCost is also weighed at this share (see OutsideOption). Absent: the service's benchmark share. For PROSUMER this value scales the service's benchmark share instead of replacing it. With usable comparables the recommended price uses the service's benchmark share for comparables instead, but this value still sets the price from the app's value alone, which the confidence and the texts compare with. Rejected unless an action's minutesSaved, moneySaved or valuePerUse is above 0 and, besides, an action has minutesSaved (0 counts) or an outside option's monthlyCost is above 0: otherwise it changes nothing (with no value above 0 there is no value estimate, and an outside option counts in full). Rejected with valueKind EXPERIENTIAL.

  • features (Optional[FeatureScores], default: None ) –

    How this app scores on the characteristics customers decide on, and how much each one matters. Required when a comparable or an outside option in alternatives is scored by features, and used only then: sent when no comparable and no outside option is scored by features, it is rejected. A comparable with alternatives.comparablesOptIn OPTED_OUT is validated but not used, so features scored only against such comparables is validated with them and changes nothing. Absent: every comparable and outside option is scored by its quality.

  • costs (Optional[CostInputs], default: None ) –

    Cost inputs beyond each action's unitCost: where the costs came from, any costs that could not be priced, fixed monthly cost and target margins. Absent: costs.source is inferred from actions[].unitCost, and the costs count as complete but unconfirmed (see costs.unknown).

  • alternatives (Optional[AlternativeInputs], default: None ) –

    What customers could use instead of the app: comparable apps and what they do without any product. Absent: no comparables (comparablesOptIn OPTED_OUT) and no outside options.

  • market (Optional[MarketInputs], default: None ) –

    Who the customers are, how many there are and, for a deployed app, how many pay today; and any checkout drop-off rates to use instead of the benchmarks. Absent: each member's default (see MarketInputs).

  • plan_options (Optional[PlanOptions], default: None ) –

    The pricing model and optional plans to consider, prices to evaluate, and the developer's own price (publishedPrice). Absent: each member's default (see PlanOptions); the service chooses the pricing model and plans.

  • context (Optional[RequestContext], default: None ) –

    Where the inputs came from, and notes on them. Changes no price, plan, verdict or confidence label: only how summary and details label and word the inputs. Absent: the rendered text uses default labels.

Raises:

Source code in docs_src/capo_appmonetization/_services/app_monetization.py
def get_plan_recommendation(
    self,
    segment: "capo_appmonetization.types.customer_segment.CustomerSegment",
    app_type: "capo_appmonetization.types.plan_recommendation_app_type.PlanRecommendationAppType",
    actions: "capo_appmonetization.types.billable_action_list.BillableActionList",
    *,
    config_overrides: Optional[AppMonetizationClientConfig] = None,
    app_name: Optional[
        "capo_appmonetization.types.plan_recommendation_app_name.PlanRecommendationAppName"
    ] = None,
    value_kind: Optional["capo_appmonetization.types.value_kind.ValueKind"] = None,
    hourly_rate: Optional[
        "capo_appmonetization.types.hourly_rate.HourlyRate"
    ] = None,
    value_share: Optional[
        "capo_appmonetization.types.value_share.ValueShare"
    ] = None,
    features: Optional[
        "capo_appmonetization.types.feature_scores.FeatureScores"
    ] = None,
    costs: Optional["capo_appmonetization.types.cost_inputs.CostInputs"] = None,
    alternatives: Optional[
        "capo_appmonetization.types.alternative_inputs.AlternativeInputs"
    ] = None,
    market: Optional[
        "capo_appmonetization.types.market_inputs.MarketInputs"
    ] = None,
    plan_options: Optional[
        "capo_appmonetization.types.plan_options.PlanOptions"
    ] = None,
    context: Optional[
        "capo_appmonetization.types.request_context.RequestContext"
    ] = None,
) -> "capo_appmonetization.types.get_plan_recommendation_response.GetPlanRecommendationResponse":
    """Returns a recommended pricing model and plan set for an app, calculated from the billable actions, costs, customer types, alternatives and preferences in the request. Built to be called by an agent working with the developer: most inputs are estimates the agent gathers from the app's code and from the developer (who the users are, what an action saves them, what it costs to serve), and each optional member's documentation says what its absence means, so send only the inputs you have a basis for. Stateless: nothing is stored, no app is required, and repeating a request returns the same recommendation unless the service has been updated in between. Every response carries the rendered texts summary and details. Smallest call (MEDIUM confidence): {"segment":"CONSUMER","appType":"DAILY_WORKFLOW","actions":[{"unitCost":0.02,"typicalMonthlyUsage":30,"valuePerUse":0.40}]}.

    Args:
        app_name: Display name of the app, used in the rendered text. Absent: `your app`.
        segment: Who buys the app.
        app_type: Kind of app. It sets the service's usage and value benchmarks for this kind of app.
        value_kind: What kind of value the app gives its users. Absent: PRODUCTIVITY. An experiential app has no time or money value, so with EXPERIENTIAL each of `actions[].minutesSaved`, `actions[].moneySaved`, `actions[].valuePerUse`, `hourlyRate` and `valueShare` that is sent is rejected. With EXPERIENTIAL, no `planOptions.publishedPrice` and no comparables used, a CONSUMER app is valued at the typical monthly price of public apps of its `appType` (there is none for API_WRAPPER), shown as an estimate. That estimate is not used when it is too close to a typical user's usage cost, so the estimate alone never makes the verdict NOT_MONETIZABLE. The estimate exists only for CONSUMER: a PROSUMER or ENTERPRISE experiential app with no `planOptions.publishedPrice` and no usable comparables is priced from cost (verdict COST_ONLY, or COST_NOT_CHECKED when costs are not checked: no `unitCost`, or `costs.source` NONE; confidence LOW).
        actions: The things that your app charges for, each with its cost to serve, typical usage, and value to a customer. Names must be unique. Give a value basis (`minutesSaved`, `moneySaved` or `valuePerUse`, one per action) on every action or on none: when no action has a value basis and there is no experiential estimate (see `valueKind`), the price is based on cost (and comparables, if opted in, or `planOptions.publishedPrice`) and the confidence is LOW. Give `unitCost` on every action or on none.
        hourly_rate: What one hour of a customer's time is worth, in USD: the hourly rate of the person whose time the app saves. Required when any action has `minutesSaved`. There is no default. It is used only with `actions[].minutesSaved`: sent when no action has `minutesSaved`, or with `valueKind` EXPERIENTIAL, it is rejected.
        value_share: The most a typical customer would pay for the app, as a share of the time value it saves them (`minutesSaved` / 60 times `hourlyRate`). Above 1 when the minutes understate the value. The value of one use of an action with `minutesSaved` is `minutesSaved` / 60 times `hourlyRate` times the share; the share does not apply to `moneySaved` or `valuePerUse`. When an action's value is above 0, each outside option's `monthlyCost` is also weighed at this share (see `OutsideOption`). Absent: the service's benchmark share. For PROSUMER this value scales the service's benchmark share instead of replacing it. With usable comparables the recommended price uses the service's benchmark share for comparables instead, but this value still sets the price from the app's value alone, which the confidence and the texts compare with. Rejected unless an action's `minutesSaved`, `moneySaved` or `valuePerUse` is above 0 and, besides, an action has `minutesSaved` (0 counts) or an outside option's `monthlyCost` is above 0: otherwise it changes nothing (with no value above 0 there is no value estimate, and an outside option counts in full). Rejected with `valueKind` EXPERIENTIAL.
        features: How this app scores on the characteristics customers decide on, and how much each one matters. Required when a comparable or an outside option in `alternatives` is scored by `features`, and used only then: sent when no comparable and no outside option is scored by `features`, it is rejected. A comparable with `alternatives.comparablesOptIn` OPTED_OUT is validated but not used, so `features` scored only against such comparables is validated with them and changes nothing. Absent: every comparable and outside option is scored by its `quality`.
        costs: Cost inputs beyond each action's `unitCost`: where the costs came from, any costs that could not be priced, fixed monthly cost and target margins. Absent: `costs.source` is inferred from `actions[].unitCost`, and the costs count as complete but unconfirmed (see `costs.unknown`).
        alternatives: What customers could use instead of the app: comparable apps and what they do without any product. Absent: no comparables (`comparablesOptIn` OPTED_OUT) and no outside options.
        market: Who the customers are, how many there are and, for a deployed app, how many pay today; and any checkout drop-off rates to use instead of the benchmarks. Absent: each member's default (see `MarketInputs`).
        plan_options: The pricing model and optional plans to consider, prices to evaluate, and the developer's own price (`publishedPrice`). Absent: each member's default (see `PlanOptions`); the service chooses the pricing model and plans.
        context: Where the inputs came from, and notes on them. Changes no price, plan, verdict or confidence label: only how `summary` and `details` label and word the inputs. Absent: the rendered text uses default labels.

    Raises:
        capo_appmonetization.errors.access_denied_exception.AccessDeniedException: The caller does not have sufficient permission to perform this action.
        capo_appmonetization.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
        capo_appmonetization.errors.throttling_exception.ThrottlingException: The request was denied due to request throttling.
        capo_appmonetization.errors.validation_exception.ValidationException: The request failed input validation.
        capo_appmonetization.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_appmonetization.types.get_plan_recommendation_request.GetPlanRecommendationRequest]",
    ) -> OperationResponse[
        "capo_appmonetization.types.get_plan_recommendation_response.GetPlanRecommendationResponse"
    ]:
        import capo_appmonetization._operations.aws_monetization_ai_front_end.get_plan_recommendation

        output, http_response = (
            capo_appmonetization._operations.aws_monetization_ai_front_end.get_plan_recommendation.get_plan_recommendation(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_appmonetization.types.get_plan_recommendation_request.GetPlanRecommendationRequest",
    ) -> dict[str, Any]:
        import capo_appmonetization.types.get_plan_recommendation_request

        return capo_appmonetization.types.get_plan_recommendation_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_appmonetization.types.get_plan_recommendation_response.GetPlanRecommendationResponse",
    ) -> dict[str, Any]:
        import capo_appmonetization.types.get_plan_recommendation_response

        return capo_appmonetization.types.get_plan_recommendation_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "GetPlanRecommendation",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_appmonetization.types.get_plan_recommendation_request.GetPlanRecommendationRequest = {
        "segment": segment,
        "app_type": app_type,
        "actions": actions,
    }
    if app_name is not None:
        input_["app_name"] = app_name
    if value_kind is not None:
        input_["value_kind"] = value_kind
    if hourly_rate is not None:
        input_["hourly_rate"] = hourly_rate
    if value_share is not None:
        input_["value_share"] = value_share
    if features is not None:
        input_["features"] = features
    if costs is not None:
        input_["costs"] = costs
    if alternatives is not None:
        input_["alternatives"] = alternatives
    if market is not None:
        input_["market"] = market
    if plan_options is not None:
        input_["plan_options"] = plan_options
    if context is not None:
        input_["context"] = context

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output