Subscription Redeem

The redeem() method is used to initiate/redeem the subscription and can only be made 24 hours after the notify() function is called.

Parameters

AttributeData TypeMandatoryDescription
merchant_order_idStrYesSame merchantOrderId passed in corresponding notify request

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
 
subscription_client = SubscriptionClient.get_instance(client_id,client_secret,client_version,env)
 
merchant_order_id = "<MERCHANT_ORDER_ID>"  # Used at the time of notify()
 
subscription_redeem_response_v2 = subscription_client.redeem(merchant_order_id)

Returns:

The function returns a SubscriptionRedeemResponseV2 object with the following properties:

SubscriptionRedeemResponseV2 Properties:

Here is the response property table for the given model:

PropertyTypeDescription
stateStringState of the order
transaction_idLongTransaction ID generated by PhonePe side.