Subscription Status

The get_subscription_status() method is used to retrieve the status of the subscription by passing the below parameters:

Parameters

AttributeData TypeMandatoryDescription
merchant_subscription_idStrYesId generated by the merchant

Example:

from phonepe.sdk.pg.subscription.v2.subscription_client import SubscriptionClient
 
client_id = "<client_id>"
client_secret = "<client_secret>"
client_version = 1              # insert your client version here
env = Env.SANDBOX               # change to Env.PRODUCTION when you go live
 
merchant_subscription_id = "<MERCHANT_SUBSCRIPTION_ID>"
 
subscription_client = SubscriptionClient.get_instance(client_id,client_secret,client_version,env)
status = subscription_client.get_subscription_status(merchant_subscription_id)

Returns:

The function returns a SubscriptionStatusResponseV2 object with the following properties:

SubscriptionStatusResponseV2 Properties:

Here is the response property table for the given model:

Response Parameters

AttributeData TypeDescription
merchant_subscription_idStrUnique order ID generated by PhonePe
subscription_idStrUnique Subscription Id generated by PhonePe
stateStrState of the subscription
1. ACTIVE
2. CANCELLED
3. REVOKED
auth_workflow_typeAuthWorkflowTypeType of setup workflow
1. TRANSACTION
2. PENNY_DROP
amount_typeAmountTypeNature of redemption amount
1. FIXED
2. VARIABLE
max_amountIntMax amount upto which redemptions will be allowed
frequencyFrequencySubscription frequency
1. DAILY
2. WEEKLY
3. MONTHLY
4. YEARLY
5. FORTNIGHTLY
6. BIMONTHLY
7. ON_DEMAND
8. QUATERLY
9. HALFYEARLY
expire_atIntSubscription cycle expiry. No operation allowed after subscription expires
pause_start_dateIntIf state is paused, then the field will be present
pause_end_dateIntIf state is paused, then the field will be present