Subscriptions

Permissions

Permission to view, create, edit and delete subscription information is governed by the group a staff member is a part of.


cb_deleteSubscription

Delete a subscription using the given subscription_id

Request

string $auth_string Your authentication token returned from cb_setAuthCredentials()
int $subscription_id The subscription_id of the subscription to be deleted

Response

No response is generated by this function call

cb_getSubscription

Retrieve information for a single subscription using a given subscription_id

Request

string $auth_string Your authentication token returned from cb_setAuthCredentials()
int $subscription_id The subscription_id of the subscription to be deleted

Response

Array
(
    [id] => 1
    [name_en] => Test Subscription
    [subtotal] => 9.95
    [tax_total] => 0
    [total] => 9.95
    [billing_type] => monthly
    [billing_period] => 1
    [trial_type] => 0
    [trial_period] => 0
    [trial_initial] => 0
    [num_active_periods] => 0
    [special_terms] => Subscription special terms
    [notes] => Subscription notes
)

cb_getSubscriptions

Retrieve an array of all subscriptions ordered by a given column.

Request

string $auth_string Your authentication token returned from cb_setAuthCredentials()
int $sort_column optional; The column to sort subscriptions on. The valid columns that can be used in this function are those returned by the cb_getSubscription() function.

Response

Array
(
    [0] => Array
    (
        [id] => 1
        [name_en] => Test Subscription
        [subtotal] => 9.95
        [tax_total] => 0
        [total] => 9.95
        [billing_type] => monthly
        [billing_period] => 1
        [trial_type] => 0
        [trial_period] => 0
        [trial_initial] => 0
        [num_active_periods] => 0
        [special_terms] => Subscription special terms
        [notes] => Subscription notes
    )
)

cb_exportSubscriptionsCSV

Returns subscription data for all subscriptions in a comma separated format. Entries in the returned string are separated by a newline character.

Request

string $auth_string Your authentication token returned from cb_setAuthCredentials()
int $detailed optional; Set what information is to be returned. By default all subscription data, including items, is returned. The valid options for this parameter are:
600 - Show all information, including items
601 - Show only basic information, items are not included
int $limit optional; Limit the number of results that are returned.
int $offset optional; By default Clientbill will start with subscription_id = 1. This paramater allows a different starting subscription_id to be used.

Response

1,Test Subscription,9.95,0,9.95,monthly,1,0,0,0,0,Subscription special terms,Subscription notes,1   1,1,1,Subscription Item #1,9.95,1,9.95,0,0,0

cb_exportSubscriptionsXML

Returns subscription data for all subscriptions in XML format.

Request

string $auth_string Your authentication token returned from cb_setAuthCredentials()
int $detailed optional; Set what information is to be returned. By default all subscription data, including items, is returned. The valid options for this parameter are:
600 - Show all information, including items
601 - Show only basic information, items are not included
int $limit optional; Limit the number of results that are returned.
int $offset optional; By default Clientbill will start with subscription_id = 1. This paramater allows a different starting subscription_id to be used.

Response

<?xml version="1.0" standalone="yes"?>
<cbExportData>
   <subscription>
      <id>1</id>
      <name_en>Subscription #1</name_en>
      <subtotal>9.95</subtotal>
      <tax_total>0</tax_total>
      <total>9.95</total>
      <billing_type>monthly</billing_type>
      <billing_period>1</billing_period>
      <trial_type>0</trial_type>
      <trial_period>0</trial_period>
      <trial_initial>0</trial_initial>
      <num_active_periods>0</num_active_periods>
      <special_terms>Subscription special terms</special_terms>
      <notes>Subscription notes</notes>
      <items>
         <item>
            <subscription_item_id>1</subscription_item_id>
            <subscription_id>1</subscription_id>
            <item_id>1</item_id>
            <description_en>Subscription Item #1</description_en>
            <cost>9.95</cost>
            <quantity>1</quantity>
            <price>9.95</price>
            <tax_item>0</tax_item>
            <tax>0</tax>
            <tax_amount>0</tax_amount>
         </item>
      </items>
   </subscription>
</cbExportData>