AppMonetization / Client / get_subscription

get_subscription

AppMonetization.Client.get_subscription(**kwargs)

Returns a user’s current subscription and any pending change.

See also: AWS API Documentation

Request Syntax

response = client.get_subscription(
    appId='string',
    userId='string',
    scope='sandbox'|'live'
)
Parameters:
  • appId (string) –

    [REQUIRED]

    The ID of the app.

  • userId (string) –

    [REQUIRED]

    An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.

  • scope (string) –

    [REQUIRED]

    Required. The environment: live or sandbox.

Return type:

dict

Returns:

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.

Exceptions

  • AppMonetization.Client.exceptions.AccessDeniedException

  • AppMonetization.Client.exceptions.ValidationException

  • AppMonetization.Client.exceptions.InternalServerException

  • AppMonetization.Client.exceptions.ResourceNotFoundException

  • AppMonetization.Client.exceptions.ThrottlingException