AppMonetization / Client / get_plan

get_plan

AppMonetization.Client.get_plan(**kwargs)

Returns the details of a plan.

See also: AWS API Documentation

Request Syntax

response = client.get_plan(
    appId='string',
    planId='string',
    stage='DRAFT'|'PUBLISHED',
    scope='sandbox'|'live'
)
Parameters:
  • appId (string) –

    [REQUIRED]

    The ID of the app.

  • planId (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.

  • stage (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.

  • scope (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).

Return type:

dict

Returns:

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.

              Note

              This is a Tagged Union structure. Only one of the following top level keys will be set: flat, tiered. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

              'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
              
              • 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.

Exceptions