Getting NO_PERMISSION for Suspend subscription

Reply
Highlighted
zhengye1 Tutor

Tutor

Tutor
Posts: 1
Registered: ‎04-30-2018

Getting NO_PERMISSION for Suspend subscription

I try to create amendmant call for suspend the subscription, but I am getting following error

 

{Code=NO_PERMISSION, Message=Not support suspend and resume amendments.}

 

 

And here is the code I wrote in the salesforce to try to suspend the subscription

    public static String suspendSubscription(String subscriptionName, Date effectiveDate){
        ZuoraClient api = login();
        
        System.debug('Login: ' + api);
        //find by name....
        Zuora.zObject zsubscription = ZuoraUtil.findZuoraSubscriptionByName(subscriptionName);
        String zsubId = (String)zsubscription.getValue('Id');
        
        System.debug('Zuora Id:' + zsubId);
        Zuora.zObject[] zobjects = new Zuora.zObject[]{};
        Zuora.zObject amendment = new Zuora.zObject('Amendment');
        //amendment.setValue('Status', 'Completed');
        amendment.setValue('SubscriptionId', zsubId);
        amendment.setValue('Type', 'SuspendSubscription');
        amendment.setValue('Name', 'Suspend a subscription');
        amendment.setValue('ContractEffectiveDate', ZuoraUtil.formatDate(effectiveDate));
        //amendment.setValue('EffectiveDate', formatDate(subscription.Zuora__TermStartDate__c));
        amendment.setValue('EffectiveDate', ZuoraUtil.formatDate(effectiveDate));
        zobjects.add(amendment);
        try {
             List < Zuora.zApi.SaveResult > results = api.zcreate(zobjects);
        	for (Zuora.zApi.SaveResult result : results) {
            	if (result.Success){
                 //get the newly created id 
                 	String createdId = result.Id; 
                 // more code here...
             	} else {
                 //failure
                 	system.debug(result.errors);
                 	throw new ZuoraException(result.errors);
             	}
        	}
			return results[0].Id;            
        }catch(Exception e){
            System.debug('Exception catch' + e);
            return '';
        }
    }

 

All the parameter I following on this link: Suspend a subscription, so I don't know what is going wrong

Guru
Posts: 92
Registered: ‎02-22-2017

Re: Getting NO_PERMISSION for Suspend subscription

Hi @zhengye1!

 

I think that Suspend is not available in your Tenant.

How to check whether Suspend is available on your Tenant:

  1. Log in to the Sandbox UI.
  2. Go to Subscription page.
  3. Click "more" in the upper right and check whether there is a link "Suspend".suspend_subscription01.png

 

If you can not see this link on your Tenant:

 

Suspend (and Resume) is one of the functions called Limited Availability (LA).
https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E1_SOAP_API_Object_Reference/Amendment
> - Suspend a subscription (This feature is in Limited Availability.)
> - Resume a subscription (This feature is in Limited Availability.)

 

LA is deactivated by default. In order to activate LA, you need to ask Global Suppot.