Overview
The following operations allow you to work with Subscriptions. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with subscriptions, see Sample configuration.
Operation | Description |
---|---|
Creates a subscription. | |
updateSubscription | Updates a subscription. |
deleteSubscription | Deletes a subscription. |
getSubscriptionById | Retrieve a subscription by id. |
Operation details
This section provides further details on the operations related to subscriptions.
Creating a Subscription
The
operation creates a subscription.createSubscription
<killbill.createSubscription> <accountId>{$ctx:accountId}</accountId> <externalKey>{$ctx:externalKey}</externalKey> <bundleId>{$ctx:bundleId}</bundleId> <subscriptionId>{$ctx:subscriptionId}</subscriptionId> <startDate>{$ctx:startDate}</startDate> <productName>{$ctx:productName}</productName> <productCategory>{$ctx:productCategory}</productCategory> <billingPeriod>{$ctx:billingPeriod}</billingPeriod> <phaseType>{$ctx:phaseType}</phaseType> <priceList>{$ctx:priceList}</priceList> <sourceType>{$ctx:sourceType}</sourceType> <cancelledDate>{$ctx:cancelledDate}</cancelledDate> <chargedThroughDate>{$ctx:chargedThroughDate}</chargedThroughDate> <billingStartDate>{$ctx:billingStartDate}</billingStartDate> <state>{$ctx:state}</state> <billingEndDate>{$ctx:billingEndDate}</billingEndDate> <events>{$ctx:events}</events> <priceOverrides>{$ctx:priceOverrides}</priceOverrides> <requestedDate>{$ctx:requestedDate}</requestedDate> <callCompletion>{$ctx:callCompletion}</callCompletion> <callTimeoutSec>{$ctx:callTimeoutSec}</callTimeoutSec> <pluginProperty>{$ctx:pluginProperty}</pluginProperty> <auditLogs>{$ctx:auditLogs}</auditLogs> <createdBy>{$ctx:createdBy}</createdBy> <reason>{$ctx:reason}</reason> <comment>{$ctx:comment}</comment> </killbill.createSubscription>
Properties
accountId:
externalKey:
bundleId:
subscriptionId:
startDate:
productName:
productCategory:
billingPeriod:
phaseType:
priceList:
sourceType:
cancelledDate:
chargedThroughDate:
billingStartDate:
state:
billingEndDate:
events:
priceOverrides:
requestedDate:
callCompletion:
callTimeoutSec:
pluginProperty:
auditLogs:
createdBy:
reason:
comment:
Sample request
Following is a sample REST/JSON request that can be handled by the createsubscription
operation.
{ "apiUrl":"http://127.0.0.1:8080", "apiVersion":"1.0", "username":"admin", "password":"password", "apiKey":"bob", "apiSecret":"lazar", "accountId": "33ca98be-2e86-4861-89df-31cd1f7207ef", "externalKey": "myBundleName", "productName": "Standard", "productCategory": "BASE", "billingPeriod": "MONTHLY", "priceList": "DEFAULT", "createdBy":"demo" }
Note
There are optional parameters available. For more information on the usage of these parameters please check the API document.
Related Kill Bill documentation
http://killbill.io/api/#!/subscriptions/createEntitlement
Modifying a subscription
The u
operation retrieves a single subscription from the specified story.pdateSubscription
<killbill.updateSubscription> <accountId>{$ctx:accountId}</accountId> <externalKey>{$ctx:externalKey}</externalKey> <bundleId>{$ctx:bundleId}</bundleId> <subscriptionId>{$ctx:subscriptionId}</subscriptionId> <startDate>{$ctx:startDate}</startDate> <productName>{$ctx:productName}</productName> <productCategory>{$ctx:productCategory}</productCategory> <billingPeriod>{$ctx:billingPeriod}</billingPeriod> <phaseType>{$ctx:phaseType}</phaseType> <priceList>{$ctx:priceList}</priceList> <sourceType>{$ctx:sourceType}</sourceType> <cancelledDate>{$ctx:cancelledDate}</cancelledDate> <chargedThroughDate>{$ctx:chargedThroughDate}</chargedThroughDate> <billingStartDate>{$ctx:billingStartDate}</billingStartDate> <state>{$ctx:state}</state> <billingEndDate>{$ctx:billingEndDate}</billingEndDate> <events>{$ctx:events}</events> <priceOverrides>{$ctx:priceOverrides}</priceOverrides> <requestedDate>{$ctx:requestedDate}</requestedDate> <callCompletion>{$ctx:callCompletion}</callCompletion> <callTimeoutSec>{$ctx:callTimeoutSec}</callTimeoutSec> <pluginProperty>{$ctx:pluginProperty}</pluginProperty> <auditLogs>{$ctx:auditLogs}</auditLogs> <createdBy>{$ctx:createdBy}</createdBy> <reason>{$ctx:reason}</reason> <comment>{$ctx:comment}</comment> </killbill.updateSubscription>
Properties
accountId:
externalKey:
bundleId:
subscriptionId:
startDate:
productName:
productCategory:
billingPeriod:
phaseType:
priceList:
sourceType:
cancelledDate:
chargedThroughDate:
billingStartDate:
state:
billingEndDate:
events:
priceOverrides:
requestedDate:
callCompletion:
callTimeoutSec:
pluginProperty:
auditLogs:
createdBy:
reason:
comment:
Sample request
Following is a sample REST/JSON request that can be handled by the d
operation.eleteSubscription
{ "apiUrl":"http://127.0.0.1:8080", "apiVersion":"1.0", "username":"admin", "password":"password", "apiKey":"bob", "apiSecret":"lazar", "subscriptionId": "33cde8be-2e86-4961-89df-31cdkf94207ef", "productName": "Standard", "productCategory": "BASE", "billingPeriod": "MONTHLY", "priceList": "DEFAULT", "createdBy":"demo" }
Note
There are optional parameters available. For more information on the usage of these parameters please check the API document.
Related Kill Bill documentation
http://killbill.io/api/#!/subscriptions/changeEntitlementPlan
Deleting a Subscription
The
operation deletes a subscription specified by the id.deleteSubscription
<killbill.deleteSubscription> <subscriptionId>{$ctx:subscriptionId}</subscriptionId> <requestedDate>{$ctx:requestedDate}</requestedDate> <callCompletion>{$ctx:callCompletion}</callCompletion> <callTimeoutSec>{$ctx:callTimeoutSec}</callTimeoutSec> <pluginProperty>{$ctx:pluginProperty}</pluginProperty> <createdBy>{$ctx:createdBy}</createdBy> <reason>{$ctx:reason}</reason> <comment>{$ctx:comment}</comment> <entitlementPolicy>{$ctx:entitlementPolicy}</entitlementPolicy> <billingPolicy>{$ctx:billingPolicy}</billingPolicy> <useRequestedDateForBilling>{$ctx:useRequestedDateForBilling}</useRequestedDateForBilling> </killbill.deleteSubscription>
Properties
subscriptionId:
requestedDate:
callCompletion:
callTimeoutSec:
entitlementPolicy:
billingPolicy:
useRequestedDateForBilling:
pluginProperty:
createdBy:
reason:
comment:
Sample request
Following is a sample REST/JSON request that can be handled by the deleteSubscription
operation.
{ "apiUrl":"http://127.0.0.1:8080", "apiVersion":"1.0", "username":"admin", "password":"password", "apiKey":"bob", "apiSecret":"lazar", "subscriptionId": "33ca98be-2e86-4861-89df-31cd1f7207ef", "createdBy":"demo" }
Note
There are optional parameters available. For more information on the usage of these parameters please check the API document.
Related Kill Bill documentation
http://killbill.io/api/#!/subscriptions/cancelEntitlementPlan
Retrieving a subscription by the id
The
operation retieves a single subscription by the id.getSubscriptionById
<killbill.getSubscriptionById> <subscriptionId>{$ctx:subscriptionId}</subscriptionId> </killbill.getSubscriptionById>
Properties
subscriptionId:
Sample request
Following is a sample REST/JSON request that can be handled by the getSubscriptionById
operation.
{ "apiUrl":"http://127.0.0.1:8080", "apiVersion":"1.0", "username":"admin", "password":"password", "apiKey":"bob", "apiSecret":"lazar", "subscriptionId": "33ca98be-2e86-4861-89df-31cd1f7207ef" }
Related Kill Bill documentation
http://killbill.io/api/#!/subscriptions/getEntitlement
Sample configuration
Following is a sample proxy service that illustrates how to connect to Kill Bill with the init
operation and use the createsubscription
operation. The sample request for this proxy can be found in the createsubscription sample request.
<proxy name="Kill Bill_createsubscription" startOnLoad="true" statistics="disable" trace="disable" transports="https,http" xmlns="http://ws.apache.org/ns/synapse"> <target> <inSequence onError="faultHandlerSeq"> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="apiKey" expression="json-eval($.apiKey)"/> <property name="format" expression="json-eval($.format)"/> <property name="text" expression="json-eval($.text)"/> <property name="storyId" expression="json-eval($.storyId)"/> <property name="projectId" expression="json-eval($.projectId)"/> <property name="enrichments" expression="json-eval($.enrichments)"/> <Kill Bill.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiKey>{$ctx:apiKey}</apiKey> <format>{$ctx:format}</format> <enrichments>{$ctx:enrichments}</enrichments> </Kill Bill.init> <Kill Bill.createsubscription> <text>{$ctx:text}</text> <storyId>{$ctx:storyId}</storyId> <projectId>{$ctx:projectId}</projectId> </Kill Bill.createsubscription> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>