- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
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:
- Log in to the Sandbox UI.
- Go to Subscription page.
- Click "more" in the upper right and check whether there is a link "Suspend".
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.