API Docs
Billing Plans represent a template used to generate a subscription from. Every time you create a Subscription you’ll need to reference a Billing Plan. The Plan has all the basic settings required to to run a Subscription. When you create a sub, any information the you don’t submit will be populated from the Plan.
Field | Notes | Data Type |
Identifier | See Identifier | string |
Name | string | |
Description | string | |
TrialDuration | Can be Null. If null or 0 then there is no trial period. Depending on how you have configured the Plan this may or may not affect a subs start date. | int? |
DayOfMonth | Can’t be 0, 29 or 30. If is 31 billing will occur on the last day of the month. | int |
NeverExpires | If true, NumberOfCycles must be 0. If false, NumberOfCycles must be positive. | bool |
NumberOfCycles | The number of billing cycles to run. 0 represents no limit. | int |
CycDurationType | Used with CycleFrequency to describe how often to bill (Day, Week, Month). | CycleDuration |
CycleFrequency | The number of Durations to wait between billing. Every 2 Weeks for example. | int |
Price | decimal | |
SubFailureOption | FailureOption | |
ModifiedBy | The last user to make a change to the plan. | String |
Active | bool | |
Addons | The addon is the key, and the int value is how many of that addon to associate with the plan. | Dictionary<Addon, int> |
Discounts | The discount is the key, and the int value is how many of that discount to associate with the plan. | Dictionary<Discount, int> |
Below are the methods that deal directly with Plans. These definitions are for the SOAP interface. The only difference in the REST interface is putting the sessionToken in the HTTP Authorization Header instead of as a parameter.
IdResponse CreateBillingPlan(string sessionToken, BillingPlanInfo billingPlan, string merchantProfileId)
Parameter | Description | Data Type |
sessionToken | string | |
billingPlan | Plan data | BillingPlanInfo |
merchantProfileId | string |
Response UpdateBillingPlan(string sessionToken, BillingPlanInfo newData, string currentIdentifier, string merchantProfileId, Dictionary<string, int> associateAddons = null, List<string> removeAddons = null, Dictionary<string, int> associateDiscounts = null, List<string> removeDiscounts = null, bool? activeSpecified = null, bool? expiresSpecified = null)
Parameter | Description | Data Type |
sessionToken | string | |
billingPlan | Plan data | BillingPlanInfo |
currentIdentifier | The Identifier of the Plan to be updated with the submitted data. Only submitted fields are updated. Null fields are ignored. | string |
merchantProfileId | string | |
associateAddons | Dictionary of addons to add to the Plan, the addon identifier is the key, and the quantity of the addon is the value. | Dictionary<string, int> |
removeAddons | List of addons to remove from the Plan. | List<string> |
associateDiscounts | Dictionary of discounts to add to the Plan, the discounts identifier is the key, and the quantity of the discounts is the value. | Dictionary<string, int> |
removeDiscounts | List of addons to remove from the Plan. | List<string> |
activeSpecified | Indicates if the active boolean in the new plan data should be saved. | bool? |
expiresSpecified | Indicates if the never expires boolean in the new plan data should be saved. | bool? |
GetBillingPlanResponse GetBillingPlan(string sessionToken, string identifier, string merchantProfileId)
Parameter | Description | Data Type |
sessionToken | string | |
identifier | The Identifier of the Plan to retrieve | string |
merchantProfileId | string |
CountResponse GetBillingPlanCount(string sessionToken, string merchantProfileId)
Parameter | Description | Data Type |
sessionToken | string | |
merchantProfileId | string |
GetBillingPlansResponse GetBillingPlans(string sessionToken, int pageNum, int pageSize, string merchantProfileId)
Parameter | Description | Data Type |
sessionToken | string | |
pageNum | int | |
pageSize | int | |
merchantProfileId | string |
GetBillingPlansResponse SearchBillingPlans(string sessionToken, SearchTerms searchTerms, string merchantProfileId)
Parameter | Description | Data Type |
sessionToken | string | |
searchTerms | SearchTerms | SearchTerms |
merchantProfileId | string |
Updated: June 2, 2017
SUBMIT A DEVELOPER SUPPORT REQUEST
Agent or a merchant? Contact NAB support at 866.485.8999 EXT 2341