Get Bundle By External Key API returned multiple bundles.

24 views
Skip to first unread message

Vivek Manpuria (Vivek)

unread,
May 24, 2025, 2:22:27 AM5/24/25
to Kill Bill users mailing-list
Dear Team,

Whereas, the Get Bundle by bundle id api returns a single bundle, the Get Bundle by External Key, returns an array of bundles.

In what situations could killbill create multiple bundles with the same external key?

I tried deleting subscriptions and creating new ones by specifying the same bundleExternalKey several times but only 1 bundle was created. 

However, through a series of steps that I have lost track of, I have an API response wherein, there are multiple bundles with the same external key.

Thank you,
Vivek
 

karan bansal

unread,
May 24, 2025, 9:29:11 AM5/24/25
to Kill Bill users mailing-list
Hi Vivek,

How many of the returned bundles are active? It allows reusing the external key provided the other bundles are not active. I was able to replicate it by cancelling the existing bundle and creating a new one with the same key. The api has a flag to include/exclude deleted bundles. 

Regards
Karan

Vivek Manpuria (Vivek)

unread,
May 26, 2025, 5:12:59 AM5/26/25
to Kill Bill users mailing-list
Thanks Karan. I accidentally lost the API response. As far as I remember there were 2 bundles each with 1 active subscription. Let me keep an eye out for it.

Which api can be used to cancel a bundle? The api.html file in the killbill server does not show a DELETE bundle api. 

- Vivek 

Vivek Manpuria (Vivek)

unread,
Jun 4, 2025, 1:00:00 PM6/4/25
to Kill Bill users mailing-list
Hi Karan

I was able to add a plan to a cancelled bundle using the bundle id. This solves our requirement of 1 bundle with external key.

Here is the bundle showing 2 cancelled subscriptions as of May 31 and 1 active bundle that was added on June 3:

[
{
"accountId": "4b837fe3-d48f-42d1-9f02-e8a81b205a52",
"bundleId": "f9303dc8-93de-4f0d-8c77-5bbbdf912fc5",
"externalKey": "bundleExternalKey-1",
"subscriptions": [
{
"accountId": "4b837fe3-d48f-42d1-9f02-e8a81b205a52",
"bundleId": "f9303dc8-93de-4f0d-8c77-5bbbdf912fc5",
"bundleExternalKey": "bundleExternalKey-1",
"subscriptionId": "73ec00b2-9804-4ff1-811e-004c35513f74",
"externalKey": "73ec00b2-9804-4ff1-811e-004c35513f74",
"startDate": "2025-05-30T23:25:14.000Z",
"productName": "hulu_qa.16106c36-5635-4e10-b30f-d60bc6c52188",
"productCategory": "STANDALONE",
"billingPeriod": "DAILY",
"phaseType": "TRIAL",
"priceList": "DEFAULT",
"planName": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"state": "CANCELLED",
"sourceType": "NATIVE",
"cancelledDate": "2025-05-30T23:27:21.000Z",
"chargedThroughDate": "2025-05-31",
"billingStartDate": "2025-05-30T23:25:14.000Z",
"billingEndDate": "2025-05-31T23:23:57.000Z",
"billCycleDayLocal": 31,
"quantity": 1,
"events": [
{
"eventId": "ac9a16d6-76ce-4231-8619-8358732edf03",
"billingPeriod": "DAILY",
"effectiveDate": "2025-05-30T23:25:14.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"product": "hulu_qa.16106c36-5635-4e10-b30f-d60bc6c52188",
"priceList": "DEFAULT",
"eventType": "START_ENTITLEMENT",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "entitlement-service",
"serviceStateName": "ENT_STARTED",
"phase": "_16106c36-5635-4e10-b30f-d60bc6c52188-trial",
"auditLogs": []
},
{
"eventId": "ce0b3b39-a91a-4ee0-be80-0d7a41111296",
"billingPeriod": "DAILY",
"effectiveDate": "2025-05-30T23:25:14.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"product": "hulu_qa.16106c36-5635-4e10-b30f-d60bc6c52188",
"priceList": "DEFAULT",
"eventType": "START_BILLING",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "billing-service",
"serviceStateName": "START_BILLING",
"phase": "_16106c36-5635-4e10-b30f-d60bc6c52188-trial",
"auditLogs": []
},
{
"eventId": "7ebf0d22-19c6-497c-b7d9-950b278a0004",
"billingPeriod": "DAILY",
"effectiveDate": "2025-05-30T23:27:21.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"product": "hulu_qa.16106c36-5635-4e10-b30f-d60bc6c52188",
"priceList": "DEFAULT",
"eventType": "STOP_ENTITLEMENT",
"isBlockedBilling": false,
"isBlockedEntitlement": true,
"serviceName": "entitlement-service",
"serviceStateName": "ENT_CANCELLED",
"phase": "_16106c36-5635-4e10-b30f-d60bc6c52188-trial",
"auditLogs": []
},
{
"eventId": "977e3a95-4719-46a9-abc8-499e080966bb",
"billingPeriod": "DAILY",
"effectiveDate": "2025-05-31T23:23:57.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"product": "hulu_qa.16106c36-5635-4e10-b30f-d60bc6c52188",
"priceList": "DEFAULT",
"eventType": "STOP_BILLING",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "billing-service",
"serviceStateName": "STOP_BILLING",
"phase": "_16106c36-5635-4e10-b30f-d60bc6c52188-trial",
"auditLogs": []
}
],
"priceOverrides": null,
"prices": [
{
"planName": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"phaseName": "_16106c36-5635-4e10-b30f-d60bc6c52188-trial",
"phaseType": "TRIAL",
"fixedPrice": 0,
"recurringPrice": null,
"usagePrices": []
}
],
"auditLogs": []
},
{
"accountId": "4b837fe3-d48f-42d1-9f02-e8a81b205a52",
"bundleId": "f9303dc8-93de-4f0d-8c77-5bbbdf912fc5",
"bundleExternalKey": "bundleExternalKey-1",
"subscriptionId": "6b3d9945-a083-4b8e-9bc7-cc60f6276c81",
"externalKey": "6b3d9945-a083-4b8e-9bc7-cc60f6276c81",
"startDate": "2025-05-30T23:29:17.000Z",
"productName": "hulu_qa.3294e043-a166-46e2-acda-8a92d6cea0a8",
"productCategory": "STANDALONE",
"billingPeriod": "ANNUAL",
"phaseType": "EVERGREEN",
"priceList": "DEFAULT",
"planName": "_3294e043-a166-46e2-acda-8a92d6cea0a8",
"state": "CANCELLED",
"sourceType": "NATIVE",
"cancelledDate": "2025-05-30T23:35:05.000Z",
"chargedThroughDate": "2025-05-31",
"billingStartDate": "2025-05-30T23:29:17.000Z",
"billingEndDate": "2025-05-31T23:23:57.000Z",
"billCycleDayLocal": 30,
"quantity": 1,
"events": [
{
"eventId": "5d7aa657-fbef-41fb-9d49-ca3d28177a4d",
"billingPeriod": "ANNUAL",
"effectiveDate": "2025-05-30T23:29:17.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_3294e043-a166-46e2-acda-8a92d6cea0a8",
"product": "hulu_qa.3294e043-a166-46e2-acda-8a92d6cea0a8",
"priceList": "DEFAULT",
"eventType": "START_ENTITLEMENT",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "entitlement-service",
"serviceStateName": "ENT_STARTED",
"phase": "_3294e043-a166-46e2-acda-8a92d6cea0a8-evergreen",
"auditLogs": []
},
{
"eventId": "121f01a2-8490-405a-848d-cd23db8587cb",
"billingPeriod": "ANNUAL",
"effectiveDate": "2025-05-30T23:29:17.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_3294e043-a166-46e2-acda-8a92d6cea0a8",
"product": "hulu_qa.3294e043-a166-46e2-acda-8a92d6cea0a8",
"priceList": "DEFAULT",
"eventType": "START_BILLING",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "billing-service",
"serviceStateName": "START_BILLING",
"phase": "_3294e043-a166-46e2-acda-8a92d6cea0a8-evergreen",
"auditLogs": []
},
{
"eventId": "58a03844-2542-4f14-ba83-a75620e503cb",
"billingPeriod": "ANNUAL",
"effectiveDate": "2025-05-30T23:35:05.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_3294e043-a166-46e2-acda-8a92d6cea0a8",
"product": "hulu_qa.3294e043-a166-46e2-acda-8a92d6cea0a8",
"priceList": "DEFAULT",
"eventType": "STOP_ENTITLEMENT",
"isBlockedBilling": false,
"isBlockedEntitlement": true,
"serviceName": "entitlement-service",
"serviceStateName": "ENT_CANCELLED",
"phase": "_3294e043-a166-46e2-acda-8a92d6cea0a8-evergreen",
"auditLogs": []
},
{
"eventId": "191954fd-84b6-446b-977c-a9b3e92f8845",
"billingPeriod": "ANNUAL",
"effectiveDate": "2025-05-31T23:23:57.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_3294e043-a166-46e2-acda-8a92d6cea0a8",
"product": "hulu_qa.3294e043-a166-46e2-acda-8a92d6cea0a8",
"priceList": "DEFAULT",
"eventType": "STOP_BILLING",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "billing-service",
"serviceStateName": "STOP_BILLING",
"phase": "_3294e043-a166-46e2-acda-8a92d6cea0a8-evergreen",
"auditLogs": []
}
],
"priceOverrides": null,
"prices": [
{
"planName": "_3294e043-a166-46e2-acda-8a92d6cea0a8",
"phaseName": "_3294e043-a166-46e2-acda-8a92d6cea0a8-evergreen",
"phaseType": "EVERGREEN",
"fixedPrice": null,
"recurringPrice": 100,
"usagePrices": []
}
],
"auditLogs": []
},
{
"accountId": "4b837fe3-d48f-42d1-9f02-e8a81b205a52",
"bundleId": "f9303dc8-93de-4f0d-8c77-5bbbdf912fc5",
"bundleExternalKey": "bundleExternalKey-1",
"subscriptionId": "17c6b7cb-dde3-4cdf-bfc8-c9cc7abdd576",
"externalKey": "17c6b7cb-dde3-4cdf-bfc8-c9cc7abdd576",
"startDate": "2025-06-04T00:50:23.000Z",
"productName": "hulu_qa.16106c36-5635-4e10-b30f-d60bc6c52188",
"productCategory": "STANDALONE",
"billingPeriod": "DAILY",
"phaseType": "TRIAL",
"priceList": "DEFAULT",
"planName": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"state": "ACTIVE",
"sourceType": "NATIVE",
"cancelledDate": null,
"chargedThroughDate": null,
"billingStartDate": "2025-06-04T00:50:23.000Z",
"billingEndDate": null,
"billCycleDayLocal": 4,
"quantity": 1,
"events": [
{
"eventId": "8b2db7e9-1859-47ed-981e-9e905443b0ac",
"billingPeriod": "DAILY",
"effectiveDate": "2025-06-04T00:50:23.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"product": "hulu_qa.16106c36-5635-4e10-b30f-d60bc6c52188",
"priceList": "DEFAULT",
"eventType": "START_ENTITLEMENT",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "entitlement-service",
"serviceStateName": "ENT_STARTED",
"phase": "_16106c36-5635-4e10-b30f-d60bc6c52188-trial",
"auditLogs": []
},
{
"eventId": "d309dca3-55fa-4fe6-81d0-d9770aa955c7",
"billingPeriod": "DAILY",
"effectiveDate": "2025-06-04T00:50:23.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"product": "hulu_qa.16106c36-5635-4e10-b30f-d60bc6c52188",
"priceList": "DEFAULT",
"eventType": "START_BILLING",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "billing-service",
"serviceStateName": "START_BILLING",
"phase": "_16106c36-5635-4e10-b30f-d60bc6c52188-trial",
"auditLogs": []
},
{
"eventId": "460b0147-975c-4a53-a5fc-ae622e348cb9",
"billingPeriod": "DAILY",
"effectiveDate": "2025-06-05T00:50:23.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"product": "hulu_qa.16106c36-5635-4e10-b30f-d60bc6c52188",
"priceList": "DEFAULT",
"eventType": "PHASE",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "entitlement+billing-service",
"serviceStateName": "PHASE",
"phase": "_16106c36-5635-4e10-b30f-d60bc6c52188-evergreen",
"auditLogs": []
}
],
"priceOverrides": null,
"prices": [
{
"planName": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"phaseName": "_16106c36-5635-4e10-b30f-d60bc6c52188-trial",
"phaseType": "TRIAL",
"fixedPrice": 0,
"recurringPrice": null,
"usagePrices": []
},
{
"planName": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"phaseName": "_16106c36-5635-4e10-b30f-d60bc6c52188-evergreen",
"phaseType": "EVERGREEN",
"fixedPrice": null,
"recurringPrice": 2,
"usagePrices": []
}
],
"auditLogs": []
}
],
"timeline": {
"accountId": "4b837fe3-d48f-42d1-9f02-e8a81b205a52",
"bundleId": "f9303dc8-93de-4f0d-8c77-5bbbdf912fc5",
"externalKey": "bundleExternalKey-1",
"events": [
{
"eventId": "ac9a16d6-76ce-4231-8619-8358732edf03",
"billingPeriod": "DAILY",
"effectiveDate": "2025-05-30T23:25:14.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"product": "hulu_qa.16106c36-5635-4e10-b30f-d60bc6c52188",
"priceList": "DEFAULT",
"eventType": "START_ENTITLEMENT",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "entitlement-service",
"serviceStateName": "ENT_STARTED",
"phase": "_16106c36-5635-4e10-b30f-d60bc6c52188-trial",
"auditLogs": []
},
{
"eventId": "ce0b3b39-a91a-4ee0-be80-0d7a41111296",
"billingPeriod": "DAILY",
"effectiveDate": "2025-05-30T23:25:14.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"product": "hulu_qa.16106c36-5635-4e10-b30f-d60bc6c52188",
"priceList": "DEFAULT",
"eventType": "START_BILLING",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "billing-service",
"serviceStateName": "START_BILLING",
"phase": "_16106c36-5635-4e10-b30f-d60bc6c52188-trial",
"auditLogs": []
},
{
"eventId": "7ebf0d22-19c6-497c-b7d9-950b278a0004",
"billingPeriod": "DAILY",
"effectiveDate": "2025-05-30T23:27:21.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"product": "hulu_qa.16106c36-5635-4e10-b30f-d60bc6c52188",
"priceList": "DEFAULT",
"eventType": "STOP_ENTITLEMENT",
"isBlockedBilling": false,
"isBlockedEntitlement": true,
"serviceName": "entitlement-service",
"serviceStateName": "ENT_CANCELLED",
"phase": "_16106c36-5635-4e10-b30f-d60bc6c52188-trial",
"auditLogs": []
},
{
"eventId": "5d7aa657-fbef-41fb-9d49-ca3d28177a4d",
"billingPeriod": "ANNUAL",
"effectiveDate": "2025-05-30T23:29:17.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_3294e043-a166-46e2-acda-8a92d6cea0a8",
"product": "hulu_qa.3294e043-a166-46e2-acda-8a92d6cea0a8",
"priceList": "DEFAULT",
"eventType": "START_ENTITLEMENT",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "entitlement-service",
"serviceStateName": "ENT_STARTED",
"phase": "_3294e043-a166-46e2-acda-8a92d6cea0a8-evergreen",
"auditLogs": []
},
{
"eventId": "121f01a2-8490-405a-848d-cd23db8587cb",
"billingPeriod": "ANNUAL",
"effectiveDate": "2025-05-30T23:29:17.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_3294e043-a166-46e2-acda-8a92d6cea0a8",
"product": "hulu_qa.3294e043-a166-46e2-acda-8a92d6cea0a8",
"priceList": "DEFAULT",
"eventType": "START_BILLING",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "billing-service",
"serviceStateName": "START_BILLING",
"phase": "_3294e043-a166-46e2-acda-8a92d6cea0a8-evergreen",
"auditLogs": []
},
{
"eventId": "58a03844-2542-4f14-ba83-a75620e503cb",
"billingPeriod": "ANNUAL",
"effectiveDate": "2025-05-30T23:35:05.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_3294e043-a166-46e2-acda-8a92d6cea0a8",
"product": "hulu_qa.3294e043-a166-46e2-acda-8a92d6cea0a8",
"priceList": "DEFAULT",
"eventType": "STOP_ENTITLEMENT",
"isBlockedBilling": false,
"isBlockedEntitlement": true,
"serviceName": "entitlement-service",
"serviceStateName": "ENT_CANCELLED",
"phase": "_3294e043-a166-46e2-acda-8a92d6cea0a8-evergreen",
"auditLogs": []
},
{
"eventId": "191954fd-84b6-446b-977c-a9b3e92f8845",
"billingPeriod": "ANNUAL",
"effectiveDate": "2025-05-31T23:23:57.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_3294e043-a166-46e2-acda-8a92d6cea0a8",
"product": "hulu_qa.3294e043-a166-46e2-acda-8a92d6cea0a8",
"priceList": "DEFAULT",
"eventType": "STOP_BILLING",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "billing-service",
"serviceStateName": "STOP_BILLING",
"phase": "_3294e043-a166-46e2-acda-8a92d6cea0a8-evergreen",
"auditLogs": []
},
{
"eventId": "977e3a95-4719-46a9-abc8-499e080966bb",
"billingPeriod": "DAILY",
"effectiveDate": "2025-05-31T23:23:57.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"product": "hulu_qa.16106c36-5635-4e10-b30f-d60bc6c52188",
"priceList": "DEFAULT",
"eventType": "STOP_BILLING",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "billing-service",
"serviceStateName": "STOP_BILLING",
"phase": "_16106c36-5635-4e10-b30f-d60bc6c52188-trial",
"auditLogs": []
},
{
"eventId": "8b2db7e9-1859-47ed-981e-9e905443b0ac",
"billingPeriod": "DAILY",
"effectiveDate": "2025-06-04T00:50:23.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"product": "hulu_qa.16106c36-5635-4e10-b30f-d60bc6c52188",
"priceList": "DEFAULT",
"eventType": "START_ENTITLEMENT",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "entitlement-service",
"serviceStateName": "ENT_STARTED",
"phase": "_16106c36-5635-4e10-b30f-d60bc6c52188-trial",
"auditLogs": []
},
{
"eventId": "d309dca3-55fa-4fe6-81d0-d9770aa955c7",
"billingPeriod": "DAILY",
"effectiveDate": "2025-06-04T00:50:23.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"product": "hulu_qa.16106c36-5635-4e10-b30f-d60bc6c52188",
"priceList": "DEFAULT",
"eventType": "START_BILLING",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "billing-service",
"serviceStateName": "START_BILLING",
"phase": "_16106c36-5635-4e10-b30f-d60bc6c52188-trial",
"auditLogs": []
},
{
"eventId": "460b0147-975c-4a53-a5fc-ae622e348cb9",
"billingPeriod": "DAILY",
"effectiveDate": "2025-06-05T00:50:23.000Z",
"catalogEffectiveDate": "2025-06-01T00:00:00.000Z",
"plan": "_16106c36-5635-4e10-b30f-d60bc6c52188",
"product": "hulu_qa.16106c36-5635-4e10-b30f-d60bc6c52188",
"priceList": "DEFAULT",
"eventType": "PHASE",
"isBlockedBilling": false,
"isBlockedEntitlement": false,
"serviceName": "entitlement+billing-service",
"serviceStateName": "PHASE",
"phase": "_16106c36-5635-4e10-b30f-d60bc6c52188-evergreen",
"auditLogs": []
}
],
"auditLogs": []
},
"auditLogs": []
}
]
Thank you,
Vivek

Reply all
Reply to author
Forward
0 new messages