Subscription Status

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

Parameters

AttributeData TypeMandatoryDescription
merchantSubscriptionIdStringYesId generated by the merchant

Example:

import com.phonepe.sdk.pg.subscription.v2.SubscriptionClient;
import com.phonepe.sdk.pg.subscription.v2.models.response.SubscriptionStatusResponseV2;
 
String clientId = "<clientId>";
String clientSecret = "<clientSecret>";
Integer clientVersion = 1;  //insert your client version here
Env env = Env.SANDBOX;      //change to Env.PRODUCTION when you go live
 
String merchantSubscriptionId = "<MERCHANT_SUBSCRIPTION_ID>";
 
SubscriptionClient subscriptionClient = SubscriptionClient.getInstance(clientId, clientSecret, clientVersion, env);
SubscriptionStatusResponseV2 status = subscriptionClient.getSubscriptionStatus(merchantSubscriptionId);

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
merchantSubscriptionIdStringUnique order ID generated by PhonePe
subscriptionIdStringUnique Subscription Id generated by PhonePe
stateStringState of the subscription
1. ACTIVE
2. CANCELLED
3. REVOKED
authWorkflowTypeAuthWorkflowTypeType of setup workflow
1. TRANSACTION
2. PENNY_DROP
amountTypeAmountTypeNature of redemption amount
1. FIXED
2. VARIABLE
maxAmountLongMax 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
expireAtLongSubscription cycle expiry. No operation allowed after subscription expires
pauseStartDateLongIf state is paused, then the field will be present
pauseEndDateLongIf state is paused, then the field will be present