2026/11/29 - AWS App Monetization - 48 new api methods
Changes Initial release of AWS AppMonetization, a service that helps developers charge for applications built on AWS. Define pricing plans and usage metrics, record usage, check entitlements, manage subscriptions and checkout, and view revenue, usage, and infrastructure cost analytics.
Records an AWS service usage event for cost attribution. The event is accepted and processed asynchronously.
See also: AWS API Documentation
Request Syntax
client.put_aws_service_event(
appId='string',
clientToken='string',
userId='string',
service='string',
operation='string',
quantity='string',
timestamp=datetime(2015, 1, 1),
awsRegion='string',
properties={
'string': 'string'
},
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app.
string
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.
This field is autopopulated if not provided.
string
[REQUIRED]
An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
string
[REQUIRED]
The AWS service name that emitted the usage event.
string
[REQUIRED]
The AWS operation (API action) that produced the usage event.
string
A non-negative decimal quantity represented as a string (for example, "1500" or "12.5").
datetime
[REQUIRED]
The time the event occurred, as an ISO-8601 date-time in UTC (for example, "2026-07-26T15:04:05Z").
string
The AWS Region in which the event occurred.
dict
The key/value properties carried on a usage event. Property values can be referenced by metric filters and grouping.
(string) --
Key of an event property. Lowercase, starting with a letter; letters, digits, underscore, and dot; 1-64 characters.
(string) --
Value of an event property, up to 256 characters.
string
[REQUIRED]
The environment of the app that this operation applies to. Specify live to use the live app, or sandbox to use the app's isolated test environment.
dict
Response Syntax
{
'eventId': 'string',
'status': 'ACCEPTED'
}
Response Structure
(dict) --
Output for PutAwsServiceEvent.
eventId (string) --
The ID assigned to the recorded event.
status (string) --
The processing status of the accepted event.
Adds charges that you compute to the end user's next subscription invoice. The charges go to the billing period of the user's current subscription that contains the current time. You don't specify a period.
Each charge has a chargeId that you choose. If you submit a chargeId again in the same billing period, the existing charge is replaced instead of added again. A chargeId belongs to the first billing period that accepts it, so use a value that is unique for this user across all billing periods, such as a UUID or your own invoice line ID.
The request succeeds or fails as a whole: either every charge is accepted or none is. A successful response means that every charge was accepted.
If you submit a chargeId after its billing period has ended, the request fails with a ConflictException. The charge is already recorded. Don't submit it again under a new chargeId, because that bills it twice.
A billing period holds at most 100 chargeId values for each user. If a request would exceed 100, it fails with a ServiceQuotaExceededException. Submitting a chargeId that is already in the period doesn't count toward the limit.
See also: AWS API Documentation
Request Syntax
client.put_custom_charges(
appId='string',
userId='string',
charges=[
{
'chargeId': 'string',
'description': 'string',
'amount': 'string',
'currency': 'string',
'metricId': 'string',
'taxCode': 'string'
},
],
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app.
string
[REQUIRED]
The end user these charges bill.
list
[REQUIRED]
The custom charges to add to this user's next invoice. Stored at the submitted grain; the service never splits a charge. Accepted all-or-nothing.
(dict) --
One developer-computed charge.
chargeId (string) -- [REQUIRED]
Caller-chosen stable id for THIS charge. It is the idempotency and replace key: re-submitting the same chargeId within its assigned period upserts the charge in place. A chargeId is bound to the first period it is accepted into; re-submitting it after that period rolls over is refused (ConflictException) rather than billing it again, so it must be unique per charge for this user across all periods — use a UUID or your own invoice-line id (the caller does not know the billing period, so it cannot be encoded in the id).
description (string) -- [REQUIRED]
Human-readable description, surfaced on the invoice line.
amount (string) -- [REQUIRED]
The charge, as a decimal string in major currency units (for example, "12.50").
currency (string) -- [REQUIRED]
The ISO 4217 currency of the amount. Only USD is supported; a non-USD value is rejected.
metricId (string) --
Optional metric this charge derives from. Omitted for a charge not tied to a metric (a flat or custom fee).
taxCode (string) --
Optional product tax code; defaults to the service default when omitted.
string
[REQUIRED]
Required. The environment: live or sandbox.
dict
Response Syntax
{
'billingPeriodStartAt': datetime(2015, 1, 1),
'billingPeriodEndAt': datetime(2015, 1, 1)
}
Response Structure
(dict) --
billingPeriodStartAt (datetime) --
The billing period the service assigned these charges to, resolved from the user's current subscription. The caller supplies no window; this reports where the charges landed.
billingPeriodEndAt (datetime) --
End of the assigned billing period.
Returns the current payment registration status and seller profile for an app.
See also: AWS API Documentation
Request Syntax
client.get_app_payment_registration(
appId='string',
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app.
string
[REQUIRED]
Required. The environment: live or sandbox.
dict
Response Syntax
{
'appPaymentRegistration': {
'appId': 'string',
'status': 'ACTIVE'|'PENDING'|'FAILED',
'paymentRegistrationId': 'string',
'paymentRegistrationStatus': 'ACTIVE'|'PENDING'|'FAILED',
'additionalAppEligibility': 'ELIGIBLE'|'ONBOARDING_INCOMPLETE'|'IDENTITY_PENDING'|'REGISTRATION_FAILED',
'legalName': 'string',
'developerAddress': {
'street1': 'string',
'street2': 'string',
'city': 'string',
'state': 'string',
'postalCode': 'string',
'country': 'string'
},
'taxRegistrationNumber': 'string',
'businessType': 'INDIVIDUAL'|'REGISTERED_BUSINESS',
'email': 'string',
'supportEmail': 'string',
'displayName': 'string',
'supportPhone': 'string',
'taxRegistrations': [
{
'countryCode': 'string',
'state': 'string',
'collectionType': 'string',
'registrationType': 'SALES_USE'|'RETAIL_DELIVERY_FEE'|'VAT'|'VAT_OSS'|'VAT_IOSS'|'GST'|'FEDERAL_EIN'|'CPF'|'CNPJ'|'SST'|'TIN'|'NIP'|'NPWP'|'NCID',
'registrationId': 'string',
'locality': 'string'
},
],
'createdAt': datetime(2015, 1, 1),
'updatedAt': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Output for GetAppPaymentRegistration.
appPaymentRegistration (dict) --
The app's current payment registration.
appId (string) --
The ID of the app this registration belongs to.
status (string) --
The onboarding status of the payment registration for this app (ACTIVE, PENDING, or FAILED).
paymentRegistrationId (string) --
The payment registration the app is bound to. Pass it to UpdateAppPaymentRegistration on another app to bind that app to the same registration. Absent if the app uses a payment registration created before registrations could be shared.
paymentRegistrationStatus (string) --
The onboarding status of this app's payment registration. It has the same value as status. Present exactly when paymentRegistrationId is.
additionalAppEligibility (string) --
Whether a further app may bind to the app's payment registration, and if not, why. Present exactly when paymentRegistrationId is.
legalName (string) --
The seller's registered legal name.
developerAddress (dict) --
The seller's postal address.
street1 (string) --
The first line of the street address.
street2 (string) --
The second line of the street address.
city (string) --
The city of the street address.
state (string) --
The state or province.
postalCode (string) --
The postal or ZIP code.
country (string) --
The ISO 3166-1 alpha-2 country code.
taxRegistrationNumber (string) --
The seller's tax registration number (for example, VAT, GST, or EIN).
businessType (string) --
Whether the seller registered as an individual or a registered business.
email (string) --
The seller's primary contact email, read from the seller profile.
supportEmail (string) --
The seller's support email address, displayed in the invoice footer.
displayName (string) --
Customer-facing name (doing-business-as) shown to buyers on invoices, read from the seller profile.
supportPhone (string) --
Customer-facing support phone number, read from the seller profile.
taxRegistrations (list) --
The jurisdictions where the seller is registered to collect tax.
(dict) --
A jurisdiction where the seller is registered to collect tax.
countryCode (string) --
The ISO 3166-1 alpha-2 country code.
state (string) --
The state or province code (for example, "NY" or "CA"). Required for US and CA.
collectionType (string) --
The country-specific collection type (for example, "state_sales_tax", "standard", or "simplified").
registrationType (string) --
Which tax this registration is for, or which entity identifier it carries (for example SALES_USE for a US state, VAT or GST elsewhere, FEDERAL_EIN for a US employer identification number). Optional.
registrationId (string) --
The tax ID issued for this registration (permit number or tax registration number). Optional.
locality (string) --
Jurisdiction below the state, as a code rather than a name: a FIPS code in the US, an IBGE code in Brazil. Requires state. Optional.
createdAt (datetime) --
The time the payment registration was created.
updatedAt (datetime) --
The time the payment registration was last updated.
Returns the historical subscription records for a user. We recommend using pagination to ensure that the operation returns quickly and successfully.
See also: AWS API Documentation
Request Syntax
client.get_subscription_history(
appId='string',
userId='string',
effectiveAfter=datetime(2015, 1, 1),
effectiveBefore=datetime(2015, 1, 1),
maxResults=123,
nextToken='string',
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app.
string
[REQUIRED]
An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
datetime
Returns records whose effectiveDate is at or after this instant (inclusive).
datetime
Returns records whose effectiveDate is before this instant (exclusive).
integer
The maximum number of items to return in a single page.
string
An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.
string
[REQUIRED]
Required. The environment: live or sandbox.
dict
Response Syntax
{
'items': [
{
'appId': 'string',
'userId': 'string',
'planId': 'string',
'effectiveAt': datetime(2015, 1, 1),
'billingAnchorDate': datetime(2015, 1, 1),
'billingCycle': 'MONTHLY'|'ANNUAL'|'ONE_TIME'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
Output for GetSubscriptionHistory.
items (list) --
The page of historical subscription records for the user.
(dict) --
A user's subscription to a plan for an app.
appId (string) --
The ID of the app that the subscription belongs to.
userId (string) --
The opaque end-user identifier that the subscription belongs to.
planId (string) --
The ID of the plan that the user is subscribed to.
effectiveAt (datetime) --
The time when the subscription took effect.
billingAnchorDate (datetime) --
The fixed reference instant the recurring billing cycle is measured from. It is set when the subscription first takes effect and stays fixed as periods roll forward, so it is normally an older date than the current period — not the start of the current period. For the end of the current cycle, use currentPeriodEndsAt on GetSubscriptionResponse (derived from this anchor and the billing cycle) rather than this value.
billingCycle (string) --
The billing cycle of the subscription, such as monthly or annual.
nextToken (string) --
An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.
Updates an existing plan. Only a draft plan, one that has never been published, can be modified. After a plan is published, all of its fields are frozen and any update is rejected with a ConflictException. To change the terms of a published plan, archive it and create a new plan.
See also: AWS API Documentation
Request Syntax
client.update_plan(
appId='string',
planId='string',
definition={
'name': 'string',
'description': 'string',
'billingCycle': 'MONTHLY'|'ANNUAL'|'ONE_TIME',
'subscriptionPrice': {
'currencyCode': 'string',
'amount': 'string'
},
'includedQuotas': {
'string': {
'flat': {
'includedQuantity': 123,
'overagePolicy': 'NO_OVERAGE_THROTTLE'|'APPLY_FIXED_OVERAGE'|'APPLY_TIERED_OVERAGE',
'overagePrice': {
'currencyCode': 'string',
'amount': 'string'
},
'tieredOverage': {
'semantics': 'GRADUATED'|'VOLUME',
'tiers': [
{
'firstUnit': 123,
'lastUnit': 123,
'unitPrice': {
'currencyCode': 'string',
'amount': 'string'
}
},
]
},
'maxQuantity': 123
},
'tiered': {
'includedQuantity': 123,
'tieredPrice': {
'semantics': 'GRADUATED'|'VOLUME',
'tiers': [
{
'firstUnit': 123,
'lastUnit': 123,
'unitPrice': {
'currencyCode': 'string',
'amount': 'string'
}
},
]
},
'maxQuantity': 123
}
}
},
'taxCode': 'string',
'paymentFailurePolicy': {
'retryAttempts': 123,
'retryWindowDays': 123,
'downgradeToPlanId': 'string'
}
}
)
string
[REQUIRED]
The ID of the app.
string
[REQUIRED]
The identifier of the plan. AWS App Monetization generates this value when you create the plan. It is unique within the app and is never reused. Treat it as opaque.
dict
[REQUIRED]
The plan's updated pricing and packaging definition.
name (string) -- [REQUIRED]
A human-readable display name for the plan.
description (string) --
A human-readable description of the plan.
billingCycle (string) -- [REQUIRED]
How often the plan bills.
subscriptionPrice (dict) -- [REQUIRED]
The recurring subscription price charged each billing cycle.
currencyCode (string) -- [REQUIRED]
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) -- [REQUIRED]
An arbitrary-precision decimal represented as a string (for example, "9.99").
includedQuotas (dict) --
The usage quotas included with the plan, keyed by metric ID. Each entry prices one metric with either a flat grant or a tiered-priced grant.
(string) --
The service-assigned ID of a metric.
(dict) --
How one metric is priced on a plan: exactly one of a flat grant or a tiered-priced grant. Both arms carry the free allowance ( includedQuantity) with the same meaning.
flat (dict) --
A flat grant: free allowance plus an optional overage policy.
includedQuantity (integer) -- [REQUIRED]
The free allowance included with the plan for this metric.
overagePolicy (string) --
How usage beyond the included allowance is handled.
overagePrice (dict) --
The per-unit price charged for usage beyond the included allowance under a fixed overage policy.
currencyCode (string) -- [REQUIRED]
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) -- [REQUIRED]
An arbitrary-precision decimal represented as a string (for example, "9.99").
tieredOverage (dict) --
The tiered overage schedule applied to usage beyond the included allowance under a tiered overage policy.
semantics (string) -- [REQUIRED]
Whether the bands price graduated (each band's units at its own rate, summed) or volume (all charged units at the rate of the band reached).
tiers (list) -- [REQUIRED]
The ordered price bands, from lowest units to highest.
(dict) --
One band of a tiered price or overage schedule: a unit range and the per-unit price that applies within it.
firstUnit (integer) -- [REQUIRED]
The first unit covered by this band.
lastUnit (integer) --
The last unit covered by this band. Absent on the final, unbounded band.
unitPrice (dict) -- [REQUIRED]
The per-unit price charged within this band.
currencyCode (string) -- [REQUIRED]
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) -- [REQUIRED]
An arbitrary-precision decimal represented as a string (for example, "9.99").
maxQuantity (integer) --
Usage at which further entitlement checks for this metric are denied, in whole units per billing period, counting the included allowance. Must be at least includedQuantity (equal is a hard stop at the allowance) and is allowed only on a grant that charges past its allowance. Checked at entitlement time against usage already recorded; one allowed action's quantity is not clamped. Prepaid usage-pack units sit outside it. One cap per billing period. Absent means no cap.
tiered (dict) --
A tiered-priced grant: free allowance plus a tier-ladder price schedule.
includedQuantity (integer) -- [REQUIRED]
The free allowance included with the plan for this metric. May be 0, in which case the metric is tier-priced from the first charged unit.
tieredPrice (dict) -- [REQUIRED]
The tiered price schedule applied to charged usage for this metric.
semantics (string) -- [REQUIRED]
Whether the bands price graduated (each band's units at its own rate, summed) or volume (all charged units at the rate of the band reached).
tiers (list) -- [REQUIRED]
The ordered price bands, from lowest units to highest. Uses the same TierBand shape (firstUnit/lastUnit/unitPrice) as tiered overage bands.
(dict) --
One band of a tiered price or overage schedule: a unit range and the per-unit price that applies within it.
firstUnit (integer) -- [REQUIRED]
The first unit covered by this band.
lastUnit (integer) --
The last unit covered by this band. Absent on the final, unbounded band.
unitPrice (dict) -- [REQUIRED]
The per-unit price charged within this band.
currencyCode (string) -- [REQUIRED]
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) -- [REQUIRED]
An arbitrary-precision decimal represented as a string (for example, "9.99").
maxQuantity (integer) --
Usage at which further entitlement checks for this metric are denied, in whole units per billing period, counting the included allowance. Must be at least includedQuantity (equal is a hard stop at the allowance) and is allowed only on a grant that charges past its allowance. Checked at entitlement time against usage already recorded; one allowed action's quantity is not clamped. Prepaid usage-pack units sit outside it. One cap per billing period. Absent means no cap.
taxCode (string) --
The product tax code for the plan's price. See ProductTaxCode.
paymentFailurePolicy (dict) --
How the plan handles a failed recurring payment.
retryAttempts (integer) --
The total number of payment attempts for a failed recurring payment, including the first attempt, before the failure is final. For example, 3 means the first attempt and up to 2 retries.
retryWindowDays (integer) --
The number of days over which to retry a failed recurring payment.
downgradeToPlanId (string) --
Plan to move the subscriber to once the attempts are exhausted.
dict
Response Syntax
{
'plan': {
'appId': 'string',
'planId': 'string',
'definition': {
'name': 'string',
'description': 'string',
'billingCycle': 'MONTHLY'|'ANNUAL'|'ONE_TIME',
'subscriptionPrice': {
'currencyCode': 'string',
'amount': 'string'
},
'includedQuotas': {
'string': {
'flat': {
'includedQuantity': 123,
'overagePolicy': 'NO_OVERAGE_THROTTLE'|'APPLY_FIXED_OVERAGE'|'APPLY_TIERED_OVERAGE',
'overagePrice': {
'currencyCode': 'string',
'amount': 'string'
},
'tieredOverage': {
'semantics': 'GRADUATED'|'VOLUME',
'tiers': [
{
'firstUnit': 123,
'lastUnit': 123,
'unitPrice': {
'currencyCode': 'string',
'amount': 'string'
}
},
]
},
'maxQuantity': 123
},
'tiered': {
'includedQuantity': 123,
'tieredPrice': {
'semantics': 'GRADUATED'|'VOLUME',
'tiers': [
{
'firstUnit': 123,
'lastUnit': 123,
'unitPrice': {
'currencyCode': 'string',
'amount': 'string'
}
},
]
},
'maxQuantity': 123
}
}
},
'taxCode': 'string',
'paymentFailurePolicy': {
'retryAttempts': 123,
'retryWindowDays': 123,
'downgradeToPlanId': 'string'
}
},
'stage': 'DRAFT'|'PUBLISHED',
'createdAt': datetime(2015, 1, 1),
'updatedAt': datetime(2015, 1, 1),
'arn': 'string'
}
}
Response Structure
(dict) --
Output for UpdatePlan.
plan (dict) --
The updated plan.
appId (string) --
The ID of the app the plan belongs to.
planId (string) --
The identifier of the plan. AWS App Monetization generates this value when the plan is created. It is unique within the app and is never reused. Treat it as opaque.
definition (dict) --
The plan's pricing and packaging definition.
name (string) --
A human-readable display name for the plan.
description (string) --
A human-readable description of the plan.
billingCycle (string) --
How often the plan bills.
subscriptionPrice (dict) --
The recurring subscription price charged each billing cycle.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
includedQuotas (dict) --
The usage quotas included with the plan, keyed by metric ID. Each entry prices one metric with either a flat grant or a tiered-priced grant.
(string) --
The service-assigned ID of a metric.
(dict) --
How one metric is priced on a plan: exactly one of a flat grant or a tiered-priced grant. Both arms carry the free allowance ( includedQuantity) with the same meaning.
flat (dict) --
A flat grant: free allowance plus an optional overage policy.
includedQuantity (integer) --
The free allowance included with the plan for this metric.
overagePolicy (string) --
How usage beyond the included allowance is handled.
overagePrice (dict) --
The per-unit price charged for usage beyond the included allowance under a fixed overage policy.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
tieredOverage (dict) --
The tiered overage schedule applied to usage beyond the included allowance under a tiered overage policy.
semantics (string) --
Whether the bands price graduated (each band's units at its own rate, summed) or volume (all charged units at the rate of the band reached).
tiers (list) --
The ordered price bands, from lowest units to highest.
(dict) --
One band of a tiered price or overage schedule: a unit range and the per-unit price that applies within it.
firstUnit (integer) --
The first unit covered by this band.
lastUnit (integer) --
The last unit covered by this band. Absent on the final, unbounded band.
unitPrice (dict) --
The per-unit price charged within this band.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
maxQuantity (integer) --
Usage at which further entitlement checks for this metric are denied, in whole units per billing period, counting the included allowance. Must be at least includedQuantity (equal is a hard stop at the allowance) and is allowed only on a grant that charges past its allowance. Checked at entitlement time against usage already recorded; one allowed action's quantity is not clamped. Prepaid usage-pack units sit outside it. One cap per billing period. Absent means no cap.
tiered (dict) --
A tiered-priced grant: free allowance plus a tier-ladder price schedule.
includedQuantity (integer) --
The free allowance included with the plan for this metric. May be 0, in which case the metric is tier-priced from the first charged unit.
tieredPrice (dict) --
The tiered price schedule applied to charged usage for this metric.
semantics (string) --
Whether the bands price graduated (each band's units at its own rate, summed) or volume (all charged units at the rate of the band reached).
tiers (list) --
The ordered price bands, from lowest units to highest. Uses the same TierBand shape (firstUnit/lastUnit/unitPrice) as tiered overage bands.
(dict) --
One band of a tiered price or overage schedule: a unit range and the per-unit price that applies within it.
firstUnit (integer) --
The first unit covered by this band.
lastUnit (integer) --
The last unit covered by this band. Absent on the final, unbounded band.
unitPrice (dict) --
The per-unit price charged within this band.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
maxQuantity (integer) --
Usage at which further entitlement checks for this metric are denied, in whole units per billing period, counting the included allowance. Must be at least includedQuantity (equal is a hard stop at the allowance) and is allowed only on a grant that charges past its allowance. Checked at entitlement time against usage already recorded; one allowed action's quantity is not clamped. Prepaid usage-pack units sit outside it. One cap per billing period. Absent means no cap.
taxCode (string) --
The product tax code for the plan's price. See ProductTaxCode.
paymentFailurePolicy (dict) --
How the plan handles a failed recurring payment.
retryAttempts (integer) --
The total number of payment attempts for a failed recurring payment, including the first attempt, before the failure is final. For example, 3 means the first attempt and up to 2 retries.
retryWindowDays (integer) --
The number of days over which to retry a failed recurring payment.
downgradeToPlanId (string) --
Plan to move the subscriber to once the attempts are exhausted.
stage (string) --
The offering stage the plan was read from.
createdAt (datetime) --
The time the plan was created.
updatedAt (datetime) --
The time the plan was last updated.
arn (string) --
The Amazon Resource Name (ARN) of the plan.
Returns the subscriptions for an app. We recommend using pagination to ensure that the operation returns quickly and successfully.
See also: AWS API Documentation
Request Syntax
client.list_subscriptions(
appId='string',
maxResults=123,
nextToken='string',
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app.
integer
The maximum number of items to return in a single page.
string
An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.
string
[REQUIRED]
Required. The environment: live or sandbox.
dict
Response Syntax
{
'items': [
{
'appId': 'string',
'userId': 'string',
'planId': 'string',
'effectiveAt': datetime(2015, 1, 1),
'billingAnchorDate': datetime(2015, 1, 1),
'billingCycle': 'MONTHLY'|'ANNUAL'|'ONE_TIME'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
Output for ListSubscriptions.
items (list) --
The page of subscription summaries for the app.
(dict) --
A summary of a user's subscription to a plan for an app, read from the user's latest subscription record. While a change is scheduled, planId, effectiveAt and billingCycle describe the scheduled change. Call GetSubscription for the subscription in effect.
appId (string) --
The ID of the app that the subscription belongs to.
userId (string) --
The opaque end-user identifier that the subscription belongs to.
planId (string) --
The ID of the plan on the user's latest subscription record. If a plan change is scheduled, this is the plan the subscription moves to; if a cancellation is scheduled or has taken effect, it is absent. Call GetSubscription for the plan in effect.
effectiveAt (datetime) --
The time when the subscription took effect.
billingAnchorDate (datetime) --
The fixed reference instant the recurring billing cycle is measured from. It is set when the subscription first takes effect and stays fixed as periods roll forward, so it is normally an older date than the current period — not the start of the current period. The resolved current-period end ( currentPeriodEndsAt) is available on GetSubscription for a single user; this summary carries only the anchor.
billingCycle (string) --
The billing cycle of the subscription, such as monthly or annual.
nextToken (string) --
An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.
Removes a third-party cost. This operation is idempotent: removing a cost that is already absent still succeeds. A missing or unauthorized parent app returns a ResourceNotFoundException.
See also: AWS API Documentation
Request Syntax
client.delete_third_party_cost(
appId='string',
costId='string'
)
string
[REQUIRED]
The ID of the app.
string
[REQUIRED]
The ID of the cost to remove.
dict
Response Syntax
{}
Response Structure
(dict) --
Output for DeleteThirdPartyCost.
Returns the apps owned by the caller. We recommend using pagination to ensure that the operation returns quickly and successfully.
See also: AWS API Documentation
Request Syntax
client.list_apps(
maxResults=123,
nextToken='string'
)
integer
The maximum number of items to return in a single page. Valid range: 1 to 100.
string
An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.
dict
Response Syntax
{
'apps': [
{
'appId': 'string',
'name': 'string',
'description': 'string',
'status': 'ACTIVE'|'DELETED',
'createdAt': datetime(2015, 1, 1),
'arn': 'string'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
Output for ListApps.
apps (list) --
The page of apps owned by the caller's account.
(dict) --
A monetizable application. Apps are the top-level resource that own plans, metrics, subscriptions, and usage data.
appId (string) --
The service-assigned identifier for the app.
name (string) --
A human-readable display name for the app.
description (string) --
A longer description of what the app does.
status (string) --
The lifecycle status of the app.
createdAt (datetime) --
The time the app was created.
arn (string) --
The resource ARN of this app.
nextToken (string) --
An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.
Deletes a one-time price from an app. This operation is idempotent.
See also: AWS API Documentation
Request Syntax
client.delete_one_time_price(
appId='string',
oneTimePriceId='string',
clientToken='string'
)
string
[REQUIRED]
The ID of the app the one-time price belongs to.
string
[REQUIRED]
The ID of the one-time price to delete.
string
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.
dict
Response Syntax
{}
Response Structure
(dict) --
Output for DeleteOneTimePrice.
Returns the details of an app.
See also: AWS API Documentation
Request Syntax
client.get_app(
appId='string',
identifier='string',
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app to read. You can identify the app by either its ID or its Amazon Resource Name (ARN). If you provide both, they must refer to the same app.
string
The Amazon Resource Name (ARN) of the app. You can identify the app by either its ID or its ARN. If you provide both, they must refer to the same app. A sandbox ARN names the app's sandbox; if you also send scope, the two must name the same environment.
string
The environment to act on: live or sandbox. Optional. You can name the environment with this member, with a sandbox resource ARN, or both; if you send both they must name the same environment, or the request is rejected.
dict
Response Syntax
{
'app': {
'appId': 'string',
'name': 'string',
'description': 'string',
'status': 'ACTIVE'|'DELETED',
'createdAt': datetime(2015, 1, 1),
'arn': 'string'
}
}
Response Structure
(dict) --
Output for GetApp.
app (dict) --
The requested app.
appId (string) --
The service-assigned identifier for the app.
name (string) --
A human-readable display name for the app.
description (string) --
A longer description of what the app does.
status (string) --
The lifecycle status of the app.
createdAt (datetime) --
The time the app was created.
arn (string) --
The resource ARN of this app.
Returns the plans for an app. We recommend using pagination to ensure that the operation returns quickly and successfully.
See also: AWS API Documentation
Request Syntax
client.list_plans(
appId='string',
stage='DRAFT'|'PUBLISHED',
maxResults=123,
nextToken='string',
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app.
string
Which offering stage to list plans from: DRAFT (the latest authored draft) or PUBLISHED (the published offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox. A stage with nothing published yet lists as empty.
integer
The maximum number of items to return in a single page. Valid range is 1 to 100.
string
An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.
string
[REQUIRED]
Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft (what the sandbox runs).
dict
Response Syntax
{
'plans': [
{
'appId': 'string',
'planId': 'string',
'definition': {
'name': 'string',
'description': 'string',
'billingCycle': 'MONTHLY'|'ANNUAL'|'ONE_TIME',
'subscriptionPrice': {
'currencyCode': 'string',
'amount': 'string'
},
'includedQuotas': {
'string': {
'flat': {
'includedQuantity': 123,
'overagePolicy': 'NO_OVERAGE_THROTTLE'|'APPLY_FIXED_OVERAGE'|'APPLY_TIERED_OVERAGE',
'overagePrice': {
'currencyCode': 'string',
'amount': 'string'
},
'tieredOverage': {
'semantics': 'GRADUATED'|'VOLUME',
'tiers': [
{
'firstUnit': 123,
'lastUnit': 123,
'unitPrice': {
'currencyCode': 'string',
'amount': 'string'
}
},
]
},
'maxQuantity': 123
},
'tiered': {
'includedQuantity': 123,
'tieredPrice': {
'semantics': 'GRADUATED'|'VOLUME',
'tiers': [
{
'firstUnit': 123,
'lastUnit': 123,
'unitPrice': {
'currencyCode': 'string',
'amount': 'string'
}
},
]
},
'maxQuantity': 123
}
}
},
'taxCode': 'string',
'paymentFailurePolicy': {
'retryAttempts': 123,
'retryWindowDays': 123,
'downgradeToPlanId': 'string'
}
},
'stage': 'DRAFT'|'PUBLISHED',
'createdAt': datetime(2015, 1, 1),
'updatedAt': datetime(2015, 1, 1),
'arn': 'string'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
Output for ListPlans.
plans (list) --
The page of plans for the app; each carries the stage it was read from.
(dict) --
A pricing plan for an app. Users subscribe to published plans; a plan bundles a subscription price and billing cycle with included usage quotas.
appId (string) --
The ID of the app the plan belongs to.
planId (string) --
The identifier of the plan. AWS App Monetization generates this value when the plan is created. It is unique within the app and is never reused. Treat it as opaque.
definition (dict) --
The plan's pricing and packaging definition.
name (string) --
A human-readable display name for the plan.
description (string) --
A human-readable description of the plan.
billingCycle (string) --
How often the plan bills.
subscriptionPrice (dict) --
The recurring subscription price charged each billing cycle.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
includedQuotas (dict) --
The usage quotas included with the plan, keyed by metric ID. Each entry prices one metric with either a flat grant or a tiered-priced grant.
(string) --
The service-assigned ID of a metric.
(dict) --
How one metric is priced on a plan: exactly one of a flat grant or a tiered-priced grant. Both arms carry the free allowance ( includedQuantity) with the same meaning.
flat (dict) --
A flat grant: free allowance plus an optional overage policy.
includedQuantity (integer) --
The free allowance included with the plan for this metric.
overagePolicy (string) --
How usage beyond the included allowance is handled.
overagePrice (dict) --
The per-unit price charged for usage beyond the included allowance under a fixed overage policy.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
tieredOverage (dict) --
The tiered overage schedule applied to usage beyond the included allowance under a tiered overage policy.
semantics (string) --
Whether the bands price graduated (each band's units at its own rate, summed) or volume (all charged units at the rate of the band reached).
tiers (list) --
The ordered price bands, from lowest units to highest.
(dict) --
One band of a tiered price or overage schedule: a unit range and the per-unit price that applies within it.
firstUnit (integer) --
The first unit covered by this band.
lastUnit (integer) --
The last unit covered by this band. Absent on the final, unbounded band.
unitPrice (dict) --
The per-unit price charged within this band.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
maxQuantity (integer) --
Usage at which further entitlement checks for this metric are denied, in whole units per billing period, counting the included allowance. Must be at least includedQuantity (equal is a hard stop at the allowance) and is allowed only on a grant that charges past its allowance. Checked at entitlement time against usage already recorded; one allowed action's quantity is not clamped. Prepaid usage-pack units sit outside it. One cap per billing period. Absent means no cap.
tiered (dict) --
A tiered-priced grant: free allowance plus a tier-ladder price schedule.
includedQuantity (integer) --
The free allowance included with the plan for this metric. May be 0, in which case the metric is tier-priced from the first charged unit.
tieredPrice (dict) --
The tiered price schedule applied to charged usage for this metric.
semantics (string) --
Whether the bands price graduated (each band's units at its own rate, summed) or volume (all charged units at the rate of the band reached).
tiers (list) --
The ordered price bands, from lowest units to highest. Uses the same TierBand shape (firstUnit/lastUnit/unitPrice) as tiered overage bands.
(dict) --
One band of a tiered price or overage schedule: a unit range and the per-unit price that applies within it.
firstUnit (integer) --
The first unit covered by this band.
lastUnit (integer) --
The last unit covered by this band. Absent on the final, unbounded band.
unitPrice (dict) --
The per-unit price charged within this band.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
maxQuantity (integer) --
Usage at which further entitlement checks for this metric are denied, in whole units per billing period, counting the included allowance. Must be at least includedQuantity (equal is a hard stop at the allowance) and is allowed only on a grant that charges past its allowance. Checked at entitlement time against usage already recorded; one allowed action's quantity is not clamped. Prepaid usage-pack units sit outside it. One cap per billing period. Absent means no cap.
taxCode (string) --
The product tax code for the plan's price. See ProductTaxCode.
paymentFailurePolicy (dict) --
How the plan handles a failed recurring payment.
retryAttempts (integer) --
The total number of payment attempts for a failed recurring payment, including the first attempt, before the failure is final. For example, 3 means the first attempt and up to 2 retries.
retryWindowDays (integer) --
The number of days over which to retry a failed recurring payment.
downgradeToPlanId (string) --
Plan to move the subscriber to once the attempts are exhausted.
stage (string) --
The offering stage the plan was read from.
createdAt (datetime) --
The time the plan was created.
updatedAt (datetime) --
The time the plan was last updated.
arn (string) --
The Amazon Resource Name (ARN) of the plan.
nextToken (string) --
An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.
Returns the third-party costs for an app. To calculate a total, sum the amount of the returned items; the costs are not prorated. Returns a paginated list; we recommend using pagination to ensure that the operation returns quickly and successfully.
See also: AWS API Documentation
Request Syntax
client.list_third_party_costs(
appId='string',
maxResults=123,
nextToken='string'
)
string
[REQUIRED]
The ID of the app.
integer
The maximum number of items to return in a single page. Valid range: 1-100.
string
An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.
dict
Response Syntax
{
'items': [
{
'appId': 'string',
'costId': 'string',
'label': 'string',
'amount': 'string',
'frequency': 'MONTHLY',
'currency': 'USD',
'description': 'string',
'effectiveFrom': 'string',
'effectiveTo': 'string',
'createdAt': datetime(2015, 1, 1),
'updatedAt': datetime(2015, 1, 1)
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
Output for ListThirdPartyCosts.
items (list) --
The app's declared third-party costs.
(dict) --
A seller-declared, non-AWS recurring cost for an app. A flat monthly charge that stands until the developer updates or removes it (no proration, no usage scaling).
appId (string) --
The ID of the app the cost belongs to.
costId (string) --
The ID of the cost.
label (string) --
A human-readable label for the cost (for example, "Anthropic API").
amount (string) --
The flat monthly amount as a decimal string (for example, "12.50").
frequency (string) --
How often the cost recurs. MONTHLY is the only value today.
currency (string) --
The currency of the amount. USD is the only supported currency.
description (string) --
A free-form description of the cost.
effectiveFrom (string) --
First month (YYYY-MM) the cost applies in. Absent means the cost has no start month.
effectiveTo (string) --
Last month (YYYY-MM) the cost applies in. Absent means the cost has no end month.
createdAt (datetime) --
The time the cost was created.
updatedAt (datetime) --
The time the cost was last updated.
nextToken (string) --
The pagination token; absent when there are no more results.
Returns a user's raw per-metric usage over a caller-supplied window. Usage is aggregated by event time with each metric's aggregation function: summed or counted, or the largest value for a MAX metric, in the environment the scope selects (the live app or its sandbox). It returns usage only: it does not resolve the user's plan, apply quota, or attribute usage to a plan. Combine it with GetSubscriptionHistory to compute charges for each plan the user was on, or compare it against a plan's allowance to make an entitlement decision.
Usage is read at hour resolution: startedAt is floored to its hour and endedAt is rounded up to the next hour boundary, so the window read can be wider than the requested one.
Paginated over the app's metric set: one page of per-metric usage per call, continued with nextToken. The window is fixed across a pagination sequence.
See also: AWS API Documentation
Request Syntax
client.get_metric_usage(
appId='string',
userId='string',
startedAt=datetime(2015, 1, 1),
endedAt=datetime(2015, 1, 1),
scope='sandbox'|'live',
maxResults=123,
nextToken='string'
)
string
[REQUIRED]
The ID of the app.
string
[REQUIRED]
The end user whose usage is read. Do not include personally identifiable or otherwise sensitive data in this value.
datetime
[REQUIRED]
Inclusive start of the reporting window (half-open [startedAt, endedAt)).
datetime
[REQUIRED]
Exclusive end of the reporting window. Must be after startedAt; the window may span at most 744 hours (31 days, the longest monthly billing period). Must not be in the future beyond a small clock-skew allowance.
string
[REQUIRED]
Required. The environment: live or sandbox. sandbox reads the app's isolated test environment. Usage is kept separately per environment.
integer
Maximum number of per-metric usage entries to return in this page (1-25, default 25).
string
Opaque continuation token from a prior response. The window (startedAt/endedAt) must be unchanged across a pagination sequence.
dict
Response Syntax
{
'usage': [
{
'metricId': 'string',
'quantity': 'string'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
Output for GetMetricUsage.
usage (list) --
One entry per metric in this page, carrying its usage over the window. A metric with no events in the window is returned with usage = 0.
(dict) --
A single metric's raw usage over the window.
metricId (string) --
The metric this usage is for.
quantity (string) --
The metric's usage over the window, as a plain decimal string (for example, "1500" or "12.5"). For a SUM or COUNT metric this is the total; for a MAX metric it is the largest value recorded. Within a fixed window the value can only grow, as late-arriving events are counted.
nextToken (string) --
Opaque continuation token. Present when more metrics remain; pass it back (with the same window) to read the next page. Absent on the last page.
Removes tags from an app, pricing plan, billing metric or one-time price.
See also: AWS API Documentation
Request Syntax
client.untag_resource(
resourceArn='string',
tagKeys=[
'string',
]
)
string
[REQUIRED]
ARN of the app, pricing plan, billing metric or one-time price to remove tags from.
list
[REQUIRED]
Keys of the tags to remove. A key that is not on the resource is ignored.
(string) --
A tag key. Keys that begin with aws: (in any letter case) are reserved and rejected.
dict
Response Syntax
{}
Response Structure
(dict) --
Output for UntagResource.
Returns the details of a metric.
See also: AWS API Documentation
Request Syntax
client.get_metric(
appId='string',
metricId='string',
stage='DRAFT'|'PUBLISHED',
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app.
string
[REQUIRED]
The ID of the metric to retrieve.
string
The offering stage to read the metric from: DRAFT (the latest draft) or PUBLISHED (the offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.
string
[REQUIRED]
Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft.
dict
Response Syntax
{
'metric': {
'appId': 'string',
'metricId': 'string',
'name': 'string',
'description': 'string',
'eventType': 'string',
'unitName': 'string',
'definition': {
'filters': [
{
'field': 'string',
'operator': 'EQUALS'|'NOT_EQUALS'|'IN'|'NOT_IN',
'values': [
'string',
]
},
],
'function': 'SUM'|'COUNT'|'MAX',
'functionField': 'string',
'groupBy': [
'string',
],
'period': 'MONTHLY'
},
'arn': 'string',
'stage': 'DRAFT'|'PUBLISHED'
}
}
Response Structure
(dict) --
Output for GetMetric.
metric (dict) --
The requested metric.
appId (string) --
The ID of the app the metric belongs to.
metricId (string) --
The ID of the metric. We assign this value when you create the metric; it is unique within the app. Treat it as opaque.
name (string) --
A human-readable display name for the metric.
description (string) --
A description of what the metric measures.
eventType (string) --
The event type this metric aggregates.
unitName (string) --
The unit of measure for the metric.
definition (dict) --
The aggregation definition: filters, aggregation function, grouping, and period.
filters (list) --
The predicates selecting which events contribute to the metric. Combined with logical AND.
(dict) --
A single predicate that selects which events contribute to a metric.
field (string) --
The event property key the filter is evaluated against.
operator (string) --
The comparison operator (EQUALS, NOT_EQUALS, IN, or NOT_IN).
values (list) --
The values the field is compared against.
(string) --
A value the field is compared against, 1-256 characters. Single quotes (') and backslashes () are not allowed.
function (string) --
The aggregation function applied to matching events (SUM, COUNT, or MAX).
functionField (string) --
The event property key the aggregation function operates on. Required for SUM and MAX; ignored for COUNT.
groupBy (list) --
The event fields to group aggregated results by.
(string) --
Name of an event property key referenced by a metric filter or aggregation (filter field, functionField, groupBy). Lowercase snake_case, 1-64 characters: letters, digits, and underscores only, starting with a letter. Unlike PropertyKey, dots are not allowed, so a metric can't reference a property whose key contains a dot.
period (string) --
The reset or rollup period for the aggregation.
arn (string) --
The Amazon Resource Name (ARN) of the metric. Output only.
stage (string) --
The offering stage this metric was read from: DRAFT or PUBLISHED. Present on metric reads; absent on write responses.
Updates the payment and tax details on an app's payment registration.
See also: AWS API Documentation
Request Syntax
client.update_app_payment_registration(
appId='string',
paymentRegistrationId='string',
legalName='string',
developerAddress={
'street1': 'string',
'street2': 'string',
'city': 'string',
'state': 'string',
'postalCode': 'string',
'country': 'string'
},
taxRegistrationNumber='string',
email='string',
supportEmail='string',
displayName='string',
supportPhone='string',
invoiceLogo=b'bytes',
taxRegistrations=[
{
'countryCode': 'string',
'state': 'string',
'collectionType': 'string',
'registrationType': 'SALES_USE'|'RETAIL_DELIVERY_FEE'|'VAT'|'VAT_OSS'|'VAT_IOSS'|'GST'|'FEDERAL_EIN'|'CPF'|'CNPJ'|'SST'|'TIN'|'NIP'|'NPWP'|'NCID',
'registrationId': 'string',
'locality': 'string'
},
],
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app whose payment registration is updated.
string
Binds the app to this payment registration, owned by the caller, or rebinds it from another one. Cannot be combined with legal-detail or contact members. Naming the registration the app already holds succeeds without a write.
string
Your registered legal name.
dict
Your business address.
street1 (string) -- [REQUIRED]
The first line of the street address.
street2 (string) --
The second line of the street address.
city (string) -- [REQUIRED]
The city of the street address.
state (string) -- [REQUIRED]
The state or province.
postalCode (string) -- [REQUIRED]
The postal or ZIP code.
country (string) -- [REQUIRED]
The ISO 3166-1 alpha-2 country code.
string
Your tax registration number (for example, VAT, GST, or EIN).
string
Your primary contact email for this registration, distinct from supportEmail (the address shown to customers).
string
Your support email address, displayed in the invoice footer.
string
Customer-facing name (doing-business-as) shown to buyers on invoices, distinct from legalName.
string
Customer-facing support phone number shown to buyers on invoices.
bytes
Logo printed on the seller's invoices: raw PNG or JPEG bytes, up to 100 KiB. The image type is detected from the bytes. Write-only: the logo is not returned by GetAppPaymentRegistration.
list
The jurisdictions where the seller is registered to collect tax.
(dict) --
A jurisdiction where the seller is registered to collect tax.
countryCode (string) -- [REQUIRED]
The ISO 3166-1 alpha-2 country code.
state (string) --
The state or province code (for example, "NY" or "CA"). Required for US and CA.
collectionType (string) -- [REQUIRED]
The country-specific collection type (for example, "state_sales_tax", "standard", or "simplified").
registrationType (string) --
Which tax this registration is for, or which entity identifier it carries (for example SALES_USE for a US state, VAT or GST elsewhere, FEDERAL_EIN for a US employer identification number). Optional.
registrationId (string) --
The tax ID issued for this registration (permit number or tax registration number). Optional.
locality (string) --
Jurisdiction below the state, as a code rather than a name: a FIPS code in the US, an IBGE code in Brazil. Requires state. Optional.
string
[REQUIRED]
Required. The environment: live or sandbox.
dict
Response Syntax
{
'appPaymentRegistration': {
'appId': 'string',
'status': 'ACTIVE'|'PENDING'|'FAILED',
'paymentRegistrationId': 'string',
'paymentRegistrationStatus': 'ACTIVE'|'PENDING'|'FAILED',
'additionalAppEligibility': 'ELIGIBLE'|'ONBOARDING_INCOMPLETE'|'IDENTITY_PENDING'|'REGISTRATION_FAILED',
'legalName': 'string',
'developerAddress': {
'street1': 'string',
'street2': 'string',
'city': 'string',
'state': 'string',
'postalCode': 'string',
'country': 'string'
},
'taxRegistrationNumber': 'string',
'businessType': 'INDIVIDUAL'|'REGISTERED_BUSINESS',
'email': 'string',
'supportEmail': 'string',
'displayName': 'string',
'supportPhone': 'string',
'taxRegistrations': [
{
'countryCode': 'string',
'state': 'string',
'collectionType': 'string',
'registrationType': 'SALES_USE'|'RETAIL_DELIVERY_FEE'|'VAT'|'VAT_OSS'|'VAT_IOSS'|'GST'|'FEDERAL_EIN'|'CPF'|'CNPJ'|'SST'|'TIN'|'NIP'|'NPWP'|'NCID',
'registrationId': 'string',
'locality': 'string'
},
],
'createdAt': datetime(2015, 1, 1),
'updatedAt': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Output for UpdateAppPaymentRegistration.
appPaymentRegistration (dict) --
The app's updated payment registration.
appId (string) --
The ID of the app this registration belongs to.
status (string) --
The onboarding status of the payment registration for this app (ACTIVE, PENDING, or FAILED).
paymentRegistrationId (string) --
The payment registration the app is bound to. Pass it to UpdateAppPaymentRegistration on another app to bind that app to the same registration. Absent if the app uses a payment registration created before registrations could be shared.
paymentRegistrationStatus (string) --
The onboarding status of this app's payment registration. It has the same value as status. Present exactly when paymentRegistrationId is.
additionalAppEligibility (string) --
Whether a further app may bind to the app's payment registration, and if not, why. Present exactly when paymentRegistrationId is.
legalName (string) --
The seller's registered legal name.
developerAddress (dict) --
The seller's postal address.
street1 (string) --
The first line of the street address.
street2 (string) --
The second line of the street address.
city (string) --
The city of the street address.
state (string) --
The state or province.
postalCode (string) --
The postal or ZIP code.
country (string) --
The ISO 3166-1 alpha-2 country code.
taxRegistrationNumber (string) --
The seller's tax registration number (for example, VAT, GST, or EIN).
businessType (string) --
Whether the seller registered as an individual or a registered business.
email (string) --
The seller's primary contact email, read from the seller profile.
supportEmail (string) --
The seller's support email address, displayed in the invoice footer.
displayName (string) --
Customer-facing name (doing-business-as) shown to buyers on invoices, read from the seller profile.
supportPhone (string) --
Customer-facing support phone number, read from the seller profile.
taxRegistrations (list) --
The jurisdictions where the seller is registered to collect tax.
(dict) --
A jurisdiction where the seller is registered to collect tax.
countryCode (string) --
The ISO 3166-1 alpha-2 country code.
state (string) --
The state or province code (for example, "NY" or "CA"). Required for US and CA.
collectionType (string) --
The country-specific collection type (for example, "state_sales_tax", "standard", or "simplified").
registrationType (string) --
Which tax this registration is for, or which entity identifier it carries (for example SALES_USE for a US state, VAT or GST elsewhere, FEDERAL_EIN for a US employer identification number). Optional.
registrationId (string) --
The tax ID issued for this registration (permit number or tax registration number). Optional.
locality (string) --
Jurisdiction below the state, as a code rather than a name: a FIPS code in the US, an IBGE code in Brazil. Requires state. Optional.
createdAt (datetime) --
The time the payment registration was created.
updatedAt (datetime) --
The time the payment registration was last updated.
Returns the details of a plan.
See also: AWS API Documentation
Request Syntax
client.get_plan(
appId='string',
planId='string',
stage='DRAFT'|'PUBLISHED',
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app.
string
[REQUIRED]
The identifier of the plan. AWS App Monetization generates this value when you create the plan. It is unique within the app and is never reused. Treat it as opaque.
string
The offering stage to read the plan from: DRAFT (the latest draft) or PUBLISHED (the offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.
string
[REQUIRED]
Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft (what the sandbox runs).
dict
Response Syntax
{
'plan': {
'appId': 'string',
'planId': 'string',
'definition': {
'name': 'string',
'description': 'string',
'billingCycle': 'MONTHLY'|'ANNUAL'|'ONE_TIME',
'subscriptionPrice': {
'currencyCode': 'string',
'amount': 'string'
},
'includedQuotas': {
'string': {
'flat': {
'includedQuantity': 123,
'overagePolicy': 'NO_OVERAGE_THROTTLE'|'APPLY_FIXED_OVERAGE'|'APPLY_TIERED_OVERAGE',
'overagePrice': {
'currencyCode': 'string',
'amount': 'string'
},
'tieredOverage': {
'semantics': 'GRADUATED'|'VOLUME',
'tiers': [
{
'firstUnit': 123,
'lastUnit': 123,
'unitPrice': {
'currencyCode': 'string',
'amount': 'string'
}
},
]
},
'maxQuantity': 123
},
'tiered': {
'includedQuantity': 123,
'tieredPrice': {
'semantics': 'GRADUATED'|'VOLUME',
'tiers': [
{
'firstUnit': 123,
'lastUnit': 123,
'unitPrice': {
'currencyCode': 'string',
'amount': 'string'
}
},
]
},
'maxQuantity': 123
}
}
},
'taxCode': 'string',
'paymentFailurePolicy': {
'retryAttempts': 123,
'retryWindowDays': 123,
'downgradeToPlanId': 'string'
}
},
'stage': 'DRAFT'|'PUBLISHED',
'createdAt': datetime(2015, 1, 1),
'updatedAt': datetime(2015, 1, 1),
'arn': 'string'
}
}
Response Structure
(dict) --
Output for GetPlan.
plan (dict) --
The requested plan.
appId (string) --
The ID of the app the plan belongs to.
planId (string) --
The identifier of the plan. AWS App Monetization generates this value when the plan is created. It is unique within the app and is never reused. Treat it as opaque.
definition (dict) --
The plan's pricing and packaging definition.
name (string) --
A human-readable display name for the plan.
description (string) --
A human-readable description of the plan.
billingCycle (string) --
How often the plan bills.
subscriptionPrice (dict) --
The recurring subscription price charged each billing cycle.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
includedQuotas (dict) --
The usage quotas included with the plan, keyed by metric ID. Each entry prices one metric with either a flat grant or a tiered-priced grant.
(string) --
The service-assigned ID of a metric.
(dict) --
How one metric is priced on a plan: exactly one of a flat grant or a tiered-priced grant. Both arms carry the free allowance ( includedQuantity) with the same meaning.
flat (dict) --
A flat grant: free allowance plus an optional overage policy.
includedQuantity (integer) --
The free allowance included with the plan for this metric.
overagePolicy (string) --
How usage beyond the included allowance is handled.
overagePrice (dict) --
The per-unit price charged for usage beyond the included allowance under a fixed overage policy.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
tieredOverage (dict) --
The tiered overage schedule applied to usage beyond the included allowance under a tiered overage policy.
semantics (string) --
Whether the bands price graduated (each band's units at its own rate, summed) or volume (all charged units at the rate of the band reached).
tiers (list) --
The ordered price bands, from lowest units to highest.
(dict) --
One band of a tiered price or overage schedule: a unit range and the per-unit price that applies within it.
firstUnit (integer) --
The first unit covered by this band.
lastUnit (integer) --
The last unit covered by this band. Absent on the final, unbounded band.
unitPrice (dict) --
The per-unit price charged within this band.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
maxQuantity (integer) --
Usage at which further entitlement checks for this metric are denied, in whole units per billing period, counting the included allowance. Must be at least includedQuantity (equal is a hard stop at the allowance) and is allowed only on a grant that charges past its allowance. Checked at entitlement time against usage already recorded; one allowed action's quantity is not clamped. Prepaid usage-pack units sit outside it. One cap per billing period. Absent means no cap.
tiered (dict) --
A tiered-priced grant: free allowance plus a tier-ladder price schedule.
includedQuantity (integer) --
The free allowance included with the plan for this metric. May be 0, in which case the metric is tier-priced from the first charged unit.
tieredPrice (dict) --
The tiered price schedule applied to charged usage for this metric.
semantics (string) --
Whether the bands price graduated (each band's units at its own rate, summed) or volume (all charged units at the rate of the band reached).
tiers (list) --
The ordered price bands, from lowest units to highest. Uses the same TierBand shape (firstUnit/lastUnit/unitPrice) as tiered overage bands.
(dict) --
One band of a tiered price or overage schedule: a unit range and the per-unit price that applies within it.
firstUnit (integer) --
The first unit covered by this band.
lastUnit (integer) --
The last unit covered by this band. Absent on the final, unbounded band.
unitPrice (dict) --
The per-unit price charged within this band.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
maxQuantity (integer) --
Usage at which further entitlement checks for this metric are denied, in whole units per billing period, counting the included allowance. Must be at least includedQuantity (equal is a hard stop at the allowance) and is allowed only on a grant that charges past its allowance. Checked at entitlement time against usage already recorded; one allowed action's quantity is not clamped. Prepaid usage-pack units sit outside it. One cap per billing period. Absent means no cap.
taxCode (string) --
The product tax code for the plan's price. See ProductTaxCode.
paymentFailurePolicy (dict) --
How the plan handles a failed recurring payment.
retryAttempts (integer) --
The total number of payment attempts for a failed recurring payment, including the first attempt, before the failure is final. For example, 3 means the first attempt and up to 2 retries.
retryWindowDays (integer) --
The number of days over which to retry a failed recurring payment.
downgradeToPlanId (string) --
Plan to move the subscriber to once the attempts are exhausted.
stage (string) --
The offering stage the plan was read from.
createdAt (datetime) --
The time the plan was created.
updatedAt (datetime) --
The time the plan was last updated.
arn (string) --
The Amazon Resource Name (ARN) of the plan.
Creates a pricing plan for an app. The plan's identifier is not supplied in the request; AWS App Monetization mints a server-generated planId and returns it on the created plan. The new plan exists on the draft (DRAFT) offering until it is published with PublishDraft.
See also: AWS API Documentation
Request Syntax
client.create_plan(
appId='string',
definition={
'name': 'string',
'description': 'string',
'billingCycle': 'MONTHLY'|'ANNUAL'|'ONE_TIME',
'subscriptionPrice': {
'currencyCode': 'string',
'amount': 'string'
},
'includedQuotas': {
'string': {
'flat': {
'includedQuantity': 123,
'overagePolicy': 'NO_OVERAGE_THROTTLE'|'APPLY_FIXED_OVERAGE'|'APPLY_TIERED_OVERAGE',
'overagePrice': {
'currencyCode': 'string',
'amount': 'string'
},
'tieredOverage': {
'semantics': 'GRADUATED'|'VOLUME',
'tiers': [
{
'firstUnit': 123,
'lastUnit': 123,
'unitPrice': {
'currencyCode': 'string',
'amount': 'string'
}
},
]
},
'maxQuantity': 123
},
'tiered': {
'includedQuantity': 123,
'tieredPrice': {
'semantics': 'GRADUATED'|'VOLUME',
'tiers': [
{
'firstUnit': 123,
'lastUnit': 123,
'unitPrice': {
'currencyCode': 'string',
'amount': 'string'
}
},
]
},
'maxQuantity': 123
}
}
},
'taxCode': 'string',
'paymentFailurePolicy': {
'retryAttempts': 123,
'retryWindowDays': 123,
'downgradeToPlanId': 'string'
}
},
clientToken='string',
tags={
'string': 'string'
}
)
string
[REQUIRED]
The ID of the app the plan belongs to.
dict
[REQUIRED]
The pricing and packaging definition for the plan. The plan's identifier is not supplied here: CreatePlan mints a server-generated planId and returns it on the created plan.
name (string) -- [REQUIRED]
A human-readable display name for the plan.
description (string) --
A human-readable description of the plan.
billingCycle (string) -- [REQUIRED]
How often the plan bills.
subscriptionPrice (dict) -- [REQUIRED]
The recurring subscription price charged each billing cycle.
currencyCode (string) -- [REQUIRED]
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) -- [REQUIRED]
An arbitrary-precision decimal represented as a string (for example, "9.99").
includedQuotas (dict) --
The usage quotas included with the plan, keyed by metric ID. Each entry prices one metric with either a flat grant or a tiered-priced grant.
(string) --
The service-assigned ID of a metric.
(dict) --
How one metric is priced on a plan: exactly one of a flat grant or a tiered-priced grant. Both arms carry the free allowance ( includedQuantity) with the same meaning.
flat (dict) --
A flat grant: free allowance plus an optional overage policy.
includedQuantity (integer) -- [REQUIRED]
The free allowance included with the plan for this metric.
overagePolicy (string) --
How usage beyond the included allowance is handled.
overagePrice (dict) --
The per-unit price charged for usage beyond the included allowance under a fixed overage policy.
currencyCode (string) -- [REQUIRED]
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) -- [REQUIRED]
An arbitrary-precision decimal represented as a string (for example, "9.99").
tieredOverage (dict) --
The tiered overage schedule applied to usage beyond the included allowance under a tiered overage policy.
semantics (string) -- [REQUIRED]
Whether the bands price graduated (each band's units at its own rate, summed) or volume (all charged units at the rate of the band reached).
tiers (list) -- [REQUIRED]
The ordered price bands, from lowest units to highest.
(dict) --
One band of a tiered price or overage schedule: a unit range and the per-unit price that applies within it.
firstUnit (integer) -- [REQUIRED]
The first unit covered by this band.
lastUnit (integer) --
The last unit covered by this band. Absent on the final, unbounded band.
unitPrice (dict) -- [REQUIRED]
The per-unit price charged within this band.
currencyCode (string) -- [REQUIRED]
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) -- [REQUIRED]
An arbitrary-precision decimal represented as a string (for example, "9.99").
maxQuantity (integer) --
Usage at which further entitlement checks for this metric are denied, in whole units per billing period, counting the included allowance. Must be at least includedQuantity (equal is a hard stop at the allowance) and is allowed only on a grant that charges past its allowance. Checked at entitlement time against usage already recorded; one allowed action's quantity is not clamped. Prepaid usage-pack units sit outside it. One cap per billing period. Absent means no cap.
tiered (dict) --
A tiered-priced grant: free allowance plus a tier-ladder price schedule.
includedQuantity (integer) -- [REQUIRED]
The free allowance included with the plan for this metric. May be 0, in which case the metric is tier-priced from the first charged unit.
tieredPrice (dict) -- [REQUIRED]
The tiered price schedule applied to charged usage for this metric.
semantics (string) -- [REQUIRED]
Whether the bands price graduated (each band's units at its own rate, summed) or volume (all charged units at the rate of the band reached).
tiers (list) -- [REQUIRED]
The ordered price bands, from lowest units to highest. Uses the same TierBand shape (firstUnit/lastUnit/unitPrice) as tiered overage bands.
(dict) --
One band of a tiered price or overage schedule: a unit range and the per-unit price that applies within it.
firstUnit (integer) -- [REQUIRED]
The first unit covered by this band.
lastUnit (integer) --
The last unit covered by this band. Absent on the final, unbounded band.
unitPrice (dict) -- [REQUIRED]
The per-unit price charged within this band.
currencyCode (string) -- [REQUIRED]
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) -- [REQUIRED]
An arbitrary-precision decimal represented as a string (for example, "9.99").
maxQuantity (integer) --
Usage at which further entitlement checks for this metric are denied, in whole units per billing period, counting the included allowance. Must be at least includedQuantity (equal is a hard stop at the allowance) and is allowed only on a grant that charges past its allowance. Checked at entitlement time against usage already recorded; one allowed action's quantity is not clamped. Prepaid usage-pack units sit outside it. One cap per billing period. Absent means no cap.
taxCode (string) --
The product tax code for the plan's price. See ProductTaxCode.
paymentFailurePolicy (dict) --
How the plan handles a failed recurring payment.
retryAttempts (integer) --
The total number of payment attempts for a failed recurring payment, including the first attempt, before the failure is final. For example, 3 means the first attempt and up to 2 retries.
retryWindowDays (integer) --
The number of days over which to retry a failed recurring payment.
downgradeToPlanId (string) --
Plan to move the subscriber to once the attempts are exhausted.
string
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.
This field is autopopulated if not provided.
dict
Optional tags to add to the plan when it is created. Tagging on create also requires permission for appmonetization:TagResource.
(string) --
A tag key. Keys that begin with aws: (in any letter case) are reserved and rejected.
(string) --
A tag value.
dict
Response Syntax
{
'plan': {
'appId': 'string',
'planId': 'string',
'definition': {
'name': 'string',
'description': 'string',
'billingCycle': 'MONTHLY'|'ANNUAL'|'ONE_TIME',
'subscriptionPrice': {
'currencyCode': 'string',
'amount': 'string'
},
'includedQuotas': {
'string': {
'flat': {
'includedQuantity': 123,
'overagePolicy': 'NO_OVERAGE_THROTTLE'|'APPLY_FIXED_OVERAGE'|'APPLY_TIERED_OVERAGE',
'overagePrice': {
'currencyCode': 'string',
'amount': 'string'
},
'tieredOverage': {
'semantics': 'GRADUATED'|'VOLUME',
'tiers': [
{
'firstUnit': 123,
'lastUnit': 123,
'unitPrice': {
'currencyCode': 'string',
'amount': 'string'
}
},
]
},
'maxQuantity': 123
},
'tiered': {
'includedQuantity': 123,
'tieredPrice': {
'semantics': 'GRADUATED'|'VOLUME',
'tiers': [
{
'firstUnit': 123,
'lastUnit': 123,
'unitPrice': {
'currencyCode': 'string',
'amount': 'string'
}
},
]
},
'maxQuantity': 123
}
}
},
'taxCode': 'string',
'paymentFailurePolicy': {
'retryAttempts': 123,
'retryWindowDays': 123,
'downgradeToPlanId': 'string'
}
},
'stage': 'DRAFT'|'PUBLISHED',
'createdAt': datetime(2015, 1, 1),
'updatedAt': datetime(2015, 1, 1),
'arn': 'string'
}
}
Response Structure
(dict) --
Output for CreatePlan.
plan (dict) --
The newly created plan, carrying its server-generated planId. It exists on the draft (DRAFT) offering until it is published.
appId (string) --
The ID of the app the plan belongs to.
planId (string) --
The identifier of the plan. AWS App Monetization generates this value when the plan is created. It is unique within the app and is never reused. Treat it as opaque.
definition (dict) --
The plan's pricing and packaging definition.
name (string) --
A human-readable display name for the plan.
description (string) --
A human-readable description of the plan.
billingCycle (string) --
How often the plan bills.
subscriptionPrice (dict) --
The recurring subscription price charged each billing cycle.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
includedQuotas (dict) --
The usage quotas included with the plan, keyed by metric ID. Each entry prices one metric with either a flat grant or a tiered-priced grant.
(string) --
The service-assigned ID of a metric.
(dict) --
How one metric is priced on a plan: exactly one of a flat grant or a tiered-priced grant. Both arms carry the free allowance ( includedQuantity) with the same meaning.
flat (dict) --
A flat grant: free allowance plus an optional overage policy.
includedQuantity (integer) --
The free allowance included with the plan for this metric.
overagePolicy (string) --
How usage beyond the included allowance is handled.
overagePrice (dict) --
The per-unit price charged for usage beyond the included allowance under a fixed overage policy.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
tieredOverage (dict) --
The tiered overage schedule applied to usage beyond the included allowance under a tiered overage policy.
semantics (string) --
Whether the bands price graduated (each band's units at its own rate, summed) or volume (all charged units at the rate of the band reached).
tiers (list) --
The ordered price bands, from lowest units to highest.
(dict) --
One band of a tiered price or overage schedule: a unit range and the per-unit price that applies within it.
firstUnit (integer) --
The first unit covered by this band.
lastUnit (integer) --
The last unit covered by this band. Absent on the final, unbounded band.
unitPrice (dict) --
The per-unit price charged within this band.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
maxQuantity (integer) --
Usage at which further entitlement checks for this metric are denied, in whole units per billing period, counting the included allowance. Must be at least includedQuantity (equal is a hard stop at the allowance) and is allowed only on a grant that charges past its allowance. Checked at entitlement time against usage already recorded; one allowed action's quantity is not clamped. Prepaid usage-pack units sit outside it. One cap per billing period. Absent means no cap.
tiered (dict) --
A tiered-priced grant: free allowance plus a tier-ladder price schedule.
includedQuantity (integer) --
The free allowance included with the plan for this metric. May be 0, in which case the metric is tier-priced from the first charged unit.
tieredPrice (dict) --
The tiered price schedule applied to charged usage for this metric.
semantics (string) --
Whether the bands price graduated (each band's units at its own rate, summed) or volume (all charged units at the rate of the band reached).
tiers (list) --
The ordered price bands, from lowest units to highest. Uses the same TierBand shape (firstUnit/lastUnit/unitPrice) as tiered overage bands.
(dict) --
One band of a tiered price or overage schedule: a unit range and the per-unit price that applies within it.
firstUnit (integer) --
The first unit covered by this band.
lastUnit (integer) --
The last unit covered by this band. Absent on the final, unbounded band.
unitPrice (dict) --
The per-unit price charged within this band.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
maxQuantity (integer) --
Usage at which further entitlement checks for this metric are denied, in whole units per billing period, counting the included allowance. Must be at least includedQuantity (equal is a hard stop at the allowance) and is allowed only on a grant that charges past its allowance. Checked at entitlement time against usage already recorded; one allowed action's quantity is not clamped. Prepaid usage-pack units sit outside it. One cap per billing period. Absent means no cap.
taxCode (string) --
The product tax code for the plan's price. See ProductTaxCode.
paymentFailurePolicy (dict) --
How the plan handles a failed recurring payment.
retryAttempts (integer) --
The total number of payment attempts for a failed recurring payment, including the first attempt, before the failure is final. For example, 3 means the first attempt and up to 2 retries.
retryWindowDays (integer) --
The number of days over which to retry a failed recurring payment.
downgradeToPlanId (string) --
Plan to move the subscriber to once the attempts are exhausted.
stage (string) --
The offering stage the plan was read from.
createdAt (datetime) --
The time the plan was created.
updatedAt (datetime) --
The time the plan was last updated.
arn (string) --
The Amazon Resource Name (ARN) of the plan.
Returns infrastructure cost for an app, grouped by service (the default), user, or time. To use this operation, you must also have permission for ce:GetCostAndUsage on your primary billing view.
See also: AWS API Documentation
Request Syntax
client.get_app_infra_cost_summary(
appId='string',
startedAt=datetime(2015, 1, 1),
endedAt=datetime(2015, 1, 1),
costType='ESTIMATE'|'ACTUAL',
groupBy='SERVICE'|'USER'|'TIME',
filterBy={
'string': [
'string',
]
},
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app.
datetime
[REQUIRED]
Start of the reporting window.
datetime
[REQUIRED]
End of the reporting window. Must be after startedAt, at most 720 hours after it, and not in the future.
string
[REQUIRED]
Specifies which cost data to return.
string
The breakdown dimension. Defaults to SERVICE when omitted.
dict
Filter constraints keyed by dimension. A filter dimension may differ from groupBy.
(string) --
Dimensions GetAppInfraCostSummary can group and filter by. TIME groups by UTC day.
(list) --
A list of filter values for a single dimension.
(string) --
Literal filter value, 1-256 characters.
string
[REQUIRED]
Required. The environment: live or sandbox.
dict
Response Syntax
{
'appId': 'string',
'costType': 'ESTIMATE'|'ACTUAL',
'currency': 'USD',
'groupBy': 'SERVICE'|'USER'|'TIME',
'total': 'string',
'groups': [
{
'key': 'string',
'cost': 'string'
},
],
'startedAt': datetime(2015, 1, 1),
'endedAt': datetime(2015, 1, 1),
'updatedAt': datetime(2015, 1, 1)
}
Response Structure
(dict) --
Output for GetAppInfraCostSummary.
appId (string) --
The ID of the app.
costType (string) --
The cost data that this summary reflects (echoes the request).
currency (string) --
The ISO 4217 currency code of the cost amounts.
groupBy (string) --
The dimension that the summary is grouped by.
total (string) --
The total cost for the window.
groups (list) --
One row per value of the groupBy dimension (cost per service, user, or UTC day).
(dict) --
A cost total for a single value of the groupBy dimension.
key (string) --
The value of the groupBy dimension for this row.
cost (string) --
The cost attributed to this group.
startedAt (datetime) --
Start of the reporting window the summary covers.
endedAt (datetime) --
End of the reporting window the summary covers.
updatedAt (datetime) --
The time the summary was last updated.
Cancels a user's subscription at the end of the current billing period.
See also: AWS API Documentation
Request Syntax
client.cancel_subscription(
appId='string',
userId='string',
effectiveAt=datetime(2015, 1, 1),
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app.
string
[REQUIRED]
An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
datetime
[REQUIRED]
The subscription's current effective time, as returned by GetSubscription, used as an optimistic-concurrency check. If GetSubscription returns a pending change, pass pendingChange.effectiveAt; otherwise pass subscription.effectiveAt. This value does not choose when the cancellation takes effect: a new cancellation takes effect at the end of the current billing period, returned as cancellationEffectiveAt. If the subscription's effective time has changed since you read it (for example, because another plan change was made), the value no longer matches and the request fails with ConflictException; call GetSubscription again and retry with the new value. If the subscription is already cancelled or a cancellation is already scheduled, the request returns its current state and does not compare this value.
string
[REQUIRED]
Required. The environment: live or sandbox.
dict
Response Syntax
{
'subscription': {
'appId': 'string',
'userId': 'string',
'planId': 'string',
'effectiveAt': datetime(2015, 1, 1),
'billingAnchorDate': datetime(2015, 1, 1),
'billingCycle': 'MONTHLY'|'ANNUAL'|'ONE_TIME'
},
'cancellationEffectiveAt': datetime(2015, 1, 1)
}
Response Structure
(dict) --
Output for CancelSubscription.
subscription (dict) --
The subscription as it stands after the cancellation is scheduled.
appId (string) --
The ID of the app that the subscription belongs to.
userId (string) --
The opaque end-user identifier that the subscription belongs to.
planId (string) --
The ID of the plan that the user is subscribed to.
effectiveAt (datetime) --
The time when the subscription took effect.
billingAnchorDate (datetime) --
The fixed reference instant the recurring billing cycle is measured from. It is set when the subscription first takes effect and stays fixed as periods roll forward, so it is normally an older date than the current period — not the start of the current period. For the end of the current cycle, use currentPeriodEndsAt on GetSubscriptionResponse (derived from this anchor and the billing cycle) rather than this value.
billingCycle (string) --
The billing cycle of the subscription, such as monthly or annual.
cancellationEffectiveAt (datetime) --
The time when the cancellation takes effect, at the end of the current billing period. The subscription remains active until this time.
Updates an existing metric. Only a draft metric, one that has never been published, can be modified. After a metric is published, every field is frozen and any update is rejected with a ConflictException. To change a published metric, archive it and create a new metric.
See also: AWS API Documentation
Request Syntax
client.update_metric(
appId='string',
metricId='string',
name='string',
description='string',
eventType='string',
unitName='string',
definition={
'filters': [
{
'field': 'string',
'operator': 'EQUALS'|'NOT_EQUALS'|'IN'|'NOT_IN',
'values': [
'string',
]
},
],
'function': 'SUM'|'COUNT'|'MAX',
'functionField': 'string',
'groupBy': [
'string',
],
'period': 'MONTHLY'
}
)
string
[REQUIRED]
The ID of the app.
string
[REQUIRED]
The ID of the metric to update.
string
A human-readable display name for the metric.
string
A description of what the metric measures.
string
The event type this metric aggregates.
string
The unit of measure for the metric (for example, "requests"), in lowercase snake_case.
dict
The aggregation definition: filters, aggregation function, grouping, and period.
filters (list) -- [REQUIRED]
The predicates selecting which events contribute to the metric. Combined with logical AND.
(dict) --
A single predicate that selects which events contribute to a metric.
field (string) -- [REQUIRED]
The event property key the filter is evaluated against.
operator (string) -- [REQUIRED]
The comparison operator (EQUALS, NOT_EQUALS, IN, or NOT_IN).
values (list) -- [REQUIRED]
The values the field is compared against.
(string) --
A value the field is compared against, 1-256 characters. Single quotes (') and backslashes () are not allowed.
function (string) -- [REQUIRED]
The aggregation function applied to matching events (SUM, COUNT, or MAX).
functionField (string) --
The event property key the aggregation function operates on. Required for SUM and MAX; ignored for COUNT.
groupBy (list) -- [REQUIRED]
The event fields to group aggregated results by.
(string) --
Name of an event property key referenced by a metric filter or aggregation (filter field, functionField, groupBy). Lowercase snake_case, 1-64 characters: letters, digits, and underscores only, starting with a letter. Unlike PropertyKey, dots are not allowed, so a metric can't reference a property whose key contains a dot.
period (string) -- [REQUIRED]
The reset or rollup period for the aggregation.
dict
Response Syntax
{
'metric': {
'appId': 'string',
'metricId': 'string',
'name': 'string',
'description': 'string',
'eventType': 'string',
'unitName': 'string',
'definition': {
'filters': [
{
'field': 'string',
'operator': 'EQUALS'|'NOT_EQUALS'|'IN'|'NOT_IN',
'values': [
'string',
]
},
],
'function': 'SUM'|'COUNT'|'MAX',
'functionField': 'string',
'groupBy': [
'string',
],
'period': 'MONTHLY'
},
'arn': 'string',
'stage': 'DRAFT'|'PUBLISHED'
}
}
Response Structure
(dict) --
Output for UpdateMetric.
metric (dict) --
The updated metric.
appId (string) --
The ID of the app the metric belongs to.
metricId (string) --
The ID of the metric. We assign this value when you create the metric; it is unique within the app. Treat it as opaque.
name (string) --
A human-readable display name for the metric.
description (string) --
A description of what the metric measures.
eventType (string) --
The event type this metric aggregates.
unitName (string) --
The unit of measure for the metric.
definition (dict) --
The aggregation definition: filters, aggregation function, grouping, and period.
filters (list) --
The predicates selecting which events contribute to the metric. Combined with logical AND.
(dict) --
A single predicate that selects which events contribute to a metric.
field (string) --
The event property key the filter is evaluated against.
operator (string) --
The comparison operator (EQUALS, NOT_EQUALS, IN, or NOT_IN).
values (list) --
The values the field is compared against.
(string) --
A value the field is compared against, 1-256 characters. Single quotes (') and backslashes () are not allowed.
function (string) --
The aggregation function applied to matching events (SUM, COUNT, or MAX).
functionField (string) --
The event property key the aggregation function operates on. Required for SUM and MAX; ignored for COUNT.
groupBy (list) --
The event fields to group aggregated results by.
(string) --
Name of an event property key referenced by a metric filter or aggregation (filter field, functionField, groupBy). Lowercase snake_case, 1-64 characters: letters, digits, and underscores only, starting with a letter. Unlike PropertyKey, dots are not allowed, so a metric can't reference a property whose key contains a dot.
period (string) --
The reset or rollup period for the aggregation.
arn (string) --
The Amazon Resource Name (ARN) of the metric. Output only.
stage (string) --
The offering stage this metric was read from: DRAFT or PUBLISHED. Present on metric reads; absent on write responses.
Archives a plan, removing it from the app's draft configuration so that it can no longer be subscribed to. The removal takes effect on the next call to PublishDraft. Existing subscriptions to the plan are unaffected, and the plan's display name is freed for reuse. The plan's included quotas are removed with it.
See also: AWS API Documentation
Request Syntax
client.archive_plan(
appId='string',
planId='string'
)
string
[REQUIRED]
The ID of the app.
string
[REQUIRED]
The identifier of the plan. We generate this value when you create the plan. It is unique within the app and is never reused. Treat it as opaque.
dict
Response Syntax
{
'appId': 'string',
'planId': 'string'
}
Response Structure
(dict) --
Output for ArchivePlan. Echoes the archived plan's identifiers.
appId (string) --
The ID of the app the archived plan belonged to.
planId (string) --
The server-generated identifier of the archived plan.
Subscribes a user to a plan or changes the user's current plan. The response returns exactly one outcome: payment is required (a checkout URL is returned), payment is not required (an effective date is returned), or, when no plan identifier is provided, plan selection is required (the hosted pricing page URL is returned). To make a one-time purchase of usage packs or add-ons, use CreateOneTimeCheckoutSession.
See also: AWS API Documentation
Request Syntax
client.create_subscription_checkout_session(
appId='string',
userId='string',
planId='string',
returnUrl='string',
refreshUrl='string',
sessionDurationSeconds=123,
clientToken='string',
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app the subscription is for.
string
[REQUIRED]
The ID of the end user being subscribed. Do not include personally identifiable or otherwise sensitive data in this value.
string
The plan to subscribe to or change to. Absent to open the hosted pricing page for the buyer to choose; the response then carries planSelectionRequired.pricingUrl.
string
[REQUIRED]
The URL the buyer's browser is sent to after they complete payment at checkout. If the buyer is sent to a hosted checkout page, this is that page's success-redirect target. If you omit planId, the buyer chooses a plan on a hosted pricing page. After that checkout, the buyer returns to the hosted pages, not to this URL.
string
[REQUIRED]
The URL the buyer's browser is sent to if they cancel or abandon the hosted checkout page without completing payment (the checkout page's cancel-redirect target). Point it at a page where the buyer can retry. If you omit planId, the buyer chooses a plan on a hosted pricing page. After that checkout, the buyer returns to the hosted pages, not to this URL.
integer
The lifetime of the hosted session, in seconds, counted from this call. Omit to use the service default. It does not set how long pricingUrl works; see expiresAt.
string
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.
This field is autopopulated if not provided.
string
[REQUIRED]
Required. The environment: live or sandbox.
dict
Response Syntax
{
'outcome': {
'paymentRequired': {
'checkoutUrl': 'string',
'expiresAt': datetime(2015, 1, 1)
},
'paymentNotRequired': {
'effectiveAt': datetime(2015, 1, 1)
},
'planSelectionRequired': {
'pricingUrl': 'string',
'sessionToken': 'string',
'expiresAt': datetime(2015, 1, 1)
}
}
}
Response Structure
(dict) --
Output for CreateSubscriptionCheckoutSession.
outcome (dict) --
The outcome of the request. Exactly one member of the union is set.
paymentRequired (dict) --
The money must be collected (an upgrade with an amount due now, or a paid target that needs a card captured). Redirect the buyer to checkoutUrl.
checkoutUrl (string) --
An absolute HTTP or HTTPS URL the buyer's browser is redirected to in order to complete payment.
expiresAt (datetime) --
The time when the checkout session expires.
paymentNotRequired (dict) --
The plan change needs no payment: a scheduled downgrade (effectiveAt is the next period boundary) or a change applied immediately or a no-op (effectiveAt is now).
effectiveAt (datetime) --
The instant the change takes effect: a future period boundary for a scheduled downgrade, or now for a change applied immediately or a no-op.
planSelectionRequired (dict) --
The buyer must select a plan on the hosted pricing page at pricingUrl before checkout can proceed, because no planId was supplied.
pricingUrl (string) --
A hosted pricing page URL that carries a session token or a single-use link in its fragment. The link works once, until expiresAt or the end of the session if sooner.
sessionToken (string) --
The checkout session token carried in the fragment of pricingUrl. Absent when pricingUrl carries a single-use link instead.
expiresAt (datetime) --
The time when the single-use link in pricingUrl expires, 10 minutes after it was created.
Returns the details of a one-time price.
See also: AWS API Documentation
Request Syntax
client.get_one_time_price(
appId='string',
oneTimePriceId='string',
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app the one-time price belongs to.
string
[REQUIRED]
The ID of the one-time price to return.
string
[REQUIRED]
Required. The environment: live or sandbox. live reads the published offering; sandbox reads the app's draft (what the sandbox runs).
dict
Response Syntax
{
'oneTimePrice': {
'arn': 'string',
'appId': 'string',
'oneTimePriceId': 'string',
'definition': {
'name': 'string',
'price': {
'currencyCode': 'string',
'amount': 'string'
},
'metricId': 'string',
'capacity': 123
},
'stage': 'DRAFT'|'PUBLISHED'
}
}
Response Structure
(dict) --
Output for GetOneTimePrice.
oneTimePrice (dict) --
The requested one-time price.
arn (string) --
The Amazon Resource Name (ARN) of the one-time price.
appId (string) --
The ID of the app the one-time price belongs to.
oneTimePriceId (string) --
The service-assigned ID of the one-time price.
definition (dict) --
The definition of the one-time price, including its display name, price, metric, and credited capacity.
name (string) --
A human-readable display name for the one-time price.
price (dict) --
The amount and currency charged for one purchase of the one-time price.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
metricId (string) --
The metric one purchase credits.
capacity (integer) --
The units of metricId one purchase credits.
stage (string) --
The offering stage the one-time price was read from.
Lists the tags on an app, pricing plan, billing metric or one-time price.
See also: AWS API Documentation
Request Syntax
client.list_tags_for_resource(
resourceArn='string'
)
string
[REQUIRED]
ARN of the app, pricing plan, billing metric or one-time price whose tags to list.
dict
Response Syntax
{
'tags': {
'string': 'string'
}
}
Response Structure
(dict) --
Output for ListTagsForResource.
tags (dict) --
The tags on the resource.
(string) --
A tag key. Keys that begin with aws: (in any letter case) are reserved and rejected.
(string) --
A tag value.
Publishes the app's current draft configuration to live in a single atomic operation. The published configuration includes all plans, metrics, capabilities, usage packs, add-ons, and free trials. A draft with more plans than the Published plans per app quota allows is refused with ServiceQuotaExceededException.
See also: AWS API Documentation
Request Syntax
client.publish_draft(
appId='string'
)
string
[REQUIRED]
The ID of the app.
dict
Response Syntax
{
'app': {
'appId': 'string',
'name': 'string',
'description': 'string',
'status': 'ACTIVE'|'DELETED',
'createdAt': datetime(2015, 1, 1),
'arn': 'string'
}
}
Response Structure
(dict) --
Output for PublishDraft.
app (dict) --
The app after publish. The published draft is now live.
appId (string) --
The service-assigned identifier for the app.
name (string) --
A human-readable display name for the app.
description (string) --
A longer description of what the app does.
status (string) --
The lifecycle status of the app.
createdAt (datetime) --
The time the app was created.
arn (string) --
The resource ARN of this app.
Returns subscription counts for an app, grouped by status (the default) or by plan. The summary contains no subscriber personally identifiable information.
See also: AWS API Documentation
Request Syntax
client.get_app_subscription_summary(
appId='string',
groupBy='STATUS'|'PLAN',
filterBy={
'string': [
'string',
]
},
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app.
string
The breakdown dimension. Defaults to STATUS when omitted.
dict
Filter constraints keyed by dimension. A filter dimension may differ from groupBy.
(string) --
Dimensions GetAppSubscriptionSummary can group and filter by.
(list) --
A list of filter values for a single dimension.
(string) --
Literal filter value, 1-256 characters.
string
[REQUIRED]
Required. The environment: live or sandbox.
dict
Response Syntax
{
'appId': 'string',
'groupBy': 'STATUS'|'PLAN',
'totalSubscribers': 123,
'groups': [
{
'key': 'string',
'count': 123
},
],
'updatedAt': datetime(2015, 1, 1)
}
Response Structure
(dict) --
Output for GetAppSubscriptionSummary.
appId (string) --
The ID of the app.
groupBy (string) --
The dimension that the summary is grouped by.
totalSubscribers (integer) --
The total number of subscribers across the app.
groups (list) --
One row per value of the groupBy dimension (subscriber count per status or per plan).
(dict) --
A subscriber count for a single value of the groupBy dimension.
key (string) --
The value of the groupBy dimension for this row.
count (integer) --
The number of subscribers in this group.
updatedAt (datetime) --
The time the summary was last updated.
Records a usage event for a user of an app. Usage events are the raw input that metrics aggregate.
See also: AWS API Documentation
Request Syntax
client.put_event(
appId='string',
clientToken='string',
userId='string',
eventType='string',
quantity='string',
timestamp=datetime(2015, 1, 1),
properties={
'string': 'string'
},
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app the event belongs to.
string
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.
This field is autopopulated if not provided.
string
[REQUIRED]
The ID of the end user the event is attributed to. Do not include personally identifiable or otherwise sensitive data in this value.
string
[REQUIRED]
The event type. Correlates with the event type of the metrics that aggregate it.
string
[REQUIRED]
The amount of usage the event represents, as a non-negative decimal string (for example, "1" or "12.5").
datetime
[REQUIRED]
The time the event occurred.
dict
The key/value properties carried on the event, usable in metric filters and grouping. When a metric sums or takes the max of a property, that property's value must be a plain non-negative decimal (up to 15 digits before the point and 6 after; no sign, exponent, spaces, or commas, for example "1200" or "12.5"), and events that break this are rejected.
(string) --
Key of an event property. Lowercase, starting with a letter; letters, digits, underscore, and dot; 1-64 characters.
(string) --
Value of an event property, up to 256 characters.
string
[REQUIRED]
The environment of the app that this operation applies to: the live app or the app's isolated sandbox test environment.
dict
Response Syntax
{
'eventId': 'string',
'status': 'string'
}
Response Structure
(dict) --
Output for PutEvent.
eventId (string) --
The server-assigned identifier for the recorded event.
status (string) --
The status of the recorded event.
Returns an entitlement decision for a user action, indicating whether the action is allowed and why. It takes the pending event's quantity and properties so the check sizes the decision per metric the way PutEvent counts the event: it applies each metric's filter to the properties, counts 1 for a COUNT metric, and reads the summed or maxed field value for a SUM or MAX metric. The decision is DENY when usage already reached the limit, or when folding this event in would push it past (a SUM or COUNT metric adds the increment to current usage, a MAX metric takes the larger of the two). Send the same eventType, quantity and properties you will send on the event: the check applies the rules PutEvent applies to that event. A SUM or MAX metric that reads a property rejects the check with a ValidationException when the property is missing or not a plain decimal, including when properties are omitted or sent as {}; a metric filter matches only properties that are present, so a filtered metric is skipped for an event with no properties, as PutEvent skips it. It is idempotent, and it may create the user's default-plan subscription on first use.
See also: AWS API Documentation
Request Syntax
client.get_entitlement_decision(
appId='string',
userId='string',
eventType='string',
scope='sandbox'|'live',
quantity='string',
properties={
'string': 'string'
}
)
string
[REQUIRED]
The ID of the app.
string
[REQUIRED]
An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
string
[REQUIRED]
The type of action the user is attempting, used to determine the applicable plan capability and quota. Use the same event type you will send on the event.
string
[REQUIRED]
The environment of the app that this operation applies to. Specify live to use the live app, or sandbox to use the app's isolated test environment.
string
[REQUIRED]
The number of units the pending action will consume, as a non-negative decimal string (the same Quantity shape PutEvent uses). Send the real amount if known, otherwise your best upper estimate (for example a request's max tokens). Used when a metric counts events or sums or maxes the event quantity itself. The decision is DENY when usage already reached the limit, or when folding this event in would push it past (SUM and COUNT add the increment; MAX takes the larger of current usage and the increment).
dict
The same event properties you will send on the event. Each metric's filter is applied to them, and a summed or maxed field value is read from them. Omit them or send {} when the event has none; a metric that sums or maxes a property then rejects the check, as PutEvent rejects the event. Do not include personally identifiable or otherwise sensitive data in these values.
(string) --
Key of an event property. Lowercase, starting with a letter; letters, digits, underscore, and dot; 1-64 characters.
(string) --
Value of an event property, up to 256 characters.
dict
Response Syntax
{
'decision': 'ALLOW'|'DENY',
'reason': {
'category': 'CAPABILITY'|'USAGE'|'SYSTEM',
'code': 'ALLOWED'|'WITHIN_QUOTA'|'NO_QUOTA_RESTRICTION'|'OVERAGE_ACCRUING'|'SERVICE_DEGRADED'|'PAYMENT_PAST_DUE'|'COVERED_BY_PURCHASED_UNITS'|'NO_SUBSCRIPTION'|'SUBSCRIPTION_INACTIVE'|'CAPABILITY_NOT_INCLUDED'|'QUOTA_EXCEEDED'|'SUBSCRIPTION_SUSPENDED'|'OUT_OF_UNITS'
},
'planId': 'string',
'metrics': [
{
'metricId': 'string',
'usedQuantity': 123,
'includedQuantity': 123,
'remainingQuantity': 123
},
]
}
Response Structure
(dict) --
Output for GetEntitlementDecision.
decision (string) --
The decision indicating whether the user may perform the action.
reason (dict) --
The reason behind the decision.
category (string) --
The category of the reason for the decision.
code (string) --
The specific reason code for the decision.
planId (string) --
The ID of the plan the decision was evaluated against, when the user has a subscription.
metrics (list) --
The per-metric quota status relevant to the decision.
(dict) --
The quota status of a single metric for the period.
metricId (string) --
The ID of the metric.
usedQuantity (integer) --
The quantity of the metric already used in the current period.
includedQuantity (integer) --
The quantity included for the period, prorated after a mid-period plan change. Only metrics with a limit are listed.
remainingQuantity (integer) --
max(0, includedQuantity - usedQuantity).
Returns billed revenue for an app for a billing period, grouped by plan.
See also: AWS API Documentation
Request Syntax
client.get_app_revenue_summary(
appId='string',
period='string',
groupBy='PLAN',
filterBy={
'string': [
'string',
]
},
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app.
string
The billing period, in "YYYY-MM" form. Defaults to the current month when omitted.
string
The breakdown dimension. Defaults to PLAN when omitted.
dict
Filter constraints keyed by dimension. A filter dimension may differ from groupBy.
(string) --
Dimensions GetAppRevenueSummary can group and filter by.
(list) --
A list of filter values for a single dimension.
(string) --
Literal filter value, 1-256 characters.
string
[REQUIRED]
Required. The environment: live or sandbox.
dict
Response Syntax
{
'appId': 'string',
'period': 'string',
'currency': 'USD',
'groupBy': 'PLAN',
'totalRevenue': 'string',
'subscriptionRevenue': 'string',
'usageRevenue': 'string',
'groups': [
{
'key': 'string',
'users': 123,
'subscriptionRevenue': 'string',
'usageRevenue': 'string',
'totalRevenue': 'string'
},
],
'updatedAt': datetime(2015, 1, 1)
}
Response Structure
(dict) --
Output for GetAppRevenueSummary.
appId (string) --
The ID of the app.
period (string) --
The billing period, in "YYYY-MM" form, that the summary covers.
currency (string) --
The ISO 4217 currency code of the revenue amounts.
groupBy (string) --
The dimension that the summary is grouped by.
totalRevenue (string) --
The total revenue for the period, as the sum of subscription and usage revenue.
subscriptionRevenue (string) --
The subscription revenue for the period.
usageRevenue (string) --
The usage-based revenue for the period.
groups (list) --
One row per value of the groupBy dimension (revenue per plan).
(dict) --
A revenue breakdown for a single value of the groupBy dimension.
key (string) --
The value of the groupBy dimension for this row.
users (integer) --
The number of users attributed to this group.
subscriptionRevenue (string) --
The subscription revenue for this group.
usageRevenue (string) --
The usage-based revenue for this group.
totalRevenue (string) --
The total revenue for this group.
updatedAt (datetime) --
The time the summary was last updated.
Returns a single third-party cost by its identifier. An unknown cost identifier returns a ResourceNotFoundException.
See also: AWS API Documentation
Request Syntax
client.get_third_party_cost(
appId='string',
costId='string'
)
string
[REQUIRED]
The ID of the app.
string
[REQUIRED]
The ID of the cost to return.
dict
Response Syntax
{
'item': {
'appId': 'string',
'costId': 'string',
'label': 'string',
'amount': 'string',
'frequency': 'MONTHLY',
'currency': 'USD',
'description': 'string',
'effectiveFrom': 'string',
'effectiveTo': 'string',
'createdAt': datetime(2015, 1, 1),
'updatedAt': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Output for GetThirdPartyCost.
item (dict) --
The requested third-party cost.
appId (string) --
The ID of the app the cost belongs to.
costId (string) --
The ID of the cost.
label (string) --
A human-readable label for the cost (for example, "Anthropic API").
amount (string) --
The flat monthly amount as a decimal string (for example, "12.50").
frequency (string) --
How often the cost recurs. MONTHLY is the only value today.
currency (string) --
The currency of the amount. USD is the only supported currency.
description (string) --
A free-form description of the cost.
effectiveFrom (string) --
First month (YYYY-MM) the cost applies in. Absent means the cost has no start month.
effectiveTo (string) --
Last month (YYYY-MM) the cost applies in. Absent means the cost has no end month.
createdAt (datetime) --
The time the cost was created.
updatedAt (datetime) --
The time the cost was last updated.
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}]}.
See also: AWS API Documentation
Request Syntax
client.get_plan_recommendation(
appName='string',
segment='CONSUMER'|'PROSUMER'|'ENTERPRISE',
appType='INFRASTRUCTURE'|'DAILY_WORKFLOW'|'PERIODIC_WORKFLOW'|'POINT_UTILITY'|'CREATIVE'|'API_WRAPPER',
valueKind='PRODUCTIVITY'|'EXPERIENTIAL',
actions=[
{
'name': 'string',
'unit': 'string',
'unitCost': 123.0,
'typicalMonthlyUsage': 123.0,
'minutesSaved': 123.0,
'moneySaved': 123.0,
'valuePerUse': 123.0
},
],
hourlyRate=123.0,
valueShare=123.0,
features={
'appScores': {
'string': 123.0
},
'weights': {
'string': 123.0
}
},
costs={
'source': 'ACTUALS'|'LIVE'|'ESTIMATE'|'NONE',
'unknown': [
'string',
],
'fixedMonthlyCost': 123.0,
'margins': [
123.0,
]
},
alternatives={
'comparablesOptIn': 'OPTED_IN'|'OPTED_OUT',
'comparables': [
{
'name': 'string',
'url': 'string',
'mechanism': 'PAID_SUB'|'PER_REQUEST'|'FREE_CAPPED'|'FREEMIUM'|'ONE_TIME',
'price': {
'currencyCode': 'string',
'amount': 'string'
},
'cap': 123.0,
'includedUnits': 123.0,
'overageRate': 123.0,
'quality': 123.0,
'features': {
'string': 123.0
}
},
],
'outsideOptions': [
{
'name': 'string',
'monthlyCost': 123.0,
'quality': 123.0,
'features': {
'string': 123.0
}
},
]
},
market={
'expectedUsers': 123,
'measuredConversion': {
'payingUsers': 123,
'users': 123
},
'customerTypes': [
{
'name': 'string',
'share': 123.0,
'usageMultiplier': 123.0,
'valuePerUseMultiplier': 123.0,
'usageSpread': 'SIMILAR'|'NORMAL'|'VARIED'|'EXTREME',
'featureWeights': {
'string': 123.0
}
},
],
'checkoutDropOff': {
'freePlan': 123.0,
'flat': 123.0,
'perUse': 123.0,
'tiered': 123.0
}
},
planOptions={
'pricingModelPreference': 'FLAT'|'TIERED'|'PER_USE'|'PER_USE_SPLIT',
'freeTierInclusion': 'INCLUDE'|'EXCLUDE',
'maxTierInclusion': 'INCLUDE'|'EXCLUDE',
'annualPlanInclusion': 'INCLUDE'|'EXCLUDE',
'creditPackInclusion': 'INCLUDE'|'EXCLUDE',
'planPrices': [
{
'planCode': 'string',
'actionName': 'string',
'price': {
'currencyCode': 'string',
'amount': 'string'
}
},
],
'publishedPrice': {
'currencyCode': 'string',
'amount': 'string'
}
},
context={
'nonAwsCostsNote': 'string',
'valueBasis': 'string',
'expectedUsersBasis': 'string',
'usageSources': {
'string': 'ESTIMATE'|'MEASURED'
},
'customerTypeDescriptions': {
'string': 'string'
}
}
)
string
Display name of the app, used in the rendered text. Absent: your app.
string
[REQUIRED]
Who buys the app.
string
[REQUIRED]
Kind of app. It sets the service's usage and value benchmarks for this kind of app.
string
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).
list
[REQUIRED]
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.
(dict) --
One billable action: something a user does that costs money to serve and can be charged for.
name (string) --
Action name, used as the metric key in plans, unitPrices and creditPacks. Unique within the request. Required when there is more than one action. Absent with exactly one action: usage.
unit (string) --
Unit the action is counted in, for example lesson or report. Defaults to name.
unitCost (float) --
Cost to serve one unit, in USD. Give it on every action or on none: required when another action has unitCost, and when costs.source is ACTUALS, LIVE or ESTIMATE. Absent on every action: cost to serve is not checked ( costs.source NONE). When any action's unitCost is 0, costs.source is required.
typicalMonthlyUsage (float) -- [REQUIRED]
Typical number of units one user consumes per month.
minutesSaved (float) --
Minutes one unit saves a customer compared with doing the task by hand. Sets the value of one use, together with hourlyRate (required with it): minutesSaved / 60 x hourlyRate x the value share that valueShare describes. Give at most one of minutesSaved, moneySaved and valuePerUse per action: a request that gives two on the same action is rejected. Rejected with valueKind EXPERIENTIAL, as are moneySaved and valuePerUse. Absent: this action's value, if any, is moneySaved or valuePerUse (see valuePerUse for no value).
moneySaved (float) --
Money one use saves the buyer, in USD: what they would otherwise spend on it (a service, a contractor, compute or paid staff time). The server values one use at a share of it; the share is set server-side, not an input ( valueShare does not apply). Give at most one of minutesSaved, moneySaved and valuePerUse per action: a request that gives two on the same action is rejected. Use valuePerUse when you have already worked out the dollar value of one use. Rejected with valueKind EXPERIENTIAL. Absent: this action's value, if any, is minutesSaved or valuePerUse (see valuePerUse for no value).
valuePerUse (float) --
Value of one unit to a typical customer, in USD: the final dollar value of one use ( valueShare does not apply), for an action that saves no time or money but has a dollar value (for example a lead worth 2 USD). Give at most one of minutesSaved, moneySaved and valuePerUse per action: a request that gives two on the same action is rejected. One of them is required when another action has a value basis (0 is allowed). 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. For an action whose value is the time it saves, give minutesSaved instead; say how the figures were worked out in context.valueBasis. Rejected with valueKind EXPERIENTIAL.
float
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.
float
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.
dict
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.
appScores (dict) -- [REQUIRED]
This app's score on each characteristic, from 0 to 1 against the best in class.
(string) --
Name of a characteristic customers decide on, for example privacy or speed.
(float) --
A score from 0 to 1 for a characteristic, measured against the best in class.
weights (dict) --
How much each characteristic matters, shared by every customer type that has no featureWeights of its own; they also rank the comparables when more than 5 are usable. Weights are relative. Absent: equal weights.
(string) --
Name of a characteristic customers decide on, for example privacy or speed.
(float) --
The relative weight of a characteristic in the customer decision.
dict
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).
source (string) --
Where the cost figures came from. Required when any actions[].unitCost is 0. Absent: NONE when no action has unitCost, ESTIMATE when every action has it. ACTUALS, LIVE and ESTIMATE need unitCost on every action.
unknown (list) --
Costs the developer knows exist but could not price, for example email provider. Omitted: the costs count as complete but unconfirmed, and the rendered text asks the developer to add any that are missing. Empty ( []): the developer confirmed there are no other costs. One or more items: the costs are incomplete, so costs.status in the response is INCOMPLETE and the confidence is LOW, and the rendered text names each item. With source NONE the items are only shown.
(string) --
Name of a cost the developer could not price, for example "email provider".
fixedMonthlyCost (float) --
Fixed monthly cost to run the app in USD, including non-AWS fixed costs. Defaults to 0. It raises break-even (fixed cost per payer, with market.expectedUsers), so it can change the verdict and the price.
margins (list) --
Margins the developer named, each in [0, 1). costs.coverPrices in the response shows the price that covers cost to serve at each margin above 0. The lowest margin also sets the lowest overage and credit-pack price per unit; order does not matter. With no value basis and no experiential estimate (see valueKind) the price is cost to serve at the lowest margin; omitted means a default margin of 0, labelled as a default, which prices at cost, the same as [0]. Omitted, or only 0: costs.coverPrices in the response is empty.
(float) --
A target margin, as a fraction in [0, 1).
dict
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.
comparablesOptIn (string) --
The developer's explicit answer to whether comparable apps' public prices may be used. Required when comparables is sent. Absent otherwise: OPTED_OUT. Never inferred as OPTED_IN.
comparables (list) --
Comparable apps, each read from its public pricing page, used only when comparablesOptIn is OPTED_IN. Each usable one becomes an alternative customers weigh against the app. At most 5 are used, best quality first; the rest, and any that cannot be used, are returned in alternatives.comparablesDropped with the reason. With OPTED_OUT they are still validated, but not used and not listed there. Absent: no comparables.
(dict) --
A comparable app, read from its public pricing page. Give quality or features: one of them is required.
name (string) --
Short name of the comparable app. Absent: the host of url, lowercased, without a leading www.; when two comparables get the same name, the later ones get (2), (3).
url (string) -- [REQUIRED]
The public pricing page the price was read from.
mechanism (string) -- [REQUIRED]
How the comparable charges.
price (dict) -- [REQUIRED]
Its price: per month for PAID_SUB, per use for PER_REQUEST, 0 for FREE_CAPPED and FREEMIUM, the one-time price for ONE_TIME. USD only: another currencyCode is rejected.
currencyCode (string) -- [REQUIRED]
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) -- [REQUIRED]
An arbitrary-precision decimal represented as a string (for example, "9.99").
cap (float) --
Monthly usage cap of the free tier, for FREE_CAPPED and FREEMIUM. A free tier without a cap is not used.
includedUnits (float) --
For PAID_SUB: units of this app's billable action the plan includes per month. With overageRate, a customer pays the plan price plus overage at their own usage; without it, the plan stops at this allowance. Absent: the plan price covers any usage.
overageRate (float) --
For PAID_SUB with includedUnits: price per unit past the allowance, in USD. Absent: the plan stops at includedUnits (no overage).
quality (float) --
How good it is compared with this app, where this app is 1.
features (dict) --
Its scores on the characteristics in features, instead of quality. Required when quality is absent.
(string) --
Name of a characteristic customers decide on, for example privacy or speed.
(float) --
A score from 0 to 1 for a characteristic, measured against the best in class.
outsideOptions (list) --
What customers do today without any product, such as doing the task by hand. Each one is an alternative customers weigh against the app, at its monthlyCost. These are not products, so they need no comparablesOptIn. Absent: none.
(dict) --
Something customers do today without any product, such as doing the task by hand. Give quality or features: one of them is required.
name (string) -- [REQUIRED]
Short name, for example write it by hand.
monthlyCost (float) -- [REQUIRED]
What it costs a typical customer per month, in USD, for example the hours they spend on it times what an hour of their time is worth. Give the full cost: when an action's value is above 0, it is weighed at the value share (see valueShare), the same as the hours it stands for.
quality (float) --
How good it is compared with this app, where this app is 1.
features (dict) --
Its scores on the characteristics in features, instead of quality.
(string) --
Name of a characteristic customers decide on, for example privacy or speed.
(float) --
A score from 0 to 1 for a characteristic, measured against the best in class.
dict
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).
expectedUsers (integer) --
Market size: the number of potential customers, meaning people who have the problem the app solves and would consider paying for a tool to solve it. Paying users are this number times the modeled paying share. Do not count installs, sign-ups or people who would only try the app. It changes paying users, cost to serve and the verdict, and the price only when fixed cost per paying user decides it. Defaults to the service's pre-launch benchmark.
measuredConversion (dict) --
For a deployed app: how many of its users pay today. It takes effect when at least 30 users pay; with fewer, it is ignored with no error and the segment's benchmark conversion is used. payingUsers must not exceed users. Used only without a value estimate (no action has minutesSaved, moneySaved or valuePerUse, and there is no experiential estimate, see valueKind): then paying users are the market size ( expectedUsers, or its benchmark) times payingUsers / users instead of times the segment's benchmark conversion, which sets the fixed and Free-plan cost per paying user behind the cost-based price, the Free plan's quota (or a trial instead), and the what-if results in planOptions.evaluatedPlanPrices. With a value estimate the modeled demand sets the paying share, and the measured conversion is shown in the rendered text but not used. Absent: the segment's benchmark conversion.
payingUsers (integer) -- [REQUIRED]
Users who pay. At most users.
users (integer) -- [REQUIRED]
Users of the app.
customerTypes (list) --
The types of customer who use the app, from one to three, each with its share of users and how its usage and value per use differ from an ordinary user. Absent: one ordinary type.
(dict) --
One type of customer. Usage and value per use are relative to an ordinary user of the app, and independent of each other: a heavy user can be worth less per use.
name (string) -- [REQUIRED]
Short name of the customer type, for example solo devs.
share (float) -- [REQUIRED]
Share of users of this type. Shares are relative: they are scaled to sum to 100.
usageMultiplier (float) -- [REQUIRED]
Uses per month as a multiple of each action's typicalMonthlyUsage (2 = twice as many).
valuePerUseMultiplier (float) -- [REQUIRED]
Value of one use as a multiple of an ordinary user's (0.5 = half, 2 = twice).
usageSpread (string) --
How similar customers of this type are in how much they use the app. Absent: the segment's default.
featureWeights (dict) --
How much each characteristic in features matters to this type, when it differs from the shared features.weights. Absent: features.weights (equal weights when that is absent too). Used only when a comparable or an outside option in alternatives is scored by features; sent otherwise, it is rejected.
(string) --
Name of a characteristic customers decide on, for example privacy or speed.
(float) --
The relative weight of a characteristic in the customer decision.
checkoutDropOff (dict) --
The developer's own checkout drop-off rates, one per pricing model, in place of the service's benchmarks. A member that is absent keeps its benchmark; {} keeps all four. Used only with a value estimate; without one the price does not depend on them. Absent: every benchmark.
freePlan (float) --
Share of buyers who start signing up for a Free plan but don't finish. In [0, 1); 1 is rejected. Absent: the service's benchmark for that pricing model.
flat (float) --
Share of buyers who start a checkout for a flat plan but don't finish. In [0, 1); 1 is rejected. Absent: the service's benchmark for that pricing model.
perUse (float) --
Share of buyers who start a checkout for per-use pricing but don't finish. In [0, 1); 1 is rejected. Absent: the service's benchmark for that pricing model.
tiered (float) --
Share of buyers who start a checkout for a tiered plan but don't finish. In [0, 1); 1 is rejected. Absent: the service's benchmark for that pricing model.
dict
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.
pricingModelPreference (string) --
Pricing model to use instead of letting the service choose. planOptions.preferenceOutcome in the response says whether it was used. Absent: the service chooses ( preferenceOutcome NOT_REQUESTED). PER_USE_SPLIT needs two or more actions. PER_USE or PER_USE_SPLIT with freeTierInclusion, maxTierInclusion or annualPlanInclusion INCLUDE is rejected, and so is FLAT with freeTierInclusion INCLUDE.
freeTierInclusion (string) --
Whether to include a Free plan. Absent: the segment's default, which considers a Free plan for CONSUMER and PROSUMER and not for ENTERPRISE; with a pricingModelPreference, a Free plan is considered only for TIERED. INCLUDE with no pricingModelPreference limits the choice to TIERED; INCLUDE with a PER_USE, PER_USE_SPLIT or FLAT preference is rejected. The response's planOptions.freeTier gives the outcome.
maxTierInclusion (string) --
Whether to include a Max plan for heavy users. On the default menu for CONSUMER and PROSUMER; for ENTERPRISE only when this is INCLUDE. Only with a value estimate: when no action has a value basis ( minutesSaved, moneySaved or valuePerUse) and there is no experiential estimate (see valueKind), the price is cost-based and this is ignored, with no error: the response has no Max plan and no planOptions.maxTier outcome. A Max plan goes with a TIERED or FLAT model, never PER_USE or PER_USE_SPLIT: INCLUDE with a PER_USE or PER_USE_SPLIT preference is rejected, and a per-use model the service chooses has no Max plan. Absent, for CONSUMER and PROSUMER: a TIERED recommendation includes it unless it would clearly lower the modeled profit or almost no paying customer would move up to it; a FLAT one includes it only when it improves the recommendation. Absent, for ENTERPRISE: no Max plan. A TIERED Max is unlimited ( includedQuantity 1,000,000,000 with NO_OVERAGE_THROTTLE) unless its buyers' usage would cost too much of the Max price; then it has an allowance and overage. A FLAT Max always has an allowance.
annualPlanInclusion (string) --
Whether to add an annual plan ( Annual). Absent: it is added when a subscription (FLAT or TIERED) is recommended, without changing the pricing model, unless every action is used less than once a month on average ( typicalMonthlyUsage below 1). INCLUDE adds it at any usage and, when the request sends no pricingModelPreference, also limits the choice to subscriptions; INCLUDE with a PER_USE or PER_USE_SPLIT preference is rejected. EXCLUDE leaves it out.
creditPackInclusion (string) --
Whether to add one-time credit packs alongside the plans, the response's creditPacks. Absent: EXCLUDE. INCLUDE is allowed with every pricing model, per-use included.
planPrices (list) --
Prices to evaluate instead of the recommended ones, one per plan. Each is evaluated against the same modeled demand and returned in planOptions.evaluatedPlanPrices, with the recommended plans and credit packs rebuilt at that price; the recommendation itself does not change. A pro price is evaluated with the Max plan as recommended; when that Max would sit too close to the pro price, Max is re-priced or left out, as the recommendation does when it moves Pro, and the rendered text says which. A max price in the same request does not change this, so a pro item is the same as for that pro price alone. A max price must be above Pro's price, and is evaluated with this request's pro price if it has one. Absent: none, and planOptions.evaluatedPlanPrices is empty.
(dict) --
A price to evaluate for one recommended plan, or for one action's rate on the pay-as-you-go plan.
planCode (string) -- [REQUIRED]
Plan code as returned in plans, for example pro. Each plan code appears once.
actionName (string) --
With pay_as_you_go only: the action this rate is for, one of actions[].name; the other actions keep their recommended rates. Absent on pay_as_you_go: one rate for every charged action, accepted only when pricingModel is PER_USE.
price (dict) -- [REQUIRED]
Price per billing cycle, or per use for pay_as_you_go (at least 0.01). A whole number of cents. USD only: another currencyCode is rejected.
currencyCode (string) -- [REQUIRED]
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) -- [REQUIRED]
An arbitrary-precision decimal represented as a string (for example, "9.99").
publishedPrice (dict) --
Your current or intended monthly price, in USD (another currencyCode is rejected). Shown for comparison, except when no action has a value basis and no comparables are used: then it is the recommended price, raised to cost to serve at the lowest margin in costs.margins (0, which is cost, when margins are omitted) when it is below that. Absent: no price is shown for comparison, and the price comes from the value estimate, comparables or cost.
currencyCode (string) -- [REQUIRED]
The currency of the price. USD only: another currencyCode is rejected.
amount (string) -- [REQUIRED]
The price amount.
dict
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.
nonAwsCostsNote (string) --
The developer's note on non-AWS costs. Absent: the rendered text says none were found (and names any costs.unknown items).
valueBasis (string) --
How the value figures ( minutesSaved, moneySaved or valuePerUse, and valueShare) were worked out, for example "drafting a reply by hand takes about 10 minutes". Shown on the Value row of summary, and with the value inputs in details. Absent: not shown.
expectedUsersBasis (string) --
Where market.expectedUsers came from. Absent: the rendered text labels it a rough guess from the app's category.
usageSources (dict) --
Whether each action's typicalMonthlyUsage is an estimate or was measured on a deployed app (the last 30 days' average per active user), by action name. Absent for an action: ESTIMATE.
(string) --
A name in actions: letters, digits, underscores or hyphens, 1-64 characters.
(string) --
Where an action's typical usage came from.
customerTypeDescriptions (dict) --
One line on who each customer type is, by market.customerTypes name. Absent for a type: only its name is shown.
(string) --
Short name of a customer type, for example "solo devs".
(string) --
A free-text note on an input assumption.
dict
Response Syntax
{
'pricingModel': 'FLAT'|'TIERED'|'PER_USE'|'PER_USE_SPLIT',
'recommendedPrice': {
'currencyCode': 'string',
'amount': 'string'
},
'recommendedPriceRange': {
'low': {
'currencyCode': 'string',
'amount': 'string'
},
'high': {
'currencyCode': 'string',
'amount': 'string'
}
},
'unitPrices': [
{
'actionName': 'string',
'price': {
'currencyCode': 'string',
'amount': 'string'
}
},
],
'plans': [
{
'planCode': 'string',
'name': 'string',
'billingCycle': 'MONTHLY'|'ANNUAL'|'ONE_TIME',
'price': {
'currencyCode': 'string',
'amount': 'string'
},
'includedQuotas': [
{
'actionName': 'string',
'includedQuantity': 123,
'overagePolicy': 'NO_OVERAGE_THROTTLE'|'APPLY_FIXED_OVERAGE'|'APPLY_TIERED_OVERAGE',
'overagePrice': {
'currencyCode': 'string',
'amount': 'string'
}
},
],
'upgradePlanCodes': [
'string',
],
'downgradePlanCodes': [
'string',
]
},
],
'creditPacks': [
{
'name': 'string',
'actionName': 'string',
'quantity': 123,
'price': {
'currencyCode': 'string',
'amount': 'string'
}
},
],
'verdict': 'HEALTHY'|'THIN_MARGIN'|'NOT_MONETIZABLE'|'COST_ONLY'|'COST_NOT_CHECKED',
'confidence': 'HIGH'|'MEDIUM'|'LOW',
'confidenceReason': 'string',
'basis': 'string',
'costs': {
'status': 'COMPLETE'|'INCOMPLETE'|'NOT_CHECKED',
'coverStatus': 'MODELED'|'COVERED'|'ARITHMETIC'|'NOT_CHECKED',
'coverPrices': [
{
'margin': 123.0,
'price': {
'currencyCode': 'string',
'amount': 'string'
}
},
],
'breakEven': {
'expected': {
'costPerPayer': {
'currencyCode': 'string',
'amount': 'string'
},
'payers': 123.0
},
'low': {
'costPerPayer': {
'currencyCode': 'string',
'amount': 'string'
},
'payers': 123.0
},
'high': {
'costPerPayer': {
'currencyCode': 'string',
'amount': 'string'
},
'payers': 123.0
}
},
'impliedMargin': 123.0
},
'alternatives': {
'comparablesUsed': [
'string',
],
'comparablesDropped': [
{
'name': 'string',
'price': {
'currencyCode': 'string',
'amount': 'string'
},
'reason': 'string'
},
]
},
'planOptions': {
'preferenceOutcome': 'HONORED'|'NOT_HONORED'|'NOT_REQUESTED',
'freeTier': {
'status': 'INCLUDED'|'TRIAL_SUGGESTED'|'NOT_INCLUDED',
'statusSource': 'REQUESTED'|'SEGMENT_DEFAULT',
'trialDays': 123,
'freeUsers': 123.0,
'conversion': 123.0,
'monthlyCost': {
'currencyCode': 'string',
'amount': 'string'
}
},
'maxTier': {
'status': 'INCLUDED'|'INCLUDED_AS_REQUESTED'|'NOT_INCLUDED',
'price': {
'currencyCode': 'string',
'amount': 'string'
}
},
'evaluatedPlanPrices': [
{
'planCode': 'string',
'price': {
'currencyCode': 'string',
'amount': 'string'
},
'monthlyProfit': 'string',
'paidShare': 123.0,
'verdict': 'HEALTHY'|'THIN_MARGIN'|'NOT_MONETIZABLE'|'COST_ONLY'|'COST_NOT_CHECKED',
'plans': [
{
'planCode': 'string',
'name': 'string',
'billingCycle': 'MONTHLY'|'ANNUAL'|'ONE_TIME',
'price': {
'currencyCode': 'string',
'amount': 'string'
},
'includedQuotas': [
{
'actionName': 'string',
'includedQuantity': 123,
'overagePolicy': 'NO_OVERAGE_THROTTLE'|'APPLY_FIXED_OVERAGE'|'APPLY_TIERED_OVERAGE',
'overagePrice': {
'currencyCode': 'string',
'amount': 'string'
}
},
],
'upgradePlanCodes': [
'string',
],
'downgradePlanCodes': [
'string',
]
},
],
'creditPacks': [
{
'name': 'string',
'actionName': 'string',
'quantity': 123,
'price': {
'currencyCode': 'string',
'amount': 'string'
}
},
]
},
]
},
'analysis': {
'modelComparison': [
{
'pricingModel': 'FLAT'|'TIERED'|'PER_USE'|'PER_USE_SPLIT',
'monthlyProfit': 'string',
'monthlyRevenue': {
'currencyCode': 'string',
'amount': 'string'
},
'margin': 123.0,
'paidShare': 123.0
},
],
'pricingModelCaveats': [
'CLOSE_CALL'|'CHECKOUT_DROP_OFF',
],
'frictionAlternative': 'FLAT'|'TIERED'|'PER_USE'|'PER_USE_SPLIT'
},
'recommendationVersion': 'string',
'summary': 'string',
'details': 'string'
}
Response Structure
(dict) --
Output for GetPlanRecommendation. The recommendation is at the top level; costs, alternatives, planOptions and analysis hold what backs it. summary and details are always returned.
pricingModel (string) --
The recommended pricing model. Equals the request's planOptions.pricingModelPreference when planOptions.preferenceOutcome is HONORED.
recommendedPrice (dict) --
Recommended monthly price of the main paid plan, for FLAT and TIERED. When an annual plan is recommended, it is in plans with billingCycle ANNUAL; this is still the monthly price.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
recommendedPriceRange (dict) --
Prices whose modeled profit is within a few percent of the best, when the profit curve is flat near its top. recommendedPrice is the middle of this range.
low (dict) --
The lowest price in the range.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
high (dict) --
The highest price in the range.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
unitPrices (list) --
Price per use of each action, for PER_USE and PER_USE_SPLIT.
(dict) --
Price per use of one action.
actionName (string) --
An action's key within the recommendation, used in plans, unitPrices and creditPacks: a name in the request's actions. The developer maps it to the app's metric.
price (dict) --
The price per use.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
plans (list) --
The recommended plans. To create them, map each actionName to the app's metric ID.
(dict) --
One recommended plan.
planCode (string) --
This plan's key within the recommendation, for example pro. The request's planOptions.planPrices, and this plan's upgradePlanCodes and downgradePlanCodes, refer to plans by it. It is not a PlanId: CreatePlan assigns the PlanId when the plan is created.
name (string) --
Plan name shown to buyers, for example Pro or Annual.
billingCycle (string) --
How often the plan bills, as in CreatePlan's definition.billingCycle.
price (dict) --
Subscription price per billing cycle.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
includedQuotas (list) --
Units included per action, with what happens past them.
(dict) --
Included units of one action in a plan.
actionName (string) --
An action's key within the recommendation, used in plans, unitPrices and creditPacks: a name in the request's actions. The developer maps it to the app's metric.
includedQuantity (integer) --
The number of units included.
overagePolicy (string) --
What happens to usage past the included units.
overagePrice (dict) --
Price per unit past the included quantity. With APPLY_FIXED_OVERAGE only. Overage is not capped.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
upgradePlanCodes (list) --
Plan codes a subscriber can upgrade to, cheapest first.
(string) --
A plan's key within one recommendation, for example pro or team. URL-safe: letters, digits, hyphen, underscore; 1-64 characters.
downgradePlanCodes (list) --
Plan codes a subscriber can downgrade to, cheapest first.
(string) --
A plan's key within one recommendation, for example pro or team. URL-safe: letters, digits, hyphen, underscore; 1-64 characters.
creditPacks (list) --
One-time credit packs sold alongside the plans. Empty unless the request's planOptions.creditPackInclusion was INCLUDE.
(dict) --
A one-time pack of units of one action.
name (string) --
Pack name shown to buyers.
actionName (string) --
An action's key within the recommendation, used in plans, unitPrices and creditPacks: a name in the request's actions. The developer maps it to the app's metric.
quantity (integer) --
Units in the pack.
price (dict) --
The pack price.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
verdict (string) --
Viability verdict.
confidence (string) --
Confidence in the recommendation.
confidenceReason (string) --
Why the confidence is what it is.
basis (string) --
What the price is based on: modeled demand, or, without a value estimate, cost or comparables.
costs (dict) --
How the recommended price relates to cost to serve.
status (string) --
Whether the costs behind verdict and costs.breakEven are complete.
coverStatus (string) --
Whether the recommended price covers cost to serve as modeled, was raised to cover it, or could not cover it at any price.
coverPrices (list) --
The price that covers cost to serve at each margin above 0 in the request's costs.margins. Reference only.
(dict) --
The price that covers cost to serve at one margin.
margin (float) --
The target margin this price covers.
price (dict) --
Up to 4 decimal places.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
breakEven (dict) --
Cost to serve one payer at the expected number of payers, at one tenth and at ten times.
expected (dict) --
Cost to serve one payer at the expected number of payers.
costPerPayer (dict) --
Monthly cost to serve one payer, including the payer's share of fixed cost and free users. Up to 4 decimal places.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
payers (float) --
Modeled number of payers, as a whole number.
low (dict) --
Cost to serve one payer at one tenth the expected number of payers.
costPerPayer (dict) --
Monthly cost to serve one payer, including the payer's share of fixed cost and free users. Up to 4 decimal places.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
payers (float) --
Modeled number of payers, as a whole number.
high (dict) --
Cost to serve one payer at ten times the expected number of payers.
costPerPayer (dict) --
Monthly cost to serve one payer, including the payer's share of fixed cost and free users. Up to 4 decimal places.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
payers (float) --
Modeled number of payers, as a whole number.
impliedMargin (float) --
Share of revenue left after cost to serve at the recommended price and expected scale, to 2 decimal places.
alternatives (dict) --
Which comparable apps were used and which were not.
comparablesUsed (list) --
Names of the comparable apps whose prices were used.
(string) --
Short name of a comparable app or outside option.
comparablesDropped (list) --
Comparable apps that were not used, with the reason.
(dict) --
A comparable app that was not used.
name (string) --
Name of the comparable app.
price (dict) --
The comparable app's price.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
reason (string) --
Why the comparable app was not used.
planOptions (dict) --
What became of the request's planOptions: the pricing-model preference, the Free and Max plans and the evaluated plan prices.
preferenceOutcome (string) --
Whether the request's planOptions.pricingModelPreference was used.
freeTier (dict) --
The Free plan's modeled outcome, or the free trial suggested instead of it.
status (string) --
Whether a Free plan is included, or what is suggested instead.
statusSource (string) --
Whether status follows the request's planOptions.freeTierInclusion or the segment's default.
trialDays (integer) --
Length of the suggested free trial. TRIAL_SUGGESTED only.
freeUsers (float) --
Modeled number of free users, as a whole number. INCLUDED, or NOT_INCLUDED with what a Free plan would cost.
conversion (float) --
Modeled share of free users who convert to the paid plan. Not returned.
monthlyCost (dict) --
Monthly cost of serving the free users: for INCLUDED, the Free plan's cost; for TRIAL_SUGGESTED and NOT_INCLUDED, what a Free plan at the default quota would cost. Up to 4 decimal places.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
maxTier (dict) --
The Max plan's modeled outcome. On the default menu for CONSUMER and PROSUMER; for ENTERPRISE only when the request's planOptions.maxTierInclusion is INCLUDE.
status (string) --
Whether a Max plan is included, and why.
price (dict) --
The Max plan's price.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
evaluatedPlanPrices (list) --
Modeled outcome of each price in the request's planOptions.planPrices.
(dict) --
Modeled monthly outcome of one price in the request's planOptions.planPrices.
planCode (string) --
The plan code this price was evaluated for.
price (dict) --
The price evaluated: for pay_as_you_go with an actionName in the request, that action's rate.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
monthlyProfit (string) --
Modeled monthly profit at this price, which can be negative.
paidShare (float) --
Modeled share of potential customers who pay, to 2 decimal places.
verdict (string) --
Viability verdict at this price.
plans (list) --
The recommended plans rebuilt at this price by the same rules, in the same form as the response's plans: a pro price sets Pro's overage rates and the annual plan, and a pay_as_you_go rate sets that action's rate. At the recommended price, equal to plans.
(dict) --
One recommended plan.
planCode (string) --
This plan's key within the recommendation, for example pro. The request's planOptions.planPrices, and this plan's upgradePlanCodes and downgradePlanCodes, refer to plans by it. It is not a PlanId: CreatePlan assigns the PlanId when the plan is created.
name (string) --
Plan name shown to buyers, for example Pro or Annual.
billingCycle (string) --
How often the plan bills, as in CreatePlan's definition.billingCycle.
price (dict) --
Subscription price per billing cycle.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
includedQuotas (list) --
Units included per action, with what happens past them.
(dict) --
Included units of one action in a plan.
actionName (string) --
An action's key within the recommendation, used in plans, unitPrices and creditPacks: a name in the request's actions. The developer maps it to the app's metric.
includedQuantity (integer) --
The number of units included.
overagePolicy (string) --
What happens to usage past the included units.
overagePrice (dict) --
Price per unit past the included quantity. With APPLY_FIXED_OVERAGE only. Overage is not capped.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
upgradePlanCodes (list) --
Plan codes a subscriber can upgrade to, cheapest first.
(string) --
A plan's key within one recommendation, for example pro or team. URL-safe: letters, digits, hyphen, underscore; 1-64 characters.
downgradePlanCodes (list) --
Plan codes a subscriber can downgrade to, cheapest first.
(string) --
A plan's key within one recommendation, for example pro or team. URL-safe: letters, digits, hyphen, underscore; 1-64 characters.
creditPacks (list) --
The credit packs at this price, in the same form as the response's creditPacks. At the recommended price, equal to creditPacks.
(dict) --
A one-time pack of units of one action.
name (string) --
Pack name shown to buyers.
actionName (string) --
An action's key within the recommendation, used in plans, unitPrices and creditPacks: a name in the request's actions. The developer maps it to the app's metric.
quantity (integer) --
Units in the pack.
price (dict) --
The pack price.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
analysis (dict) --
How the recommendation compares with other pricing models.
modelComparison (list) --
Modeled outcome of each pricing model compared, under the same modeled demand.
(dict) --
Modeled monthly outcome of one pricing model.
pricingModel (string) --
The pricing model. With a value estimate a per-use model is listed as PER_USE, also when pricingModel is PER_USE_SPLIT; without one the only row is pricingModel.
monthlyProfit (string) --
Modeled monthly profit, which can be negative.
monthlyRevenue (dict) --
Modeled monthly revenue.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
margin (float) --
Profit as a share of revenue, to 2 decimal places. Absent when revenue is zero.
paidShare (float) --
Modeled share of potential customers who pay, to 2 decimal places.
pricingModelCaveats (list) --
Caveats on the comparison of pricing models by modeled profit. Empty when none applies or none was checked (see PricingModelCaveat).
(string) --
A caveat on the comparison of pricing models by modeled profit, which is made only with a value estimate. The comparison picks the most profitable pricing model it may choose, or the simplest of those close to it. It may choose only FLAT or TIERED when planOptions.annualPlanInclusion is INCLUDE and the request sends neither planOptions.pricingModelPreference nor planOptions.freeTierInclusion INCLUDE. pricingModel need not be its pick, for example when the request sends one of those two.
frictionAlternative (string) --
The pricing model the comparison would pick if every pricing model lost the same share of buyers at checkout. Present when pricingModelCaveats has CHECKOUT_DROP_OFF.
recommendationVersion (string) --
Identifies the recommendation model and benchmark data behind this answer, for support. It changes when either changes.
summary (string) --
The recommendation as text for the developer: the price, the plans, the reasons and the assumptions behind them.
details (string) --
The same text as summary with a Details section on how the recommendation was worked out, for a developer who asks for details. Some figures appear only in summary and details.
Creates a checkout session for a one-time purchase of usage packs or add-ons against the user's current subscription, or against the app when the user has no subscription. A one-time purchase always requires payment, so the response returns a checkout URL and a checkout session identifier. To subscribe a user to a plan or change the user's plan, use CreateSubscriptionCheckoutSession.
See also: AWS API Documentation
Request Syntax
client.create_one_time_checkout_session(
appId='string',
userId='string',
items=[
{
'oneTimePriceId': 'string',
'quantity': 123
},
],
returnUrl='string',
clientToken='string',
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app the purchase is for.
string
[REQUIRED]
The ID of the end user making the purchase. Do not include personally identifiable or otherwise sensitive data in this value.
list
[REQUIRED]
The purchasables to buy. Each line is a usage pack or add-on and the number of units to buy.
(dict) --
A single line in a one-time purchase cart: the one-time price to buy and how many units.
oneTimePriceId (string) -- [REQUIRED]
The id of the one-time price to buy.
quantity (integer) --
The number of units of the one-time price to buy.
string
[REQUIRED]
The URL the buyer's browser is sent to after they complete payment at checkout (the checkout page's success-redirect target). A one-time purchase always requires payment, so there is no cancel-redirect field on this operation.
string
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.
This field is autopopulated if not provided.
string
[REQUIRED]
Required. The environment: live or sandbox.
dict
Response Syntax
{
'checkoutUrl': 'string',
'expiresAt': datetime(2015, 1, 1),
'checkoutSessionId': 'string'
}
Response Structure
(dict) --
Output for CreateOneTimeCheckoutSession. A one-time purchase always requires payment, so the response always carries a checkout URL.
checkoutUrl (string) --
An absolute HTTP or HTTPS URL the buyer's browser is redirected to in order to complete payment.
expiresAt (datetime) --
The time when the checkout session expires.
checkoutSessionId (string) --
The ID of the created checkout session.
Updates an existing app. This operation is idempotent.
See also: AWS API Documentation
Request Syntax
client.update_app(
appId='string',
name='string',
description='string',
identifier='string',
scope='sandbox'|'live',
costTracking={
'roleArn': 'string'
}
)
string
[REQUIRED]
The ID of the app to update. You can identify the app by either its ID or its Amazon Resource Name (ARN). If you provide both, they must refer to the same app.
string
A human-readable display name for the app.
string
The new description. An empty string clears it; omitting the member keeps the current one.
string
The Amazon Resource Name (ARN) of the app. You can identify the app by either its ID or its ARN. If you provide both, they must refer to the same app. A sandbox ARN names the app's sandbox; if you also send scope, the two must name the same environment.
string
The environment to act on: live or sandbox. Optional. You can name the environment with this member, with a sandbox resource ARN, or both; if you send both they must name the same environment, or the request is rejected.
dict
Optional cost-tracking configuration: the IAM role AWS App Monetization uses to track this app's AWS costs. Passing a role also requires permission for iam:PassRole on it. You can send it with or without a new name or description.
roleArn (string) -- [REQUIRED]
The ARN of an IAM role that AWS App Monetization assumes in your account to create and manage the AWS Data Exports export for this app. The role must be in your account and partition, and its name (after any path) must start with AppMonetizationCostTracking. You need iam:PassRole on it. Its trust policy must allow appmonetization.amazonaws.com to assume it, with conditions that pin aws:SourceAccount to your account ID and aws:SourceArn to your account's apps (arn:aws:appmonetization:::apps/*). The setup runs in the background after the call returns, and cost data starts arriving within 24-48 hours. Calling UpdateApp with a role again re-runs the setup. A CreateApp retry with the same clientToken must carry the same role: a different role, or a role added or dropped, fails with IdempotencyConflictException.
dict
Response Syntax
{
'app': {
'appId': 'string',
'name': 'string',
'description': 'string',
'status': 'ACTIVE'|'DELETED',
'createdAt': datetime(2015, 1, 1),
'arn': 'string'
}
}
Response Structure
(dict) --
Output for UpdateApp.
app (dict) --
The updated app.
appId (string) --
The service-assigned identifier for the app.
name (string) --
A human-readable display name for the app.
description (string) --
A longer description of what the app does.
status (string) --
The lifecycle status of the app.
createdAt (datetime) --
The time the app was created.
arn (string) --
The resource ARN of this app.
Deletes an app. If the app's published offering still has plans or metrics, the request fails with a ConflictException. Deleting an app that no longer exists returns a ResourceNotFoundException.
See also: AWS API Documentation
Request Syntax
client.delete_app(
appId='string',
identifier='string',
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app to delete. You can identify the app by either its ID or its Amazon Resource Name (ARN). If you provide both, they must refer to the same app.
string
The Amazon Resource Name (ARN) of the app. You can identify the app by either its ID or its ARN. If you provide both, they must refer to the same app. A sandbox ARN names the app's sandbox; if you also send scope, the two must name the same environment.
string
The environment to act on: live or sandbox. Optional. You can name the environment with this member, with a sandbox resource ARN, or both; if you send both they must name the same environment, or the request is rejected.
dict
Response Syntax
{
'appId': 'string',
'status': 'ACTIVE'|'DELETED',
'arn': 'string'
}
Response Structure
(dict) --
Output for DeleteApp.
appId (string) --
The ID of the deleted app.
status (string) --
The resource status after deletion.
arn (string) --
The resource ARN of the deleted app.
Returns the metrics for an app. Returns a paginated list; we recommend using pagination to ensure that the operation returns quickly and successfully.
See also: AWS API Documentation
Request Syntax
client.list_metrics(
appId='string',
stage='DRAFT'|'PUBLISHED',
maxResults=123,
nextToken='string',
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app.
string
The offering stage to list metrics from: DRAFT (the latest authored draft) or PUBLISHED (the published offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox. A stage with nothing published lists as empty.
integer
The maximum number of items to return in a single page. Valid range is 1 to 100.
string
An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.
string
[REQUIRED]
Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft (what the sandbox runs).
dict
Response Syntax
{
'metrics': [
{
'appId': 'string',
'metricId': 'string',
'name': 'string',
'description': 'string',
'eventType': 'string',
'unitName': 'string',
'definition': {
'filters': [
{
'field': 'string',
'operator': 'EQUALS'|'NOT_EQUALS'|'IN'|'NOT_IN',
'values': [
'string',
]
},
],
'function': 'SUM'|'COUNT'|'MAX',
'functionField': 'string',
'groupBy': [
'string',
],
'period': 'MONTHLY'
},
'arn': 'string',
'stage': 'DRAFT'|'PUBLISHED'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
Output for ListMetrics.
metrics (list) --
A list of metrics.
(dict) --
A usage metric definition for an app. Metrics aggregate raw usage events (by event type) into a metered quantity used for quota enforcement and usage-based billing.
appId (string) --
The ID of the app the metric belongs to.
metricId (string) --
The ID of the metric. We assign this value when you create the metric; it is unique within the app. Treat it as opaque.
name (string) --
A human-readable display name for the metric.
description (string) --
A description of what the metric measures.
eventType (string) --
The event type this metric aggregates.
unitName (string) --
The unit of measure for the metric.
definition (dict) --
The aggregation definition: filters, aggregation function, grouping, and period.
filters (list) --
The predicates selecting which events contribute to the metric. Combined with logical AND.
(dict) --
A single predicate that selects which events contribute to a metric.
field (string) --
The event property key the filter is evaluated against.
operator (string) --
The comparison operator (EQUALS, NOT_EQUALS, IN, or NOT_IN).
values (list) --
The values the field is compared against.
(string) --
A value the field is compared against, 1-256 characters. Single quotes (') and backslashes () are not allowed.
function (string) --
The aggregation function applied to matching events (SUM, COUNT, or MAX).
functionField (string) --
The event property key the aggregation function operates on. Required for SUM and MAX; ignored for COUNT.
groupBy (list) --
The event fields to group aggregated results by.
(string) --
Name of an event property key referenced by a metric filter or aggregation (filter field, functionField, groupBy). Lowercase snake_case, 1-64 characters: letters, digits, and underscores only, starting with a letter. Unlike PropertyKey, dots are not allowed, so a metric can't reference a property whose key contains a dot.
period (string) --
The reset or rollup period for the aggregation.
arn (string) --
The Amazon Resource Name (ARN) of the metric. Output only.
stage (string) --
The offering stage this metric was read from: DRAFT or PUBLISHED. Present on metric reads; absent on write responses.
nextToken (string) --
An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.
Opens the AWS App Monetization hosted customer billing portal for a user. This operation returns the billing portal URL that your application redirects the user's browser to. No state is persisted.
See also: AWS API Documentation
Request Syntax
client.create_billing_portal_session(
appId='string',
userId='string',
returnUrl='string',
refreshUrl='string',
sessionDurationSeconds=123,
clientToken='string',
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app the portal is for.
string
[REQUIRED]
The ID of the end user the portal is for. Do not include personally identifiable or otherwise sensitive data in this value.
string
[REQUIRED]
A URL in your app. A plan checkout started from the portal doesn't redirect here: after payment, the buyer returns to the portal's My subscription page. Bound into the session and reused for every checkout the buyer launches from the portal.
string
[REQUIRED]
A URL in your app. A plan checkout started from the portal doesn't redirect here: if the buyer cancels, they return to the portal's plans page. Bound into the session alongside returnUrl.
integer
The lifetime of the hosted session, in seconds, counted from this call. Omit to use the service default. It does not set how long billingPortalUrl works; see expiresAt.
string
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.
This field is autopopulated if not provided.
string
[REQUIRED]
Required. The environment: live or sandbox.
dict
Response Syntax
{
'billingPortalUrl': 'string',
'sessionToken': 'string',
'expiresAt': datetime(2015, 1, 1),
'manageToken': 'string'
}
Response Structure
(dict) --
Output for CreateBillingPortalSession.
billingPortalUrl (string) --
The URL of the billing portal page to redirect the end user's browser to. The URL carries a short-lived session token or a single-use link in its fragment. The link works once, until expiresAt or the end of the session if sooner.
sessionToken (string) --
The billing portal session token carried in the fragment of billingPortalUrl. Absent when billingPortalUrl carries a single-use link instead.
expiresAt (datetime) --
The time when the single-use link in billingPortalUrl expires, 10 minutes after it was created. After this time the URL no longer works and you must create a new session.
manageToken (string) --
A short-lived token that authorizes updates to the buyer profile from the billing portal. Returned only with sessionToken.
Creates a hosted URL that an app owner uses to register payment and tax details.
See also: AWS API Documentation
Request Syntax
client.create_app_payment_registration(
appId='string',
legalName='string',
developerAddress={
'street1': 'string',
'street2': 'string',
'city': 'string',
'state': 'string',
'postalCode': 'string',
'country': 'string'
},
taxRegistrationNumber='string',
businessType='INDIVIDUAL'|'REGISTERED_BUSINESS',
email='string',
supportEmail='string',
displayName='string',
supportPhone='string',
invoiceLogo=b'bytes',
taxRegistrations=[
{
'countryCode': 'string',
'state': 'string',
'collectionType': 'string',
'registrationType': 'SALES_USE'|'RETAIL_DELIVERY_FEE'|'VAT'|'VAT_OSS'|'VAT_IOSS'|'GST'|'FEDERAL_EIN'|'CPF'|'CNPJ'|'SST'|'TIN'|'NIP'|'NPWP'|'NCID',
'registrationId': 'string',
'locality': 'string'
},
],
returnUrl='string',
refreshUrl='string',
clientToken='string',
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app being registered for payment.
string
Your registered legal name.
dict
Your business address.
street1 (string) -- [REQUIRED]
The first line of the street address.
street2 (string) --
The second line of the street address.
city (string) -- [REQUIRED]
The city of the street address.
state (string) -- [REQUIRED]
The state or province.
postalCode (string) -- [REQUIRED]
The postal or ZIP code.
country (string) -- [REQUIRED]
The ISO 3166-1 alpha-2 country code.
string
Your tax registration number (for example, VAT, GST, or EIN).
string
Whether the seller is an individual or a registered business.
string
Your primary contact email for this registration, distinct from supportEmail (the address shown to customers). If you omit it, AWS App Monetization uses supportEmail.
string
Your support email address, displayed in the invoice footer.
string
Customer-facing name (doing-business-as) shown to buyers on invoices, distinct from legalName.
string
Customer-facing support phone number shown to buyers on invoices.
bytes
Logo printed on the seller's invoices: raw PNG or JPEG bytes, up to 100 KiB. The image type is detected from the bytes. Write-only: the logo is not returned by GetAppPaymentRegistration.
list
The jurisdictions where the seller is registered to collect tax.
(dict) --
A jurisdiction where the seller is registered to collect tax.
countryCode (string) -- [REQUIRED]
The ISO 3166-1 alpha-2 country code.
state (string) --
The state or province code (for example, "NY" or "CA"). Required for US and CA.
collectionType (string) -- [REQUIRED]
The country-specific collection type (for example, "state_sales_tax", "standard", or "simplified").
registrationType (string) --
Which tax this registration is for, or which entity identifier it carries (for example SALES_USE for a US state, VAT or GST elsewhere, FEDERAL_EIN for a US employer identification number). Optional.
registrationId (string) --
The tax ID issued for this registration (permit number or tax registration number). Optional.
locality (string) --
Jurisdiction below the state, as a code rather than a name: a FIPS code in the US, an IBGE code in Brazil. Requires state. Optional.
string
[REQUIRED]
The URL the seller's browser is redirected to after completing hosted registration.
string
[REQUIRED]
The URL the seller's browser is redirected to if the hosted registration session expires.
string
A unique, case-sensitive identifier to ensure that the operation completes no more than one time.
This field is autopopulated if not provided.
string
[REQUIRED]
Required. The environment: live or sandbox.
dict
Response Syntax
{
'registrationUrl': 'string',
'expiresAt': datetime(2015, 1, 1)
}
Response Structure
(dict) --
Output for CreateAppPaymentRegistration.
registrationUrl (string) --
The hosted URL the seller opens to finish entering payment and tax details.
expiresAt (datetime) --
The time the registration URL expires.
Returns a user's current subscription and any pending change.
See also: AWS API Documentation
Request Syntax
client.get_subscription(
appId='string',
userId='string',
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app.
string
[REQUIRED]
An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
string
[REQUIRED]
Required. The environment: live or sandbox.
dict
Response Syntax
{
'subscription': {
'appId': 'string',
'userId': 'string',
'planId': 'string',
'effectiveAt': datetime(2015, 1, 1),
'billingAnchorDate': datetime(2015, 1, 1),
'billingCycle': 'MONTHLY'|'ANNUAL'|'ONE_TIME'
},
'pendingChange': {
'planId': 'string',
'planName': 'string',
'effectiveAt': datetime(2015, 1, 1)
},
'currentPeriodEndsAt': datetime(2015, 1, 1)
}
Response Structure
(dict) --
Output for GetSubscription.
subscription (dict) --
The user's current subscription.
appId (string) --
The ID of the app that the subscription belongs to.
userId (string) --
The opaque end-user identifier that the subscription belongs to.
planId (string) --
The ID of the plan that the user is subscribed to.
effectiveAt (datetime) --
The time when the subscription took effect.
billingAnchorDate (datetime) --
The fixed reference instant the recurring billing cycle is measured from. It is set when the subscription first takes effect and stays fixed as periods roll forward, so it is normally an older date than the current period — not the start of the current period. For the end of the current cycle, use currentPeriodEndsAt on GetSubscriptionResponse (derived from this anchor and the billing cycle) rather than this value.
billingCycle (string) --
The billing cycle of the subscription, such as monthly or annual.
pendingChange (dict) --
The scheduled change to the subscription, if one is pending; null otherwise.
planId (string) --
The plan the subscription moves to. Absent for a cancellation.
planName (string) --
Display name of planId's plan, when known.
effectiveAt (datetime) --
The time when the pending change takes effect, at the end of the current billing period.
currentPeriodEndsAt (datetime) --
The time when the current billing period ends and the next begins. Pending changes take effect and usage quotas reset at this time. Null for one-time subscriptions.
Updates the definition of a one-time price. This operation is idempotent.
See also: AWS API Documentation
Request Syntax
client.update_one_time_price(
appId='string',
oneTimePriceId='string',
definition={
'name': 'string',
'price': {
'currencyCode': 'string',
'amount': 'string'
},
'metricId': 'string',
'capacity': 123
},
clientToken='string'
)
string
[REQUIRED]
The ID of the app the one-time price belongs to.
string
[REQUIRED]
The ID of the one-time price to update.
dict
[REQUIRED]
The new definition to apply to the one-time price, including its display name, price, metric, and credited capacity.
name (string) -- [REQUIRED]
A human-readable display name for the one-time price.
price (dict) -- [REQUIRED]
The amount and currency charged for one purchase of the one-time price.
currencyCode (string) -- [REQUIRED]
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) -- [REQUIRED]
An arbitrary-precision decimal represented as a string (for example, "9.99").
metricId (string) -- [REQUIRED]
The metric one purchase credits.
capacity (integer) -- [REQUIRED]
The units of metricId one purchase credits.
string
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.
This field is autopopulated if not provided.
dict
Response Syntax
{
'oneTimePrice': {
'arn': 'string',
'appId': 'string',
'oneTimePriceId': 'string',
'definition': {
'name': 'string',
'price': {
'currencyCode': 'string',
'amount': 'string'
},
'metricId': 'string',
'capacity': 123
},
'stage': 'DRAFT'|'PUBLISHED'
}
}
Response Structure
(dict) --
Output for UpdateOneTimePrice.
oneTimePrice (dict) --
The updated one-time price.
arn (string) --
The Amazon Resource Name (ARN) of the one-time price.
appId (string) --
The ID of the app the one-time price belongs to.
oneTimePriceId (string) --
The service-assigned ID of the one-time price.
definition (dict) --
The definition of the one-time price, including its display name, price, metric, and credited capacity.
name (string) --
A human-readable display name for the one-time price.
price (dict) --
The amount and currency charged for one purchase of the one-time price.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
metricId (string) --
The metric one purchase credits.
capacity (integer) --
The units of metricId one purchase credits.
stage (string) --
The offering stage the one-time price was read from.
Creates a one-time price for an app. The one-time price exists on the draft (DRAFT) offering until published.
See also: AWS API Documentation
Request Syntax
client.create_one_time_price(
appId='string',
definition={
'name': 'string',
'price': {
'currencyCode': 'string',
'amount': 'string'
},
'metricId': 'string',
'capacity': 123
},
clientToken='string',
tags={
'string': 'string'
}
)
string
[REQUIRED]
The ID of the app the one-time price belongs to.
dict
[REQUIRED]
The definition of the one-time price to create, including its display name, price, metric, and credited capacity.
name (string) -- [REQUIRED]
A human-readable display name for the one-time price.
price (dict) -- [REQUIRED]
The amount and currency charged for one purchase of the one-time price.
currencyCode (string) -- [REQUIRED]
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) -- [REQUIRED]
An arbitrary-precision decimal represented as a string (for example, "9.99").
metricId (string) -- [REQUIRED]
The metric one purchase credits.
capacity (integer) -- [REQUIRED]
The units of metricId one purchase credits.
string
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.
This field is autopopulated if not provided.
dict
Optional tags to add to the one-time price when it is created. Tagging on create also requires permission for appmonetization:TagResource.
(string) --
A tag key. Keys that begin with aws: (in any letter case) are reserved and rejected.
(string) --
A tag value.
dict
Response Syntax
{
'oneTimePrice': {
'arn': 'string',
'appId': 'string',
'oneTimePriceId': 'string',
'definition': {
'name': 'string',
'price': {
'currencyCode': 'string',
'amount': 'string'
},
'metricId': 'string',
'capacity': 123
},
'stage': 'DRAFT'|'PUBLISHED'
}
}
Response Structure
(dict) --
Output for CreateOneTimePrice.
oneTimePrice (dict) --
The newly created one-time price.
arn (string) --
The Amazon Resource Name (ARN) of the one-time price.
appId (string) --
The ID of the app the one-time price belongs to.
oneTimePriceId (string) --
The service-assigned ID of the one-time price.
definition (dict) --
The definition of the one-time price, including its display name, price, metric, and credited capacity.
name (string) --
A human-readable display name for the one-time price.
price (dict) --
The amount and currency charged for one purchase of the one-time price.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
metricId (string) --
The metric one purchase credits.
capacity (integer) --
The units of metricId one purchase credits.
stage (string) --
The offering stage the one-time price was read from.
Archives a metric, removing its definition from the app's draft configuration. The removal takes effect on the next call to PublishDraft. Already-recorded usage events and usage history are retained; archiving only stops the metric from aggregating further usage. Any plan quota or usage pack keyed to the metric is removed with it. If the metric was published, its metric ID and display name are permanently retired and cannot be reused.
See also: AWS API Documentation
Request Syntax
client.archive_metric(
appId='string',
metricId='string'
)
string
[REQUIRED]
The ID of the app.
string
[REQUIRED]
The ID of the metric to archive.
dict
Response Syntax
{
'appId': 'string',
'metricId': 'string'
}
Response Structure
(dict) --
Output for ArchiveMetric. Echoes the archived metric's identifiers.
appId (string) --
The ID of the app the archived metric belonged to.
metricId (string) --
The ID of the archived metric.
Adds or updates a seller-declared third-party (non-AWS) monthly cost for an app. Omit the cost identifier to create a new cost, or supply an existing cost identifier to update it in place. The amount is a flat monthly value, and currency defaults to USD when omitted.
See also: AWS API Documentation
Request Syntax
client.put_third_party_cost(
appId='string',
costId='string',
label='string',
amount='string',
frequency='MONTHLY',
currency='USD',
description='string',
effectiveFrom='string',
effectiveTo='string',
clientToken='string'
)
string
[REQUIRED]
The ID of the app the cost belongs to.
string
The ID of the cost. Omit it to create a new cost, or supply an existing cost ID to update that cost in place.
string
[REQUIRED]
A human-readable label for the cost (for example, "Anthropic API").
string
[REQUIRED]
A flat monthly amount as a decimal string (for example, "12.50").
string
How often the cost recurs. MONTHLY is the only value today.
string
The currency of the amount. Defaults to USD when omitted (USD is the only supported currency).
string
A free-form description of the cost.
string
First month (YYYY-MM) the cost applies in. Absent means the cost has no start month.
string
Last month (YYYY-MM) the cost applies in. Absent means the cost has no end month. When both are present, effectiveFrom must not be after effectiveTo.
string
AWS App Monetization does not use this value for this operation. To retry without creating a duplicate cost, pass the costId returned by the first call.
This field is autopopulated if not provided.
dict
Response Syntax
{
'item': {
'appId': 'string',
'costId': 'string',
'label': 'string',
'amount': 'string',
'frequency': 'MONTHLY',
'currency': 'USD',
'description': 'string',
'effectiveFrom': 'string',
'effectiveTo': 'string',
'createdAt': datetime(2015, 1, 1),
'updatedAt': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Output for PutThirdPartyCost.
item (dict) --
The third-party cost that was created or updated.
appId (string) --
The ID of the app the cost belongs to.
costId (string) --
The ID of the cost.
label (string) --
A human-readable label for the cost (for example, "Anthropic API").
amount (string) --
The flat monthly amount as a decimal string (for example, "12.50").
frequency (string) --
How often the cost recurs. MONTHLY is the only value today.
currency (string) --
The currency of the amount. USD is the only supported currency.
description (string) --
A free-form description of the cost.
effectiveFrom (string) --
First month (YYYY-MM) the cost applies in. Absent means the cost has no start month.
effectiveTo (string) --
Last month (YYYY-MM) the cost applies in. Absent means the cost has no end month.
createdAt (datetime) --
The time the cost was created.
updatedAt (datetime) --
The time the cost was last updated.
Returns usage for an app, grouped by metric (the default), user, or time.
See also: AWS API Documentation
Request Syntax
client.get_app_usage_summary(
appId='string',
startedAt=datetime(2015, 1, 1),
endedAt=datetime(2015, 1, 1),
groupBy='METRIC'|'USER'|'TIME',
filterBy={
'string': [
'string',
]
},
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app.
datetime
[REQUIRED]
Start of the reporting window.
datetime
[REQUIRED]
End of the reporting window. Must be after startedAt, at most 720 hours after it, and not in the future.
string
The breakdown dimension. Defaults to METRIC when omitted.
dict
Filter constraints keyed by dimension. A filter dimension may differ from groupBy.
(string) --
Dimensions GetAppUsageSummary can group and filter by. TIME groups by UTC day.
(list) --
A list of filter values for a single dimension.
(string) --
Literal filter value, 1-256 characters.
string
[REQUIRED]
Required. The environment: live or sandbox.
dict
Response Syntax
{
'appId': 'string',
'groupBy': 'METRIC'|'USER'|'TIME',
'totalEvents': 123,
'groups': [
{
'key': 'string',
'metricName': 'string',
'usage': 123
},
],
'startedAt': datetime(2015, 1, 1),
'endedAt': datetime(2015, 1, 1),
'updatedAt': datetime(2015, 1, 1)
}
Response Structure
(dict) --
Output for GetAppUsageSummary.
appId (string) --
The ID of the app.
groupBy (string) --
The dimension that the summary is grouped by.
totalEvents (integer) --
The total number of usage events counted across the window.
groups (list) --
One row per value of the groupBy dimension (usage per metric, user, or UTC day).
(dict) --
A usage total for a single value of the groupBy dimension.
key (string) --
The value of the groupBy dimension for this row.
metricName (string) --
The name of the metric, when the summary is grouped by metric.
usage (integer) --
The number of usage events in this group.
startedAt (datetime) --
Start of the reporting window the summary covers.
endedAt (datetime) --
End of the reporting window the summary covers.
updatedAt (datetime) --
The time the summary was last updated.
Adds or overwrites tags on an app, pricing plan, billing metric or one-time price.
See also: AWS API Documentation
Request Syntax
client.tag_resource(
resourceArn='string',
tags={
'string': 'string'
}
)
string
[REQUIRED]
ARN of the app, pricing plan, billing metric or one-time price to tag.
dict
[REQUIRED]
Tags to add. A tag whose key already exists on the resource has its value overwritten.
(string) --
A tag key. Keys that begin with aws: (in any letter case) are reserved and rejected.
(string) --
A tag value.
dict
Response Syntax
{}
Response Structure
(dict) --
Output for TagResource.
Creates a usage metric definition for an app. A metric beyond the Metrics per app quota is refused with ServiceQuotaExceededException.
See also: AWS API Documentation
Request Syntax
client.create_metric(
appId='string',
name='string',
description='string',
eventType='string',
unitName='string',
definition={
'filters': [
{
'field': 'string',
'operator': 'EQUALS'|'NOT_EQUALS'|'IN'|'NOT_IN',
'values': [
'string',
]
},
],
'function': 'SUM'|'COUNT'|'MAX',
'functionField': 'string',
'groupBy': [
'string',
],
'period': 'MONTHLY'
},
clientToken='string',
tags={
'string': 'string'
}
)
string
[REQUIRED]
The ID of the app the metric belongs to.
string
[REQUIRED]
A human-readable display name for the metric (for example, Riddles Solved).
string
[REQUIRED]
A description of what the metric measures.
string
[REQUIRED]
The event type this metric aggregates. Must match the eventType sent on PutEvent.
string
[REQUIRED]
The unit of measure for the metric (for example, "requests" or "tokens").
dict
[REQUIRED]
The aggregation definition: filters, aggregation function, grouping, and period.
filters (list) -- [REQUIRED]
The predicates selecting which events contribute to the metric. Combined with logical AND.
(dict) --
A single predicate that selects which events contribute to a metric.
field (string) -- [REQUIRED]
The event property key the filter is evaluated against.
operator (string) -- [REQUIRED]
The comparison operator (EQUALS, NOT_EQUALS, IN, or NOT_IN).
values (list) -- [REQUIRED]
The values the field is compared against.
(string) --
A value the field is compared against, 1-256 characters. Single quotes (') and backslashes () are not allowed.
function (string) -- [REQUIRED]
The aggregation function applied to matching events (SUM, COUNT, or MAX).
functionField (string) --
The event property key the aggregation function operates on. Required for SUM and MAX; ignored for COUNT.
groupBy (list) -- [REQUIRED]
The event fields to group aggregated results by.
(string) --
Name of an event property key referenced by a metric filter or aggregation (filter field, functionField, groupBy). Lowercase snake_case, 1-64 characters: letters, digits, and underscores only, starting with a letter. Unlike PropertyKey, dots are not allowed, so a metric can't reference a property whose key contains a dot.
period (string) -- [REQUIRED]
The reset or rollup period for the aggregation.
string
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.
This field is autopopulated if not provided.
dict
Optional tags to add to the metric when it is created. Tagging on create also requires permission for appmonetization:TagResource.
(string) --
A tag key. Keys that begin with aws: (in any letter case) are reserved and rejected.
(string) --
A tag value.
dict
Response Syntax
{
'metric': {
'appId': 'string',
'metricId': 'string',
'name': 'string',
'description': 'string',
'eventType': 'string',
'unitName': 'string',
'definition': {
'filters': [
{
'field': 'string',
'operator': 'EQUALS'|'NOT_EQUALS'|'IN'|'NOT_IN',
'values': [
'string',
]
},
],
'function': 'SUM'|'COUNT'|'MAX',
'functionField': 'string',
'groupBy': [
'string',
],
'period': 'MONTHLY'
},
'arn': 'string',
'stage': 'DRAFT'|'PUBLISHED'
}
}
Response Structure
(dict) --
Output for CreateMetric.
metric (dict) --
The newly created metric, in the app's draft. It goes live on the next app-level PublishDraft.
appId (string) --
The ID of the app the metric belongs to.
metricId (string) --
The ID of the metric. We assign this value when you create the metric; it is unique within the app. Treat it as opaque.
name (string) --
A human-readable display name for the metric.
description (string) --
A description of what the metric measures.
eventType (string) --
The event type this metric aggregates.
unitName (string) --
The unit of measure for the metric.
definition (dict) --
The aggregation definition: filters, aggregation function, grouping, and period.
filters (list) --
The predicates selecting which events contribute to the metric. Combined with logical AND.
(dict) --
A single predicate that selects which events contribute to a metric.
field (string) --
The event property key the filter is evaluated against.
operator (string) --
The comparison operator (EQUALS, NOT_EQUALS, IN, or NOT_IN).
values (list) --
The values the field is compared against.
(string) --
A value the field is compared against, 1-256 characters. Single quotes (') and backslashes () are not allowed.
function (string) --
The aggregation function applied to matching events (SUM, COUNT, or MAX).
functionField (string) --
The event property key the aggregation function operates on. Required for SUM and MAX; ignored for COUNT.
groupBy (list) --
The event fields to group aggregated results by.
(string) --
Name of an event property key referenced by a metric filter or aggregation (filter field, functionField, groupBy). Lowercase snake_case, 1-64 characters: letters, digits, and underscores only, starting with a letter. Unlike PropertyKey, dots are not allowed, so a metric can't reference a property whose key contains a dot.
period (string) --
The reset or rollup period for the aggregation.
arn (string) --
The Amazon Resource Name (ARN) of the metric. Output only.
stage (string) --
The offering stage this metric was read from: DRAFT or PUBLISHED. Present on metric reads; absent on write responses.
Lists the one-time prices for an app. Returns a paginated list; use the nextToken value to retrieve additional pages.
See also: AWS API Documentation
Request Syntax
client.list_one_time_prices(
appId='string',
stage='DRAFT'|'PUBLISHED',
maxResults=123,
nextToken='string',
scope='sandbox'|'live'
)
string
[REQUIRED]
The ID of the app whose one-time prices are listed.
string
The offering stage to list one-time prices from: DRAFT (the latest authored draft) or PUBLISHED (the published offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.
integer
The maximum number of one-time prices to return in a single call. To retrieve the remaining results, make another call with the nextToken value that is returned in the response.
string
The pagination token that is returned by a previous call. Use it to retrieve the next page of results. Omit this parameter on the first call.
string
[REQUIRED]
Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft (what the sandbox runs).
dict
Response Syntax
{
'oneTimePrices': [
{
'arn': 'string',
'appId': 'string',
'oneTimePriceId': 'string',
'definition': {
'name': 'string',
'price': {
'currencyCode': 'string',
'amount': 'string'
},
'metricId': 'string',
'capacity': 123
},
'stage': 'DRAFT'|'PUBLISHED'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
Output for ListOneTimePrices.
oneTimePrices (list) --
The one-time prices for the app.
(dict) --
A one-time price for an app: a usage pack a buyer can purchase once to credit a metric.
arn (string) --
The Amazon Resource Name (ARN) of the one-time price.
appId (string) --
The ID of the app the one-time price belongs to.
oneTimePriceId (string) --
The service-assigned ID of the one-time price.
definition (dict) --
The definition of the one-time price, including its display name, price, metric, and credited capacity.
name (string) --
A human-readable display name for the one-time price.
price (dict) --
The amount and currency charged for one purchase of the one-time price.
currencyCode (string) --
The ISO 4217 currency code (three uppercase letters, for example, "USD").
amount (string) --
An arbitrary-precision decimal represented as a string (for example, "9.99").
metricId (string) --
The metric one purchase credits.
capacity (integer) --
The units of metricId one purchase credits.
stage (string) --
The offering stage the one-time price was read from.
nextToken (string) --
The pagination token to use in a subsequent call to retrieve the next page of results. This value is absent when there are no more results to return.
Creates an app. AWS App Monetization assigns a unique app identifier. This operation is idempotent: a repeated request with the same clientToken returns the app created by the original request.
See also: AWS API Documentation
Request Syntax
client.create_app(
name='string',
description='string',
clientToken='string',
tags={
'string': 'string'
},
costTracking={
'roleArn': 'string'
}
)
string
[REQUIRED]
A human-readable display name for the app.
string
A longer description of what the app does.
string
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.
This field is autopopulated if not provided.
dict
Optional tags to add to the app when it is created. To add tags when you create the app, you must also have permission for appmonetization:TagResource.
(string) --
A tag key. Keys that begin with aws: (in any letter case) are reserved and rejected.
(string) --
A tag value.
dict
Optional cost-tracking configuration: the IAM role AWS App Monetization uses to track this app's AWS costs. To pass a role, you must have permission for iam:PassRole on it.
roleArn (string) -- [REQUIRED]
The ARN of an IAM role that AWS App Monetization assumes in your account to create and manage the AWS Data Exports export for this app. The role must be in your account and partition, and its name (after any path) must start with AppMonetizationCostTracking. You need iam:PassRole on it. Its trust policy must allow appmonetization.amazonaws.com to assume it, with conditions that pin aws:SourceAccount to your account ID and aws:SourceArn to your account's apps (arn:aws:appmonetization:::apps/*). The setup runs in the background after the call returns, and cost data starts arriving within 24-48 hours. Calling UpdateApp with a role again re-runs the setup. A CreateApp retry with the same clientToken must carry the same role: a different role, or a role added or dropped, fails with IdempotencyConflictException.
dict
Response Syntax
{
'app': {
'appId': 'string',
'name': 'string',
'description': 'string',
'status': 'ACTIVE'|'DELETED',
'createdAt': datetime(2015, 1, 1),
'arn': 'string'
}
}
Response Structure
(dict) --
Output for CreateApp.
app (dict) --
The created app, carrying its service-assigned appId and initial status. On an idempotent replay with the same clientToken, this is the app the original call created.
appId (string) --
The service-assigned identifier for the app.
name (string) --
A human-readable display name for the app.
description (string) --
A longer description of what the app does.
status (string) --
The lifecycle status of the app.
createdAt (datetime) --
The time the app was created.
arn (string) --
The resource ARN of this app.