get_plan_recommendation
async
¶
get_plan_recommendation(
segment: CustomerSegment,
app_type: PlanRecommendationAppType,
actions: BillableActionList,
*,
config_overrides: Optional[AsyncAppMonetizationClientConfig] = 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,hourlyRateandvalueSharethat is sent is rejected. With EXPERIENTIAL, noplanOptions.publishedPriceand no comparables used, a CONSUMER app is valued at the typical monthly price of public apps of itsappType(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 noplanOptions.publishedPriceand no usable comparables is priced from cost (verdict COST_ONLY, or COST_NOT_CHECKED when costs are not checked: nounitCost, orcosts.sourceNONE; 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,moneySavedorvaluePerUse, one per action) on every action or on none: when no action has a value basis and there is no experiential estimate (seevalueKind), the price is based on cost (and comparables, if opted in, orplanOptions.publishedPrice) and the confidence is LOW. GiveunitCoston 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 withactions[].minutesSaved: sent when no action hasminutesSaved, or withvalueKindEXPERIENTIAL, 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 timeshourlyRate). Above 1 when the minutes understate the value. The value of one use of an action withminutesSavedisminutesSaved/ 60 timeshourlyRatetimes the share; the share does not apply tomoneySavedorvaluePerUse. When an action's value is above 0, each outside option'smonthlyCostis also weighed at this share (seeOutsideOption). 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'sminutesSaved,moneySavedorvaluePerUseis above 0 and, besides, an action hasminutesSaved(0 counts) or an outside option'smonthlyCostis above 0: otherwise it changes nothing (with no value above 0 there is no value estimate, and an outside option counts in full). Rejected withvalueKindEXPERIENTIAL. -
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
alternativesis scored byfeatures, and used only then: sent when no comparable and no outside option is scored byfeatures, it is rejected. A comparable withalternatives.comparablesOptInOPTED_OUT is validated but not used, sofeaturesscored only against such comparables is validated with them and changes nothing. Absent: every comparable and outside option is scored by itsquality. -
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.sourceis inferred fromactions[].unitCost, and the costs count as complete but unconfirmed (seecosts.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 (
comparablesOptInOPTED_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 (seePlanOptions); 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
summaryanddetailslabel and word the inputs. Absent: the rendered text uses default labels.
Raises:
-
AccessDeniedException–The caller does not have sufficient permission to perform this action.
-
InternalServerException–An unexpected error occurred while processing the request.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The request failed input validation.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_appmonetization/_services/async_app_monetization.py
2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 | |