Bundle

A Bundle (also known as Subscription Bundle) is a collection of subscriptions. Grouping certain subscriptions into a bundle is useful to ensure that certain operations propagate to the group. A common example is cancellation. When cancelling a BASE subscription, which is part of a bundle, any ADD_ON subscriptions in the same bundle are also cancelled automatically.

A Bundle is automatically created by the system when creating the initial (BASE) subscription. To add additional subscriptions in the same bundle, one must specify the bundleId for the bundle previously created.

Bundle Resource

The Bundle resource represents a bundle. The attributes contained in this resource are the following:

Name Type Generated by Description
accountId string system UUID for the account
bundleId string system UUID for the bundle
externalKey string user Optional external key for the bundle
subscriptions array system List of subscriptions in the bundle
timeline array system List of events for the bundle.

subscriptions is a read-only array of subscription resources for the subscriptions in this bundle.

timeline is a read-only array of event resources for the events that have occurred for this bundle.

Bundle

These endpoints support the basic operations on bundles. There is no create operation, because a bundle is automatically created when a BASE subscription is created.

Retrieve a bundle by id

This API retrieves a bundle resource object based on its bundle Id.

HTTP Request

GET http://127.0.0.1:8080/1.0/kb/bundles/{bundleId}

Example Request:

curl -v \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Accept: application/json" \
    "http://127.0.0.1:8080/1.0/kb/bundles/2cd2f4b5-a1c0-42a7-924f-64c7b791332d"
import org.killbill.billing.client.api.gen.BundleApi;
protected BundleApi bundleApi;

UUID bundleId = UUID.fromString("90ec582a-5da8-49d5-a656-c63cbc9d30fd");

Bundle result = bundleApi.getBundle(bundleId, 
                                    AuditLevel.NONE, 
                                    requestOptions);
bundle_id = "5b7a5f2d-4054-412f-b354-b722c2cff4ec"

bundle = KillBillClient::Model::Bundle

bundle.find_by_id(bundle_id, options)
bundleApi = killbill.BundleApi()

bundle_id = 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691'

bundle = bundleApi.get_bundle(bundle_id)
const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);

const bundleId = 'd1067966-c34f-4e93-abf7-7285582e0691';

const bundle: AxiosResponse<killbill.Bundle> = await bundleApi.getBundle(bundleId);
$apiInstance = $client->getBundleApi();

$bundleId = '7f5b6b8e-0936-4d6b-ab05-820632f385b0';

$bundleResult = $apiInstance->getBundle($bundleId);

Example Response:

{
  "accountId": "2ad52f53-85ae-408a-9879-32a7e59dd03d",
  "bundleId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
  "externalKey": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
  "subscriptions": [
    {
      "accountId": "2ad52f53-85ae-408a-9879-32a7e59dd03d",
      "bundleId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
      "subscriptionId": "8ab101b6-15e8-433b-b4f7-f99eeaa56a77",
      "externalKey": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
      "startDate": "2018-07-18",
      "productName": "Standard",
      "productCategory": "BASE",
      "billingPeriod": "MONTHLY",
      "phaseType": "TRIAL",
      "priceList": "DEFAULT",
      "planName": "standard-monthly",
      "state": "ACTIVE",
      "sourceType": "NATIVE",
      "cancelledDate": null,
      "chargedThroughDate": null,
      "billingStartDate": "2018-07-18",
      "billingEndDate": null,
      "billCycleDayLocal": 17,
      "events": [
        {
          "eventId": "3961e5a4-815c-4e95-aca6-2f3e76c37942",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-07-18",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "START_ENTITLEMENT",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "entitlement-service",
          "serviceStateName": "ENT_STARTED",
          "phase": "standard-monthly-trial",
          "auditLogs": []
        },
        {
          "eventId": "8e7a6a7d-7660-49e3-979c-a4a0b6ec6804",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-07-18",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "START_BILLING",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "billing-service",
          "serviceStateName": "START_BILLING",
          "phase": "standard-monthly-trial",
          "auditLogs": []
        },
        {
          "eventId": "f058c95f-9a86-435b-8bba-4f8532635450",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-08-17",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "PHASE",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "entitlement+billing-service",
          "serviceStateName": "PHASE",
          "phase": "standard-monthly-evergreen",
          "auditLogs": []
        }
      ],
      "priceOverrides": null,
      "prices": [
        {
          "planName": "standard-monthly",
          "phaseName": "standard-monthly-trial",
          "phaseType": "TRIAL",
          "fixedPrice": 0,
          "recurringPrice": null,
          "usagePrices": []
        },
        {
          "planName": "standard-monthly",
          "phaseName": "standard-monthly-evergreen",
          "phaseType": "EVERGREEN",
          "fixedPrice": null,
          "recurringPrice": 100,
          "usagePrices": []
        }
      ],
      "auditLogs": []
    }
  ],
  "timeline": {
    "accountId": "2ad52f53-85ae-408a-9879-32a7e59dd03d",
    "bundleId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
    "externalKey": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
    "events": [
      {
        "eventId": "3961e5a4-815c-4e95-aca6-2f3e76c37942",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-07-18",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "START_ENTITLEMENT",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "entitlement-service",
        "serviceStateName": "ENT_STARTED",
        "phase": "standard-monthly-trial",
        "auditLogs": []
      },
      {
        "eventId": "8e7a6a7d-7660-49e3-979c-a4a0b6ec6804",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-07-18",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "START_BILLING",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "billing-service",
        "serviceStateName": "START_BILLING",
        "phase": "standard-monthly-trial",
        "auditLogs": []
      },
      {
        "eventId": "f058c95f-9a86-435b-8bba-4f8532635450",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-08-17",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "PHASE",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "entitlement+billing-service",
        "serviceStateName": "PHASE",
        "phase": "standard-monthly-evergreen",
        "auditLogs": []
      }
    ],
    "auditLogs": []
  },
  "auditLogs": []
}

Query Parameters

Name Type Required Default Description
audit string no "NONE" Level of audit information to return: "NONE", "MINIMAL" (only inserts), or "FULL"

Response

If successful, returns a status code of 200 and a bundle resource object.

Retrieve a bundle by external key

This API retrieves a bundle resource object based on its external key

HTTP Request

Retrieves the details information for the Bundle using its externalKey.

GET http://127.0.0.1:8080/1.0/kb/bundles?externalKey=<external_key>

Example Request:

curl -v \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Accept: application/json" \
    "http://127.0.0.1:8080/1.0/kb/bundles?externalKey=2cd2f4b5-a1c0-42a7-924f-64c7b791332d"
import org.killbill.billing.client.api.gen.BundleApi;
protected BundleApi bundleApi;

String externalKey = "93199";
Boolean includedDeleted = false; // Will not include deleted bundles

Bundles bundles = bundleApi.getBundleByKey(externalKey, 
                                           includedDeleted,
                                           AuditLevel.NONE,
                                           requestOptions);
external_key = '4b67f7d8-d7db-4e4f-b282-eb1cdf43a995-43135'
included_deleted = false

bundle = KillBillClient::Model::Bundle

bundle.find_by_external_key(external_key, 
                            included_deleted, 
                            options)
bundleApi = killbill.BundleApi()

bundle_external_key = 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691'

bundle = bundleApi.get_bundle_by_key(bundle_external_key)
const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);

const bundleKey = 'd1067966-c34f-4e93-abf7-7285582e0691';

const bundle: AxiosResponse<killbill.Bundle[]> = await bundleApi.getBundleByKey(bundleKey);
$apiInstance = $client->getBundleApi();

$bundleKey = 'bundleKey';

$bundleResult = $apiInstance->getBundleByKey($bundleKey);

Example Response:

{
  "accountId": "2ad52f53-85ae-408a-9879-32a7e59dd03d",
  "bundleId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
  "externalKey": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
  "subscriptions": [
    {
      "accountId": "2ad52f53-85ae-408a-9879-32a7e59dd03d",
      "bundleId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
      "subscriptionId": "8ab101b6-15e8-433b-b4f7-f99eeaa56a77",
      "externalKey": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
      "startDate": "2018-07-18",
      "productName": "Standard",
      "productCategory": "BASE",
      "billingPeriod": "MONTHLY",
      "phaseType": "TRIAL",
      "priceList": "DEFAULT",
      "planName": "standard-monthly",
      "state": "ACTIVE",
      "sourceType": "NATIVE",
      "cancelledDate": null,
      "chargedThroughDate": null,
      "billingStartDate": "2018-07-18",
      "billingEndDate": null,
      "billCycleDayLocal": 17,
      "events": [
        {
          "eventId": "3961e5a4-815c-4e95-aca6-2f3e76c37942",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-07-18",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "START_ENTITLEMENT",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "entitlement-service",
          "serviceStateName": "ENT_STARTED",
          "phase": "standard-monthly-trial",
          "auditLogs": []
        },
        {
          "eventId": "8e7a6a7d-7660-49e3-979c-a4a0b6ec6804",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-07-18",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "START_BILLING",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "billing-service",
          "serviceStateName": "START_BILLING",
          "phase": "standard-monthly-trial",
          "auditLogs": []
        },
        {
          "eventId": "f058c95f-9a86-435b-8bba-4f8532635450",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-08-17",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "PHASE",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "entitlement+billing-service",
          "serviceStateName": "PHASE",
          "phase": "standard-monthly-evergreen",
          "auditLogs": []
        }
      ],
      "priceOverrides": null,
      "prices": [
        {
          "planName": "standard-monthly",
          "phaseName": "standard-monthly-trial",
          "phaseType": "TRIAL",
          "fixedPrice": 0,
          "recurringPrice": null,
          "usagePrices": []
        },
        {
          "planName": "standard-monthly",
          "phaseName": "standard-monthly-evergreen",
          "phaseType": "EVERGREEN",
          "fixedPrice": null,
          "recurringPrice": 100,
          "usagePrices": []
        }
        ],
        "auditLogs": []
      }
    ],
    "timeline": {
      "accountId": "2ad52f53-85ae-408a-9879-32a7e59dd03d",
      "bundleId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
      "externalKey": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
      "events": [
      {
        "eventId": "3961e5a4-815c-4e95-aca6-2f3e76c37942",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-07-18",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "START_ENTITLEMENT",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "entitlement-service",
        "serviceStateName": "ENT_STARTED",
        "phase": "standard-monthly-trial",
        "auditLogs": []
      },
      {
        "eventId": "8e7a6a7d-7660-49e3-979c-a4a0b6ec6804",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-07-18",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "START_BILLING",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "billing-service",
        "serviceStateName": "START_BILLING",
        "phase": "standard-monthly-trial",
        "auditLogs": []
      },
      {
        "eventId": "f058c95f-9a86-435b-8bba-4f8532635450",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-08-17",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "PHASE",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "entitlement+billing-service",
        "serviceStateName": "PHASE",
        "phase": "standard-monthly-evergreen",
        "auditLogs": []
      }
    ],
    "auditLogs": []
  },
  "auditLogs": []
}

Query Parameters

Name Type Required Default Description
externalKey String yes none The subscription external key
includedDeleted boolean no false If true, include deleted bundles
audit string no "NONE" Level of audit information to return: "NONE", "MINIMAL" (only inserts), or "FULL"

Response

If successful, returns a status code of 200 and a bundle resource object.

Update a bundle external key

THis API sets a new external key for a bundle

HTTP Request

PUT http://127.0.0.1:8080/1.0/kb/bundles/{bundleId}/renameKey

Example Request:

curl -v \
    -X PUT \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-Killbill-CreatedBy: demo" \
    -H "X-Killbill-Reason: demo" \
    -H "X-Killbill-Comment: demo" \
    -d '{ "bundleId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d", "externalKey": "another_external_key"}' \
    "http://127.0.0.1:8080/1.0/kb/bundles/2cd2f4b5-a1c0-42a7-924f-64c7b791332d/renameKey"
String externalKey = "another_external_key";
Bundle bundle = new Bundle();
bundle.setExternalKey(externalKey);
bundleApi.renameExternalKey(bundleId, bundle, requestOptions);
user = 'user'
reason = 'reason'
comment = 'comment'

bundle = KillBillClient::Model::Bundle.new

bundle.bundle_id = 'ffde26ed-cd17-478e-95f8-ddfb908941ee'
bundle.external_key = "new_external_key"

bundle.rename_external_key(user, 
                           reason, 
                           comment, 
                           options)
bundleApi = killbill.BundleApi()

bundleID = 'd65d22aa-483e-45fb-9335-cb6636514479'

body = Bundle(bundle_id=bundleID,
              external_key='new_external_key')

bundleApi.rename_external_key(bundleID,
                              body,
                              created_by='demo',
                              reason='reason', 
                              comment='comment')
const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);

const bundleBody: killbill.Bundle = {
      accountId: 'd869f861-0c60-4086-a3fc-49ad855d48c0',
      externalKey: 'newExternalKey2'
    };

const bundleID = 'd1067966-c34f-4e93-abf7-7285582e0691';

bundleApi.renameExternalKey(bundleBody, bundleID, 'created_by');
$apiInstance = $client->getBundleApi();

$xKillbillCreatedBy = "user";
$xKillbillReason = "reason";
$xKillbillComment = "comment";

$bundleBody = new Bundle();

$bundleBody->setAccountId('5371f0c8-b39c-4e30-84ec-cc8029ba0670');
$bundleBody->setExternalKey('externalKeyModified');

$bundleId = 'c3a1547d-afe4-4bbf-9fe2-8943eaa176d9';

$apiInstance->renameExternalKey($bundleBody,
                                $xKillbillCreatedBy,
                                $bundleId,
                                $xKillbillReason,
                                $xKillbillComment);

Request Body

A bundle resource containing the new external key

Query Parameters

None.

Response

If successful, returns a status code of 204 and an empty body.

Transfer

Transfer a bundle to another account.

Transfer a bundle to another account

This API "transfers" a bundle to another existing account. This is carried out as follows:

  1. A new bundle is created in the destination account. The new bundle is assigned a new id but receives the same external key from the original bundle.

  2. All subscriptions in the original bundle are copied to the new bundle. The sourceType of these subscriptions is set to TRANSFERRED.

  3. All subscriptions in the original bundle are marked cancelled as of the transfer date but are not deleted. Billing is terminated on the transfer date or later according to the billing policy.

  4. The subscriptions in the new bundle are assigned a start date as of the time of transfer, and inherit all of the terms and remaining dates from the original subscription.

HTTP Request

POST http://127.0.0.1:8080/1.0/kb/bundles/{bundleId}

Example Request:

curl -v \
    -X POST \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-Killbill-CreatedBy: demo" \
    -H "X-Killbill-Reason: demo" \
    -H "X-Killbill-Comment: demo" \
    -d '{ "accountId": "8785164f-b5d7-4da1-9495-33f5105e8d80", "bundleId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d"}' \
    "http://127.0.0.1:8080/1.0/kb/bundles/2cd2f4b5-a1c0-42a7-924f-64c7b791332d"
import org.killbill.billing.client.api.gen.BundleApi;
protected BundleApi bundleApi;

UUID bundleId = UUID.fromString("b84a8af9-73d4-4749-8d81-38dbcc2d7fb1");
UUID accountId = UUID.fromString("d82d3638-fca7-4c16-9e68-8f8db75997cc");

Bundle bundle = new Bundle();
bundle.setAccountId(accountId);
bundle.setBundleId(bundleId);

LocalDate requestedDate = null;
Map<String, String> NULL_PLUGIN_PROPERTIES = null;
BillingActionPolicy billingPolicy = null;

Bundle result = bundleApi.transferBundle(bundleId, 
                                         bundle, 
                                         requestedDate, 
                                         billingPolicy,
                                         NULL_PLUGIN_PROPERTIES, 
                                         requestOptions);
user = 'user'
reason = 'reason'
comment = 'comment'

requested_date = "2023-08-01"
billing_policy = "END_OF_TERM"

bundle = KillBillClient::Model::Bundle.new

bundle.account_id = 'e2d81f64-2268-4e71-843b-1d14f0fc5259'
bundle.bundle_id = 'ffde26ed-cd17-478e-95f8-ddfb908941ee'

bundle.transfer(requested_date, 
                billing_policy, 
                user, 
                reason, 
                comment, 
                options)
bundleApi = killbill.BundleApi()

bundle_id = 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691'
new_account_id = '71499886-296d-4b0f-8b76-0eed352d8801'

body = Bundle(bundle_id=bundle_id, account_id=new_account_id)

bundleApi.transfer_bundle(bundle_id, 
                          body, 
                          created_by='demo',
                          reason='reason', 
                          comment='comment')
const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);

const bundleBody: killbill.Bundle = {accountId: '3e5e2f75-728f-4fc4-a8fc-066e7420bd69'};

const bundleID = 'd1067966-c34f-4e93-abf7-7285582e0691';

bundleApi.transferBundle(bundleBody, bundleID, 'created_by');
$apiInstance = $client->getBundleApi();

$xKillbillCreatedBy = "user";
$xKillbillReason = "reason";
$xKillbillComment = "comment";

$bundleBody = new Bundle();

$bundleBody->setAccountId('3d7449fa-0ac8-4081-84a1-87d4371802e1');

$bundleId = 'f339d676-9afa-42f3-acc6-c155677d80a6';

$apiInstance->transferBundle($bundleBody,
                             $xKillbillCreatedBy,
                             $bundleId,
                             $xKillbillReason,
                             $xKillbillComment);

Request Body

A bundle resource containing at least the new account id

Query Parameters

Name Type Required Default Description
requestedDate string no current date Requested date for the transfer of the bundle
billingPolicy string no END_OF_TERM When billing for target account should occur. Accepted values are END_OF_TERM or IMMEDIATE
bcdTransfer string no USE_EXISTING Specifies how the per subscription BCD should be transferred. Accepted values are NONE, USE_EXISTING and ALIGN_WITH_EFF_DT. See notes below
pluginProperty array of strings no omit list of plugin properties, if any

Possible values for the bcdTransfer parameter are as explained below: * NONE: Does not transfer per-subscription BCD * USE_EXISTING: Transfer existing per-subscription BCD if exists * ALIGN_WITH_EFF_DT: Set per-subscription BCD to align with the day of the transfer effective date

Response

If successful, returns a status code of 201. In addition, a Location header containing the bundleId in the target account is returned.

Blocking State

See section Account Blocking State for an introduction.

Pause a bundle

Provides a simple interface to pause both billing and entitlement for all subscriptions in a bundle. The state attribute in the bundle resource is set to ENT_BLOCKED.

HTTP Request

PUT http://127.0.0.1:8080/1.0/kb/bundles/{bundleId}/pause

Example Request:

  curl -X PUT \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-Killbill-CreatedBy: demo" \
    -H "X-Killbill-Reason: demo" \
    -H "X-Killbill-Comment: demo" \
    "http://127.0.0.1:8080/1.0/kb/bundles/2cd2f4b5-a1c0-42a7-924f-64c7b791332d/pause" \
UUID bundleId = UUID.fromString("96a2ba35-de50-4db9-98bb-938cf1e5f616");
LoalDate requestedDate = null;
Map<String, String> pluginProperty = null;
bundleApi.pauseBundle(bundleId, requestedDate, pluginProperty, requestOptions);
user = 'user'
reason = 'reason'
comment = 'comment'

bundle = KillBillClient::Model::Bundle.new

bundle.bundle_id = 'ea82c581-4bbc-4f2b-8d5a-31a91e9df78b'
requested_date = "2023-08-01"

bundle.pause(requested_date, 
             user, 
             reason, 
             comment, 
             options)
bundleApi = killbill.BundleApi()

bundle_id = 'ce967207-851c-4040-bfbd-74a8924f9b8a'

bundleApi.pause_bundle(bundle_id, 
                       created_by='demo',
                       reason='reason', 
                       comment='comment')
const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);

const bundleID = '7f5b6b8e-0936-4d6b-ab05-820632f385b0';

bundleApi.pauseBundle(bundleID, 'created_by');
$apiInstance = $client->getBundleApi();

$xKillbillCreatedBy = "user";

$bundleId = 'fb1ac07b-c132-4eeb-84d8-95228e3fbd9e';

$apiInstance->pauseBundle($bundleId,$xKillbillCreatedBy);

Query Parameters

Name Type Required Default Description
requestedDate string no current date requested date for pausing
pluginProperty array of strings false empty list List of plugin properties, if any

Response

If successful, returns a status code of 204 and an empty body.

Resume a bundle

Provides a simple interface to resume both billing and entitlement for all subscriptions in the bundle. The state of the bundle resource is set to ENT_CLEAR.

HTTP Request

PUT http://127.0.0.1:8080/1.0/kb/bundles/{bundleId}/resume

Example Request:

curl -v \
    -X PUT \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-Killbill-CreatedBy: demo" \
    -H "X-Killbill-Reason: demo" \
    -H "X-Killbill-Comment: demo" \
    "http://127.0.0.1:8080/1.0/kb/bundles/2cd2f4b5-a1c0-42a7-924f-64c7b791332d/resume"
UUID bundleId = UUID.fromString("96a2ba35-de50-4db9-98bb-938cf1e5f616");
LocalDate requestedDate = null;
Map<String, String> pluginProperty = null;
bundleApi.resumeBundle(bundleId, requestedDate, pluginProperty, requestOptions);    
user = 'user'
reason = 'reason'
comment = 'comment'

bundle = KillBillClient::Model::Bundle.new

bundle.bundle_id = 'ea82c581-4bbc-4f2b-8d5a-31a91e9df78b'
requested_date = "2023-08-01"

bundle.resume(requested_date, 
              user, 
              reason, 
              comment, 
              options)
bundleApi = killbill.BundleApi()

bundle_id = 'ce967207-851c-4040-bfbd-74a8924f9b8a'

bundleApi.resume_bundle(bundle_id, 
                        created_by='demo',
                        reason='reason', 
                        comment='comment')
const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);

const bundleID = 'd1067966-c34f-4e93-abf7-7285582e0691'; 

bundleApi.resumeBundle(bundleID, 'created_by');
$apiInstance = $client->getBundleApi();

$xKillbillCreatedBy = "user";

$bundleId = 'fb1ac07b-c132-4eeb-84d8-95228e3fbd9e';

$apiInstance->resumeBundle($bundleId,$xKillbillCreatedBy);

Query Parameters

Name Type Required Default Description
requestedDate string no current date requested date to resume
pluginProperty array of strings false empty list List of plugin properties, if any

Response

If successful, returns a status code of 204 and an empty body.

Block a bundle

Provides a low level interface to add a BlockingState event for this bundle. Note that the previous pause and resume operations can be achieved using this API.

HTTP Request

POST http://127.0.0.1:8080/1.0/kb/bundles/{bundleId}/block

Example Request:

curl -v \
    -X POST \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-Killbill-CreatedBy: demo" \
    -H "X-Killbill-Reason: demo" \
    -H "X-Killbill-Comment: demo" \
    -d '{ "stateName": "STATE1", "service": "ServiceStateService", "isBlockChange": false, "isBlockEntitlement": false, "isBlockBilling": false, "effectiveDate": "2018-07-17T21:17:28.842Z", "type": "SUBSCRIPTION" }' \
    "http://127.0.0.1:8080/1.0/kb/bundles/2cd2f4b5-a1c0-42a7-924f-64c7b791332d/block"
import org.killbill.billing.client.api.gen.BundleApi;
protected BundleApi bundleApi;

UUID bundleId = UUID.fromString("b84a8af9-73d4-4749-8d81-38dbcc2d7fb1");

String stateName = "block";
String service = "service";
Boolean isBlockChange = false;
Boolean isBlockEntitlement = true;
Boolean isBlockBilling = true;
DateTime effectiveDate = null;
List<AuditLog> auditLogs = null;

BlockingState blockingState = new BlockingState(bundleId, 
                                                stateName, 
                                                service, 
                                                isBlockChange, 
                                                isBlockEntitlement, 
                                                isBlockBilling, 
                                                effectiveDate, 
                                                BlockingStateType.SUBSCRIPTION_BUNDLE, 
                                                auditLogs);

LocalDate requestedDate = clock.getToday(DateTimeZone.forID(account.getTimeZone()));
Map<String, String> pluginProperty = Collections.emptyMap();

bundleApi.addBundleBlockingState(bundleId, 
                                 blockingState, 
                                 requestedDate, 
                                 pluginProperty, 
                                 requestOptions);
user = 'user'
reason = 'reason'
comment = 'comment'

state_name = "STATE1"
service = "ServiceStateService"
block_change = false
block_entitlement = false
block_billing = false
requested_date = "2013-08-01"

bundle = KillBillClient::Model::Bundle.new

bundle.account_id = '68b0fe70-8b14-42e0-b204-a56e9945d8e5'
bundle.bundle_id = 'efaebe7a-8eaa-4550-96ea-a9235d3df46c'

bundle.set_blocking_state(state_name,
                          service,
                          block_change, 
                          block_entitlement,
                          block_billing, 
                          requested_date,
                          user, 
                          reason, 
                          comment,
                          options)
bundleApi = killbill.BundleApi()

bundle_id = 'a760fdc8-1e2d-4020-918a-6e4f7a9cd691'

body = BlockingState(state_name='STATE1', 
                     service='ServiceStateService', 
                     is_block_change=False, 
                     is_block_entitlement=False, 
                     is_block_billing=False)

bundleApi.add_bundle_blocking_state(bundle_id,
                                    body,
                                    created_by='demo',
                                    reason='reason', 
                                    comment='comment')
const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);

const blockingState: killbill.BlockingState = {
                                                blockedId: '5371f0c8-b39c-4e30-84ec-cc8029ba0670',
                                                service: 'Billing',
                                                stateName: 'Acct_resumed',
                                                isBlockChange: false,
                                                isBlockEntitlement: false,
                                                isBlockBilling: false
                                              };

const bundleID = '7f5b6b8e-0936-4d6b-ab05-820632f385b0';

bundleApi.addBundleBlockingState(blockingState, bundleID, 'created_by');
$apiInstance = $client->getBundleApi();

$xKillbillCreatedBy = "user";

$blockingState = new BlockingState();

$blockingState->setBlockedId('3d7449fa-0ac8-4081-84a1-87d4371802e1');
$blockingState->setService('Billing');
$blockingState->setStateName('Acct_Paused');
$blockingState->setIsBlockBilling(true);
$blockingState->setIsBlockEntitlement(true);
$blockingState->setIsBlockChange(true);

$bundleId = 'fb1ac07b-c132-4eeb-84d8-95228e3fbd9e';

$apiInstance->addBundleBlockingState($blockingState,$xKillbillCreatedBy,$bundleId);

Request Body

A blocking state resource representing the intended new blocking state. For example,

{ "blockedId": "943c4fd0-9000-4975-a3a8-09712223e1f8",
"stateName": "STATE1",
"service": "ServiceStateService",
"isBlockChange": false,
"isBlockEntitlement": false,
"isBlockBilling": true, "effectiveDate": "2020-07-18T18:22:30.376Z", "type": "SUBSCRIPTION_BUNDLE" }

Query Parameters

Name Type Required Default Description
requestedDate string no immediate requested date for blocking
pluginProperty array of strings false empty list List of plugin properties, if any

Response

If successful, returns a status code of 201 and an empty body.

Custom Fields

Custom fields are {key, value} attributes that can be attached to any customer resources. For more on custom fields see Custom Fields. These endpoints manage custom fields associated with Bundle objects.

Add custom fields to bundle

Adds one or more custom fields to a subscription object. Existing custom fields are not disturbed.

HTTP Request

POST http://127.0.0.1:8080/1.0/kb/bundles/{bundleId}/customFields

Example Request:

curl -v \
    -X POST \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-Killbill-CreatedBy: demo" \
    -H "X-Killbill-Reason: demo" \
    -H "X-Killbill-Comment: demo" \
    -d '[ { "objectType": "BUNDLE", "name": "Test Custom Field", "value": "demo_test_value" }]' \
    "http://127.0.0.1:8080/1.0/kb/bundles/2cd2f4b5-a1c0-42a7-924f-64c7b791332d/customFields"
import org.killbill.billing.client.api.gen.BundleApi;
protected BundleApi bundleApi;

UUID bundleId = UUID.fromString("b84a8af9-73d4-4749-8d81-38dbcc2d7fb1");
final List<AuditLog> EMPTY_AUDIT_LOGS = Collections.emptyList();

CustomFields customFields = new CustomFields();
customFields.add(new CustomField(null, 
                                 bundleId, 
                                 ObjectType.BUNDLE, 
                                 "Test Custom Field", 
                                 "test_value", 
                                 EMPTY_AUDIT_LOGS));

bundleApi.createBundleCustomFields(bundleId, 
                                   customFields, 
                                   requestOptions);
user = 'user'
reason = 'reason'
comment = 'comment'

bundle = KillBillClient::Model::Bundle.new
bundle.bundle_id = 'efaebe7a-8eaa-4550-96ea-a9235d3df46c'

custom_field = KillBillClient::Model::CustomFieldAttributes.new
custom_field.object_type = 'BUNDLE'
custom_field.name = 'Test Custom Field'
custom_field.value = 'test_value'

bundle.add_custom_field(custom_field, 
                        user,
                        reason,
                        comment,
                        options)
bundleApi = killbill.BundleApi()

body = CustomField(name='Test Custom Field', value='test_value')

bundleApi.create_bundle_custom_fields(bundle_id,
                                      [body],
                                      created_by='demo',
                                      reason='reason', 
                                      comment='comment')
const customFields: killbill.CustomField = {name: 'Test Custom Field',value: 'test_value'};

const customFieldsBody = [customFields];

const bundleID = '7f5b6b8e-0936-4d6b-ab05-820632f385b0';

bundleApi.createBundleCustomFields(customFieldsBody, bundleID, 'created_by');
$apiInstance = $client->getBundleApi();

$xKillbillCreatedBy = "user";
$xKillbillReason = "reason";
$xKillbillComment = "comment";

$customField = new CustomField();

$customField->setName('CustomFieldName');
$customField->setValue('CustomFieldValue');

$customFieldBody = [$customField];

$bundleId = 'fb1ac07b-c132-4eeb-84d8-95228e3fbd9e';

$apiInstance->createBundleCustomFields($customFieldBody,
                                       $xKillbillCreatedBy,
                                       $bundleId,
                                       $xKillbillReason,
                                       $xKillbillComment);

Request Body

A list of objects giving the name and value of the custom field, or fields, to be added. For example:

[ { "name": "CF1", "value": "123" } ]

Query Parameters

None.

Response

If successful, returns a 201 status code. In addition, a Location header is returned giving the URL to retrieve the custom fields associated with the bundle.

Retrieve bundle custom fields

Retrieves any custom field objects associated with the specified bundle

HTTP Request

GET http://127.0.0.1:8080/1.0/kb/bundles/{bundleId}/customFields

Example Request:

curl -v \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Accept: application/json" \
    "http://127.0.0.1:8080/1.0/kb/bundles/2cd2f4b5-a1c0-42a7-924f-64c7b791332d/customFields"
import org.killbill.billing.client.api.gen.BundleApi;
protected BundleApi bundleApi;

UUID bundleId = UUID.fromString("59860a0d-c032-456d-a35e-3a48fe8579e5");

List<CustomField> bundleCustomFields = bundleApi.getBundleCustomFields(bundleId,
                                                                       AuditLevel.NONE,
                                                                       requestOptions);
audit = 'NONE'

bundle = KillBillClient::Model::Bundle.new

bundle.bundle_id = 'efaebe7a-8eaa-4550-96ea-a9235d3df46c'

bundleCustomFields = bundle.custom_fields(audit, options)
bundleApi = killbill.BundleApi()

bundle_id = 'ce967207-851c-4040-bfbd-74a8924f9b8a'

bundleCustomFields = bundleApi.get_bundle_custom_fields(bundle_id)
const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);

const bundleID = '7f5b6b8e-0936-4d6b-ab05-820632f385b0';

const bundleCustomFields: AxiosResponse<killbill.CustomField[]> =
      await bundleApi.getBundleCustomFields(bundleID);
$apiInstance = $client->getBundleApi();

$bundleId = 'fb1ac07b-c132-4eeb-84d8-95228e3fbd9e';

$bundleCustomFields = $apiInstance->getBundleCustomFields($bundleId);

Example Response:

{
  "customFieldId": "349de10f-4bb1-4e1a-93f6-11b745200bf5",
  "objectId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
  "objectType": "BUNDLE",
  "name": "Test Custom Field",
  "value": "demo_test_value",
  "auditLogs": []
}

Query Parameters

Name Type Required Default Description
audit string no "NONE" Level of audit information to return:"NONE", "MINIMAL", or "FULL"

Response

If successful, returns a status code of 200 and a (possibly empty) list of custom field objects.

Modify custom fields for a bundle

Modifies the value of one or more existing custom fields associated with a bundle

HTTP Request

PUT http://127.0.0.1:8080/1.0/kb/bundles/{bundleId}/customFields

Example Request:

curl -v \
    -X PUT \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-Killbill-CreatedBy: demo" \
    -H "X-Killbill-Reason: demo" \
    -H "X-Killbill-Comment: demo" \
    -d '[ { "customFieldId": "349de10f-4bb1-4e1a-93f6-11b745200bf5", "objectId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d", "objectType": "BUNDLE", "name": "Test Custom Field", "value": "test_modify_value", "auditLogs": [] }]' \
    "http://127.0.0.1:8080/1.0/kb/bundles/2cd2f4b5-a1c0-42a7-924f-64c7b791332d/customFields"
import org.killbill.billing.client.api.gen.BundleApi;
protected BundleApi bundleApi;

UUID bundleId = UUID.fromString("59860a0d-c032-456d-a35e-3a48fe8579e5");
UUID customFieldsId = UUID.fromString("9913e0f6-b5ef-498b-ac47-60e1626eba8f");

CustomField customFieldModified = new CustomField();
customFieldModified.setCustomFieldId(customFieldsId);
customFieldModified.setValue("NewValue");
CustomFields customFields = new CustomFields();
customFields.add(customFieldModified);
bundleApi.modifyBundleCustomFields(bundleId, 
                                   customFields, 
                                   requestOptions);
user = 'user'
reason = 'reason'
comment = 'comment'

custom_field.custom_field_id = '7fb3dde7-0911-4477-99e3-69d142509bb9'
custom_field.value = 'test_modify_value'

bundle = KillBillClient::Model::Bundle.new
bundle.bundle_id = 'efaebe7a-8eaa-4550-96ea-a9235d3df46c'

bundle.modify_custom_field(custom_field,
                           user, 
                           reason,
                           comment, 
                           options)
bundleApi = killbill.BundleApi()

custom_field_id = 'f3e2dc9d-1222-48ae-8658-35dd0acb53cd'
bundle_id = '424475ed-3fda-4a8c-9dfd-dacc80a06242'

body = Killbill.CustomField(custom_field_id=custom_field_id,                   
                            value='test_value_modified')

bundleApi.modify_bundle_custom_fields(bundle_id, 
                                      [body], 
                                      created_by='demo',
                                      reason='reason', 
                                      comment='comment')
const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);

const customField: killbill.CustomField = { customFieldId: '859a4053-4946-4be0-b94b-fe7a9409d785',
                                            value: 'custom-field-value-change'
                                          };

const customFieldBody = [customField];
const bundleID = '7f5b6b8e-0936-4d6b-ab05-820632f385b0';

bundleApi.modifyBundleCustomFields(customFieldBody, bundleID, 'created_by');
$apiInstance = $client->getBundleApi();

$xKillbillCreatedBy = "user";
$xKillbillReason = "reason";
$xKillbillComment = "comment";

$customField = new CustomField();

$customField->setCustomFieldId('ea5cf813-b420-4409-acd5-0b4ae83ea907');
$customField->setValue('CustomFieldValueChange');

$customFieldBody = [$customField];

$bundleId = 'fb1ac07b-c132-4eeb-84d8-95228e3fbd9e';

$apiInstance->modifyBundleCustomFields($customFieldBody,
                                       $xKillbillCreatedBy,
                                       $bundleId,
                                       $xKillbillReason,
                                       $xKillbillComment);

Request Body

A list of objects specifying the id and the new value for the custom fields to be modified. For example:

[ { "customFieldId": "6d4c073b-fd89-4e39-9802-eba65f42492f", "value": "123" } ]

Although the fieldName and objectType can be specified in the request body, these cannot be modified, only the field value can be modified.

Query Parameters

None.

Response

If successful, returns a status code of 204 and an empty body.

Remove custom fields from bundle

Delete one or more custom fields from a bundle

HTTP Request

DELETE http://127.0.0.1:8080/1.0/kb/bundles/{bundleId}/customFields

Example Request:

curl -v \
    -X DELETE \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "X-Killbill-CreatedBy: demo" \
    -H "X-Killbill-Reason: demo" \
    -H "X-Killbill-Comment: demo" \
    "http://127.0.0.1:8080/1.0/kb/bundles/2cd2f4b5-a1c0-42a7-924f-64c7b791332d/customFields?customField=349de10f-4bb1-4e1a-93f6-11b745200bf5"
import org.killbill.billing.client.api.gen.BundleApi;
protected BundleApi bundleApi;

UUID bundleId = UUID.fromString("59860a0d-c032-456d-a35e-3a48fe8579e5");
UUID customFieldsId = UUID.fromString("9913e0f6-b5ef-498b-ac47-60e1626eba8f");
List<UUID> customFieldsList = List.of(customFieldsId);
bundleApi.deleteBundleCustomFields(bundleId, 
                                   customFieldsList, 
                                   requestOptions);
user = 'user'
reason = 'reason'
comment = 'comment'

custom_field_id = 'a0535196-6f4f-46ca-8d63-e393460b1b42'

bundle.remove_custom_field(custom_field_id, 
                           user, 
                           reason,
                           comment, 
                           options)
bundleApi = killbill.BundleApi()

bundleId = 'ce967207-851c-4040-bfbd-74a8924f9b8a' 
customFieldIds = ['859a4053-4946-4be0-b94b-fe7a9409d785']

bundleApi.delete_bundle_custom_fields(bundleId, 
                                      custom_field = customFieldIds,
                                      created_by='demo',
                                      reason='reason', 
                                      comment='comment')
const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);

const customFieldIDs = ['859a4053-4946-4be0-b94b-fe7a9409d785'];
const bundleID = '7f5b6b8e-0936-4d6b-ab05-820632f385b0';

bundleApi.deleteBundleCustomFields(bundleID, 'created_by', customFieldIDs);
$apiInstance = $client->getBundleApi();

$xKillbillCreatedBy = "user";

$bundleId = 'fb1ac07b-c132-4eeb-84d8-95228e3fbd9e';

$apiInstance->deleteBundleCustomFields($bundleId,$xKillbillCreatedBy);

Query Parameters

Name Type Required Default Description
customField string yes none Custom field object ID that should be deleted. Multiple custom fields can be deleted by specifying a separate customField parameter corresponding to each field

Response

If successful, returns a status code of 204 and an empty body.

Tags

See section Account Tags for an introduction.

The are no system tags applicable for a Bundle.

Let's assume there is an existing user tagDefintion already created with tagDefinitionId=353752dd-9041-4450-b782-a8bb03a923c8.

Add tags to bundle

This API adds one or more tags to a subscription bundle. The tag definitions must already exist.

HTTP Request

POST http://127.0.0.1:8080/1.0/kb/bundles/{bundleId}/tags

Example Request:

curl -v \
    -X POST \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-Killbill-CreatedBy: demo" \
    -H "X-Killbill-Reason: demo" \
    -H "X-Killbill-Comment: demo" \
    -d '[ "353752dd-9041-4450-b782-a8bb03a923c8"]' \
    "http://127.0.0.1:8080/1.0/kb/bundles/2cd2f4b5-a1c0-42a7-924f-64c7b791332d/tags"
import org.killbill.billing.client.api.gen.BundleApi;
protected BundleApi bundleApi;

UUID bundleId = UUID.fromString("917992d3-5f1f-4828-9fff-799cc4211aa9");

UUID tagDefinitionId = UUID.fromString("353752dd-9041-4450-b782-a8bb03a923c8");

Tags result = bundleApi.createBundleTags(bundleId, 
                                         List.of(tagDefinitionId), 
                                         requestOptions);
user = 'user'
reason = 'reason'
comment = 'comment'

tag_name = 'bundletesttag'

bundle.add_tag(tag_name,
               user,
               reason,
               comment,
               options)
bundleApi = killbill.BundleApi()

bundle_id = '28af3cb9-275b-4ac4-a55d-a0536e479069'
tags = ["353752dd-9041-4450-b782-a8bb03a923c8"]

bundleApi.create_bundle_tags(bundle_id, 
                             tags, 
                             created_by='demo',
                             reason='reason', 
                             comment='comment')
const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);

const bundleTags = ['acc26862-875e-4b24-990e-985d3f837862'];
const bundleID = '7f5b6b8e-0936-4d6b-ab05-820632f385b0';

bundleApi.createBundleTags(bundleTags, bundleID, 'created_by');
$apiInstance = $client->getBundleApi();

$xKillbillCreatedBy = "user";
$xKillbillReason = "reason";
$xKillbillComment = "comment";

$bundleTags = ['acc26862-875e-4b24-990e-985d3f837862'];

$bundleId = 'fb1ac07b-c132-4eeb-84d8-95228e3fbd9e';

$apiInstance->createBundleTags($bundleTags,
                               $xKillbillCreatedBy,
                               $bundleId,
                               $xKillbillReason,
                               $xKillbillComment);

Request Body

A JSON array containing one or more strings giving the UUID of tag definitions for the user tags to be added.

Query Parameters

None.

Returns

If successful, returns a 201 status code. In addition, a Location header is returned giving the URL to retrieve the tags associated with the bundle.

Retrieve bundle tags

Retrieve all tags attached to this bundle.

HTTP Request

GET http://127.0.0.1:8080/1.0/kb/bundles/{bundleId}/tags

Example Request:

curl -v \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Accept: application/json" \
    "http://127.0.0.1:8080/1.0/kb/bundles/2cd2f4b5-a1c0-42a7-924f-64c7b791332d/tags"
import org.killbill.billing.client.api.gen.BundleApi;
protected BundleApi bundleApi;

UUID bundleId = UUID.fromString("917992d3-5f1f-4828-9fff-799cc4211aa9");
Boolean includedDeleted = false; // Will not include deleted tags

List<Tag> tags1 = bundleApi.getBundleTags(bundleId, 
                                          includedDeleted, 
                                          AuditLevel.FULL, 
                                          requestOptions);
included_deleted = false
audit = 'NONE'

bundle = KillBillClient::Model::Bundle.new

bundle.bundle_id = 'efaebe7a-8eaa-4550-96ea-a9235d3df46c'

bundleTags = bundle.tags(included_deleted,
                         audit,
                         options)
bundleApi = killbill.BundleApi()

bundle_id = '28af3cb9-275b-4ac4-a55d-a0536e479069'

bundleTags = bundleApi.get_bundle_tags(bundle_id)
const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);

const bundleID = '7f5b6b8e-0936-4d6b-ab05-820632f385b0';

const bundletags: AxiosResponse<any> = await bundleApi.getBundleTags(bundleID);
$apiInstance = $client->getBundleApi();

$bundleId = 'fb1ac07b-c132-4eeb-84d8-95228e3fbd9e';

$bundleTags = $apiInstance->getBundleTags($bundleId);

Example Response:

{
  "tagId": "e054c84a-0518-4611-92a8-53e849f0affd",
  "objectType": "BUNDLE",
  "objectId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
  "tagDefinitionId": "353752dd-9041-4450-b782-a8bb03a923c8",
  "tagDefinitionName": "foo",
  "auditLogs": []
}

Query Parameters

Name Type Required Default Description
includedDeleted boolean no false If true, include deleted tags
audit string no "NONE" Level of audit information to return: "NONE", "MINIMAL", or "FULL"

Response

If successful, returns a status code of 200 and a list of tag objects.

Remove tags from bundle

This API removes a list of tags attached to a bundle.

HTTP Request

DELETE http://127.0.0.1:8080/1.0/kb/bundles/{bundleId}/tags

Example Request:

curl -v \
    -X DELETE \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "X-Killbill-CreatedBy: demo" \
    -H "X-Killbill-Reason: demo" \
    -H "X-Killbill-Comment: demo" \
    "http://127.0.0.1:8080/1.0/kb/bundles/2cd2f4b5-a1c0-42a7-924f-64c7b791332d/tags?tagDef=353752dd-9041-4450-b782-a8bb03a923c8"
import org.killbill.billing.client.api.gen.BundleApi;
protected BundleApi bundleApi;

UUID bundleId = UUID.fromString("917992d3-5f1f-4828-9fff-799cc4211aa9");

UUID tagDefinitionId = UUID.fromString("353752dd-9041-4450-b782-a8bb03a923c8");

bundleApi.deleteBundleTags(bundleId, 
                           List.of(tagDefinitionId), 
                           requestOptions);
user = 'user'
reason = 'reason'
comment = 'comment'

tag_name = 'bundletesttag'

bundle = KillBillClient::Model::Bundle.new

bundle.bundle_id = 'efaebe7a-8eaa-4550-96ea-a9235d3df46c'

bundle.remove_tag(tag_name,
                  user,
                  reason,
                  comment,
                  options)
bundleApi = killbill.BundleApi()

bundle_id = '28af3cb9-275b-4ac4-a55d-a0536e479069'
tagDefIds = ["353752dd-9041-4450-b782-a8bb03a923c8"]

bundleApi.delete_bundle_tags(bundle_id, 
                             tag_def=tagDefIds,
                             created_by='demo',
                             reason='reason', 
                             comment='comment')
const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);

const bundleTag = ['acc26862-875e-4b24-990e-985d3f837862'];
const bundleID = '7f5b6b8e-0936-4d6b-ab05-820632f385b0';

bundleApi.deleteBundleTags(bundleID, 'created_by', bundleTag);
$apiInstance = $client->getBundleApi();

$xKillbillCreatedBy = "user";
$xKillbillReason = "reason";
$xKillbillComment = "comment";

$bundleId = 'fb1ac07b-c132-4eeb-84d8-95228e3fbd9e';
$tagDefId = 'acc26862-875e-4b24-990e-985d3f837862';

$tag = [$tagid];

$apiInstance->deleteBundleTags($bundleId,
                               $xKillbillCreatedBy,
                               $tag,
                               $xKillbillReason,
                               $xKillbillComment);

Query Parameters

Name Type Required Default Description
tagDef array of strings true none A tag definition ID identifying the tag that should be removed. Multiple tags can be deleted by specifying a separate tagDef parameter corresponding to each tag.

Response

If successful, returns a status code of 204 and an empty body.

Audit Logs

Audit logs provide a record of events that occur involving various specific resources. For details on audit logs see Audit and History.

Retrieve bundle audit logs with history by bundle id

Retrieve a list of audit log records showing events that occurred involving changes to the bundle. History information is included with each record.

HTTP Request

GET http://127.0.0.1:8080/1.0/kb/bundles/{bundleId}/auditLogsWithHistory

Example Request:

curl \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Accept: application/json" \
    "http://127.0.0.1:8080/1.0/kb/bundles/d1b329c7-7dcf-466c-aaca-47bff304dab0/auditLogsWithHistory"
import org.killbill.billing.client.api.gen.BundleApi;
protected BundleApi bundleApi;

UUID bundleId = UUID.fromString("917992d3-5f1f-4828-9fff-799cc4211aa9");

AuditLogs bundleAuditLogs = bundleApi.getBundleAuditLogsWithHistory(bundleId,                            
                                                                    requestOptions);
bundle = KillBillClient::Model::Bundle.new

bundle.bundle_id = 'efaebe7a-8eaa-4550-96ea-a9235d3df46c'

bundleAuditLogs = bundle.audit_logs_with_history(options)
bundleApi = killbill.BundleApi()

bundleId = '424475ed-3fda-4a8c-9dfd-dacc80a06242'

bundleAuditLogs = bundleApi.get_bundle_audit_logs_with_history(bundleId)
const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);

const bundleID = '7f5b6b8e-0936-4d6b-ab05-820632f385b0';

const bundletags: AxiosResponse<killbill.AuditLog[]> =
      await bundleApi.getBundleAuditLogsWithHistory(bundleID);
$apiInstance = $client->getBundleApi();

$bundleId = 'fb1ac07b-c132-4eeb-84d8-95228e3fbd9e';

$bundleAuditLogs = $apiInstance->getBundleAuditLogsWithHistory($bundleId);

Example Response:

{
  "changeType": "INSERT",
  "changeDate": "2019-02-22T22:38:10.000Z",
  "objectType": "BUNDLE",
  "objectId": "d1b329c7-7dcf-466c-aaca-47bff304dab0",
  "changedBy": "admin",
  "reasonCode": null,
  "comments": null,
  "userToken": "1f03e074-dea1-45c5-aee3-c9464886f476",
  "history": {
    "id": null,
    "createdDate": "2019-02-22T22:38:10.000Z",
    "updatedDate": "2019-02-22T22:38:10.000Z",
    "recordId": 316,
    "accountRecordId": 10,
    "tenantRecordId": 1,
    "externalKey": "d1b329c7-7dcf-466c-aaca-47bff304dab0",
    "accountId": "7b3e14b1-6e76-46d3-bbfd-5a16e5b5eca2",
    "lastSysUpdateDate": "2019-02-22T22:38:10.000Z",
    "originalCreatedDate": "2019-02-22T22:38:10.000Z",
    "tableName": "BUNDLES",
    "historyTableName": "BUNDLE_HISTORY"
  }
},
{
  "changeType": "UPDATE",
  "changeDate": "2019-02-22T22:38:10.000Z",
  "objectType": "BUNDLE",
  "objectId": "d1b329c7-7dcf-466c-aaca-47bff304dab0",
  "changedBy": "SubscriptionBaseTransition",
  "reasonCode": null,
  "comments": null,
  "userToken": "1f03e074-dea1-45c5-aee3-c9464886f476",
  "history": {
    "id": null,
    "createdDate": "2019-02-22T22:38:10.000Z",
    "updatedDate": "2019-02-22T22:38:10.000Z",
    "recordId": 316,
    "accountRecordId": 10,
    "tenantRecordId": 1,
    "externalKey": "d1b329c7-7dcf-466c-aaca-47bff304dab0",
    "accountId": "7b3e14b1-6e76-46d3-bbfd-5a16e5b5eca2",
    "lastSysUpdateDate": "2019-02-22T22:38:10.000Z",
    "originalCreatedDate": "2019-02-22T22:38:10.000Z",
    "tableName": "BUNDLES",
    "historyTableName": "BUNDLE_HISTORY"
  }
}

Query Parameters

None.

Response

If successful, returns a status code of 200 and a list of audit logs.

List bundles

HTTP Request

GET http://127.0.0.1:8080/1.0/kb/bundles/pagination

Example Request:

curl -v \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Accept: application/json" \
    "http://localhost:8080/1.0/kb/bundles/pagination"
import org.killbill.billing.client.api.gen.BundleApi;
protected BundleApi bundleApi;

Long offset = 0L;
Long limit = 1L;

Bundles allBundles = bundleApi.getBundles(offset, 
                                          limit, 
                                          AuditLevel.NONE, 
                                          requestOptions);
offset = 0
limit = 100

bundle = KillBillClient::Model::Bundle

paginatedBundles = bundle.find_in_batches(offset,
                                          limit,
                                          options)
bundleApi = killbill.BundleApi()

bundles = bundleApi.get_bundles()
const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);

const bundles: AxiosResponse<killbill.Bundle[]> = await bundleApi.getBundles();
$apiInstance = $client->getBundleApi();

$bundles = $apiInstance->getBundles();

Example Response:

{
  "accountId": "2ad52f53-85ae-408a-9879-32a7e59dd03d",
  "bundleId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
  "externalKey": "another_external_key",
  "subscriptions": [
    {
      "accountId": "2ad52f53-85ae-408a-9879-32a7e59dd03d",
      "bundleId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
      "subscriptionId": "8ab101b6-15e8-433b-b4f7-f99eeaa56a77",
      "externalKey": "another_external_key",
      "startDate": "2018-07-18",
      "productName": "Standard",
      "productCategory": "BASE",
      "billingPeriod": "MONTHLY",
      "phaseType": "TRIAL",
      "priceList": "DEFAULT",
      "planName": "standard-monthly",
      "state": "CANCELLED",
      "sourceType": "NATIVE",
      "cancelledDate": "2018-07-19",
      "chargedThroughDate": null,
      "billingStartDate": "2018-07-18",
      "billingEndDate": "2018-07-19",
      "billCycleDayLocal": 17,
      "events": [
        {
          "eventId": "3961e5a4-815c-4e95-aca6-2f3e76c37942",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-07-18",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "START_ENTITLEMENT",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "entitlement-service",
          "serviceStateName": "ENT_STARTED",
          "phase": "standard-monthly-trial",
          "auditLogs": []
        },
        {
          "eventId": "8e7a6a7d-7660-49e3-979c-a4a0b6ec6804",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-07-18",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "START_BILLING",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "billing-service",
          "serviceStateName": "START_BILLING",
          "phase": "standard-monthly-trial",
          "auditLogs": []
        },
        {
          "eventId": "01387e92-8b6c-4c74-811f-3d2698646049",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-07-19",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "STOP_ENTITLEMENT",
          "isBlockedBilling": false,
          "isBlockedEntitlement": true,
          "serviceName": "entitlement-service",
          "serviceStateName": "ENT_CANCELLED",
          "phase": "standard-monthly-trial",
          "auditLogs": []
        },
        {
          "eventId": "1d605f2d-e605-47d5-b55c-904a0cba12f8",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-07-19",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "STOP_BILLING",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "billing-service",
          "serviceStateName": "STOP_BILLING",
          "phase": "standard-monthly-trial",
          "auditLogs": []
        },
        {
          "eventId": "e9f343aa-3650-4709-a09d-8a3df908bd47",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-07-19",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "SERVICE_STATE_CHANGE",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "ServiceStateService",
          "serviceStateName": "STATE1",
          "phase": "standard-monthly-trial",
          "auditLogs": []
        }
      ],
      "priceOverrides": null,
      "prices": [],
      "auditLogs": []
    }
  ],
  "timeline": {
    "accountId": "2ad52f53-85ae-408a-9879-32a7e59dd03d",
    "bundleId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
    "externalKey": "another_external_key",
    "events": [
      {
        "eventId": "3961e5a4-815c-4e95-aca6-2f3e76c37942",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-07-18",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "START_ENTITLEMENT",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "entitlement-service",
        "serviceStateName": "ENT_STARTED",
        "phase": "standard-monthly-trial",
        "auditLogs": []
      },
      {
        "eventId": "8e7a6a7d-7660-49e3-979c-a4a0b6ec6804",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-07-18",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "START_BILLING",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "billing-service",
        "serviceStateName": "START_BILLING",
        "phase": "standard-monthly-trial",
        "auditLogs": []
      },
      {
        "eventId": "01387e92-8b6c-4c74-811f-3d2698646049",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-07-19",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "STOP_ENTITLEMENT",
        "isBlockedBilling": false,
        "isBlockedEntitlement": true,
        "serviceName": "entitlement-service",
        "serviceStateName": "ENT_CANCELLED",
        "phase": "standard-monthly-trial",
        "auditLogs": []
      },
      {
        "eventId": "1d605f2d-e605-47d5-b55c-904a0cba12f8",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-07-19",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "STOP_BILLING",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "billing-service",
        "serviceStateName": "STOP_BILLING",
        "phase": "standard-monthly-trial",
        "auditLogs": []
      },
      {
        "eventId": "e9f343aa-3650-4709-a09d-8a3df908bd47",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-07-19",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "SERVICE_STATE_CHANGE",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "ServiceStateService",
        "serviceStateName": "STATE1",
        "phase": "standard-monthly-trial",
        "auditLogs": []
      }
    ],
    "auditLogs": []
  },
  "auditLogs": []
},
{
  "accountId": "8785164f-b5d7-4da1-9495-33f5105e8d80",
  "bundleId": "02134ca5-8254-4c73-aaf2-89ed99a28fce",
  "externalKey": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
  "subscriptions": [
    {
      "accountId": "8785164f-b5d7-4da1-9495-33f5105e8d80",
      "bundleId": "02134ca5-8254-4c73-aaf2-89ed99a28fce",
      "subscriptionId": "3b78a8c1-30fb-4b4e-a247-b131cbf6fa71",
      "externalKey": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
      "startDate": "2018-07-19",
      "productName": "Standard",
      "productCategory": "BASE",
      "billingPeriod": "MONTHLY",
      "phaseType": "TRIAL",
      "priceList": "DEFAULT",
      "planName": "standard-monthly",
      "state": "ACTIVE",
      "sourceType": "TRANSFERRED",
      "cancelledDate": null,
      "chargedThroughDate": "2018-07-19",
      "billingStartDate": "2018-07-19",
      "billingEndDate": null,
      "billCycleDayLocal": 18,
      "events": [
        {
          "eventId": "f247597d-deac-468e-8b18-9a04c633ec71",
          "billingPeriod": null,
          "effectiveDate": "2018-07-19",
          "plan": null,
          "product": null,
          "priceList": null,
          "eventType": "SERVICE_STATE_CHANGE",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "account-service",
          "serviceStateName": "CLOSE_ACCOUNT",
          "phase": null,
          "auditLogs": []
        },
        {
          "eventId": "15987747-2c28-4475-965c-3b1cff08faa9",
          "billingPeriod": null,
          "effectiveDate": "2018-07-19",
          "plan": null,
          "product": null,
          "priceList": null,
          "eventType": "START_ENTITLEMENT",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "entitlement-service",
          "serviceStateName": "ENT_STARTED",
          "phase": null,
          "auditLogs": []
        },
        {
          "eventId": "51c53d93-d3c1-4906-b295-c5a1b0d761e7",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-07-19",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "START_BILLING",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "billing-service",
          "serviceStateName": "START_BILLING",
          "phase": "standard-monthly-trial",
          "auditLogs": []
        },
        {
          "eventId": "2cf6cd36-d0d1-461b-b525-f2a36a73be76",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-08-17",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "PHASE",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "entitlement+billing-service",
          "serviceStateName": "PHASE",
          "phase": "standard-monthly-evergreen",
          "auditLogs": []
        }
      ],
      "priceOverrides": null,
      "prices": [],
      "auditLogs": []
    }
  ],
  "timeline": {
    "accountId": "8785164f-b5d7-4da1-9495-33f5105e8d80",
    "bundleId": "02134ca5-8254-4c73-aaf2-89ed99a28fce",
    "externalKey": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
    "events": [
      {
        "eventId": "f247597d-deac-468e-8b18-9a04c633ec71",
        "billingPeriod": null,
        "effectiveDate": "2018-07-19",
        "plan": null,
        "product": null,
        "priceList": null,
        "eventType": "SERVICE_STATE_CHANGE",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "account-service",
        "serviceStateName": "CLOSE_ACCOUNT",
        "phase": null,
        "auditLogs": []
      },
      {
        "eventId": "15987747-2c28-4475-965c-3b1cff08faa9",
        "billingPeriod": null,
        "effectiveDate": "2018-07-19",
        "plan": null,
        "product": null,
        "priceList": null,
        "eventType": "START_ENTITLEMENT",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "entitlement-service",
        "serviceStateName": "ENT_STARTED",
        "phase": null,
        "auditLogs": []
      },
      {
        "eventId": "51c53d93-d3c1-4906-b295-c5a1b0d761e7",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-07-19",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "START_BILLING",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "billing-service",
        "serviceStateName": "START_BILLING",
        "phase": "standard-monthly-trial",
        "auditLogs": []
      },
      {
        "eventId": "2cf6cd36-d0d1-461b-b525-f2a36a73be76",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-08-17",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "PHASE",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "entitlement+billing-service",
        "serviceStateName": "PHASE",
        "phase": "standard-monthly-evergreen",
        "auditLogs": []
      }
    ],
    "auditLogs": []
  },
  "auditLogs": []
}

Query Parameters

Name Type Required Default Description
offset long no 0 Starting index for items listed
limit long no 100 maximum number of items listed
audit string no "NONE" Level of audit information to return:"NONE", "MINIMAL", or "FULL"

Response

If successful, returns a status code of 200 and a list with all bundles.

Search bundles

Search for a bundle by a specified search string. Search operation can be of two types as follows:

Basic:

The search string is compared to the accountId, the bundleId, and the bundle externalKey. The operation returns all bundle resources in which the search string matches any one of these attributes. Note: the string must match the entire attribute, not just a part of it.

Advanced:

Advanced search allows filtering on the specified fields. The prefix marker _q=1 needs to be specified at the beginning of the search key to indicate this is an advanced query.

The search key should be in the following format: <field>[<operator>]=value. Here:

Some advanced search key examples:

Note: The symbols [,],% need to be URL encoded while using cURL/Postman as follows:

Symbol Encoding
[ %5B
] %5D
% %25

HTTP Request

GET http://127.0.0.1:8080/1.0/kb/bundles/search/{searchKey}

Example Request:

## Basic Search
curl -v \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Accept: application/json" \
    "http://localhost:8080/1.0/kb/bundles/search/another_external_key"

## Advanced Search (search by created_by and created_date)  
curl -v \
    -u admin:password \
    -H "X-Killbill-ApiKey: bob" \
    -H "X-Killbill-ApiSecret: lazar" \
    -H "Accept: application/json" \
    "http://localhost:8080/1.0/kb/bundles/search/_q=1&created_by%5Blike%5D=admin&created_date%5Bgt%5D=2024-06-12"   
import org.killbill.billing.client.api.gen.BundleApi;
protected BundleApi bundleApi;

String searchKey = "93199";
Long offset = 0L;
Long limit = 1L;

Bundles result = bundleApi.searchBundles(searchKey, 
                                         offset, 
                                         limit, 
                                         AuditLevel.NONE, 
                                         requestOptions);
search_key = 'example'
offset = 0
limit = 100

bundle = KillBillClient::Model::Bundle

bundles = bundle.find_in_batches_by_search_key(search_key,
                                               offset,
                                               limit,
                                               options)
bundleApi = killbill.BundleApi()

search_key = '7b26b0ce-a495-4c0c-9dd5-11a556f03e8c'

bundles = bundleApi.search_bundles(search_key)
const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);

const searchKey = '7f5b6b8e-0936-4d6b-ab05-820632f385b0';

const bundles: AxiosResponse<killbill.Bundle[]> = await bundleApi.searchBundles(searchKey);
$apiInstance = $client->getBundleApi();

const searchKey = 'BundleSearchKey';

$bundles = $apiInstance->searchBundles(searchKey);

Example Response:

{
  "accountId": "2ad52f53-85ae-408a-9879-32a7e59dd03d",
  "bundleId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
  "externalKey": "another_external_key",
  "subscriptions": [
    {
      "accountId": "2ad52f53-85ae-408a-9879-32a7e59dd03d",
      "bundleId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
      "subscriptionId": "8ab101b6-15e8-433b-b4f7-f99eeaa56a77",
      "externalKey": "another_external_key",
      "startDate": "2018-07-18",
      "productName": "Standard",
      "productCategory": "BASE",
      "billingPeriod": "MONTHLY",
      "phaseType": "TRIAL",
      "priceList": "DEFAULT",
      "planName": "standard-monthly",
      "state": "CANCELLED",
      "sourceType": "NATIVE",
      "cancelledDate": "2018-07-19",
      "chargedThroughDate": null,
      "billingStartDate": "2018-07-18",
      "billingEndDate": "2018-07-19",
      "billCycleDayLocal": 17,
      "events": [
        {
          "eventId": "3961e5a4-815c-4e95-aca6-2f3e76c37942",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-07-18",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "START_ENTITLEMENT",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "entitlement-service",
          "serviceStateName": "ENT_STARTED",
          "phase": "standard-monthly-trial",
          "auditLogs": []
        },
        {
          "eventId": "8e7a6a7d-7660-49e3-979c-a4a0b6ec6804",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-07-18",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "START_BILLING",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "billing-service",
          "serviceStateName": "START_BILLING",
          "phase": "standard-monthly-trial",
          "auditLogs": []
        },
        {
          "eventId": "01387e92-8b6c-4c74-811f-3d2698646049",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-07-19",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "STOP_ENTITLEMENT",
          "isBlockedBilling": false,
          "isBlockedEntitlement": true,
          "serviceName": "entitlement-service",
          "serviceStateName": "ENT_CANCELLED",
          "phase": "standard-monthly-trial",
          "auditLogs": []
        },
        {
          "eventId": "1d605f2d-e605-47d5-b55c-904a0cba12f8",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-07-19",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "STOP_BILLING",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "billing-service",
          "serviceStateName": "STOP_BILLING",
          "phase": "standard-monthly-trial",
          "auditLogs": []
        },
        {
          "eventId": "e9f343aa-3650-4709-a09d-8a3df908bd47",
          "billingPeriod": "MONTHLY",
          "effectiveDate": "2018-07-19",
          "plan": "standard-monthly",
          "product": "Standard",
          "priceList": "DEFAULT",
          "eventType": "SERVICE_STATE_CHANGE",
          "isBlockedBilling": false,
          "isBlockedEntitlement": false,
          "serviceName": "ServiceStateService",
          "serviceStateName": "STATE1",
          "phase": "standard-monthly-trial",
          "auditLogs": []
        }
      ],
      "priceOverrides": null,
      "prices": [],
      "auditLogs": []
    }
  ],
  "timeline": {
    "accountId": "2ad52f53-85ae-408a-9879-32a7e59dd03d",
    "bundleId": "2cd2f4b5-a1c0-42a7-924f-64c7b791332d",
    "externalKey": "another_external_key",
    "events": [
      {
        "eventId": "3961e5a4-815c-4e95-aca6-2f3e76c37942",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-07-18",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "START_ENTITLEMENT",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "entitlement-service",
        "serviceStateName": "ENT_STARTED",
        "phase": "standard-monthly-trial",
        "auditLogs": []
      },
      {
        "eventId": "8e7a6a7d-7660-49e3-979c-a4a0b6ec6804",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-07-18",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "START_BILLING",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "billing-service",
        "serviceStateName": "START_BILLING",
        "phase": "standard-monthly-trial",
        "auditLogs": []
      },
      {
        "eventId": "01387e92-8b6c-4c74-811f-3d2698646049",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-07-19",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "STOP_ENTITLEMENT",
        "isBlockedBilling": false,
        "isBlockedEntitlement": true,
        "serviceName": "entitlement-service",
        "serviceStateName": "ENT_CANCELLED",
        "phase": "standard-monthly-trial",
        "auditLogs": []
      },
      {
        "eventId": "1d605f2d-e605-47d5-b55c-904a0cba12f8",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-07-19",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "STOP_BILLING",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "billing-service",
        "serviceStateName": "STOP_BILLING",
        "phase": "standard-monthly-trial",
        "auditLogs": []
      },
      {
        "eventId": "e9f343aa-3650-4709-a09d-8a3df908bd47",
        "billingPeriod": "MONTHLY",
        "effectiveDate": "2018-07-19",
        "plan": "standard-monthly",
        "product": "Standard",
        "priceList": "DEFAULT",
        "eventType": "SERVICE_STATE_CHANGE",
        "isBlockedBilling": false,
        "isBlockedEntitlement": false,
        "serviceName": "ServiceStateService",
        "serviceStateName": "STATE1",
        "phase": "standard-monthly-trial",
        "auditLogs": []
      }
    ],
    "auditLogs": []
  },
  "auditLogs": []
}

Query Parameters

Name Type Required Default Description
searchKey string yes none String to be matched
offset long no 0 Starting index for items listed
limit long no 100 maximum number of items listed
audit string no "NONE" Level of audit information to return:"NONE", "MINIMAL", or "FULL"

Response

If successful, returns a status code of 200 and a list with all bundles that are matched by the search key.