Get Plan Details

Use getConversivePlanDetails() when you need account-level subscription visibility inside Salesforce.

What this API can tell you

The Confluence page documents that this method can return:

  • account-level subscription details
  • plan type and plan label
  • credit information
  • license allocation and usage
  • inbound number allocation and usage
  • plan expiry information

Method signature

public static ConversiveAPI.PlanResponse getConversivePlanDetails()

Inputs

This API takes no input parameters.

Response type

public class PlanResponse {
public String response; // SUCCESS / ERROR
public String responseMessage; // human readable message
public ConversivePlanDetailsService.ConversivePlanDetailsResponse planDetails;
}

Top-level response fields

FieldTypeDescription
responseStringIndicates success or failure
responseMessageStringHuman-readable result
planDetailsObjectStructured plan and subscription details

planDetails structure

public class ConversivePlanDetailsResponse {
public Boolean success;
public Integer accountId;
public String expirationDateTime;
public String countryName;
public String crmName;
public List<PlanDetails> planDetails;
public String message;
}

Top-level planDetails fields

FieldTypeDescription
successBooleanWhether the plan lookup succeeded
accountIdIntegerConversive account ID
expirationDateTimeStringPlan or subscription expiration timestamp
countryNameStringCountry associated with the account
crmNameStringCRM platform associated with the account
planDetailsListList of plan entries
messageStringAdditional service message

Plan entry structure

public class PlanDetails {
public String planType;
public Integer planCode;
public List<Object> planMetaInfo;
public String planLabel;
public Integer phoneNumberCount;
public String credits;
public List<LicenseDetails> licenseDetails;
public List<InboundNumberDetails> inboundNumberDetails;
}

Plan entry fields

FieldTypeDescription
planTypeStringType of plan
planCodeIntegerInternal plan code
planMetaInfoListAdditional plan metadata
planLabelStringHuman-readable plan label
phoneNumberCountIntegerNumber of phone numbers associated with the plan
creditsStringCredit information tied to the plan
licenseDetailsListLicense allocation and usage details
inboundNumberDetailsListInbound number allocation details

License details structure

public class LicenseDetails {
public String licenseType;
public String licenseLabel;
public Boolean isDefault;
public Integer licenseUsedCount;
public Integer licenseCode;
public Integer licenseAllotedCount;
public List<Object> licenseCRMCategory;
public String licenseCategory;
public String licenseProductType;
}

Inbound number details structure

public class InboundNumberDetails {
public Integer inboundNumberType;
public Integer inboundNumberCount;
public String inboundNumberLabel;
public Integer inboundNumberCountry;
public String inboundNumberCountryName;
public Integer inboundNumberUsedCount;
}

Example

try {
ConversiveAPI.PlanResponse resp =
ConversiveAPI.getConversivePlanDetails();
System.debug('response = ' + resp.response);
System.debug('responseMessage = ' + resp.responseMessage);
System.debug('planDetails = ' + resp.planDetails);
} catch (Exception e) {
System.debug('ERROR = ' + e.getMessage());
System.debug('STACK = ' + e.getStackTraceString());
}

Example success response

response = 'SUCCESS'
responseMessage = 'Plan details fetched successfully'

Example error response

response = 'ERROR'
responseMessage = 'Unable to fetch plan details'

Error behavior

The documented failure pattern is:

  • response = 'ERROR'
  • responseMessage explains the issue
  • planDetails may be null or incomplete depending on the failure

Because this method returns nested structures, the safest implementation is to:

  • guard all nested list reads
  • check response before reading planDetails
  • log both responseMessage and planDetails during troubleshooting

Good use cases

  • admin consoles
  • subscription verification
  • entitlement checks
  • license usage reviews
  • inbound number allocation reviews
  • support troubleshooting