Invoice Item

An invoice contains a list of InvoiceItems. An invoice item a single item charged on an invoice. Given an active subscription, one could see multiple items for that subscription on a single invoice, including recurring items, usage items, fixed price items, etc. There can also be items for different subscriptions on the same invoice, as well as items that are unrelated to subscriptions, such as adjustments and taxes.

InvoiceItem Resource

An InvoiceItem resource represents a single item charged on an invoice. The attributes contained in this resource are the following:

Name Type Generated by Description
invoiceItemId string system UUID for the invoice item
invoiceId string system UUID for the invoice
linkedInvoiceItemId string system UUID for the linked item, if any (see below)
accountId string system UUID for the account
childAccountId string system In the hierarchical model, the UUID of the child account
bundleId string system UUID for the bundle
subscriptionId string system UUID for the subscription (present only if invoice item corresponds to a subscription)
productName string system Name of the Product for this subscription if any
planName string system Name of the Plan for this subscription if any
phaseName string system Name of the PlanPhase for this subscription if any
usageName string system Name of the Usage section for this subscription if any
prettyProductName string system Pretty name of the Product for this subscription if any
prettyPlanName string system Pretty name of the Plan for this subscription if any
prettyPhaseName string system Pretty name of the PlanPhase for this subscription if any
prettyUsageName string system Pretty name of the Usage section for this subscription if any
itemType string system Item type (see below)
description string user or system Optional description of the item
startDate date user or system Start date of the period invoiced
endDate date user or system End date of the period invoiced
amount number user or system Amount being invoiced
rate number user or system Rate associated with the Plan
currency string user or system Currency associated with the account
quantity number system Quantity of usage blocks (number of units/block size). Applicable only for itemType=USAGE and when org.killbill.invoice.item.result.behavior.mode=DETAIL is specified
itemDetails string system JSON list correpsonding to usage items being invoiced. It contains one entry per tier
catalogEffectiveDate DateTime system The effective date of the underlying catalog. Applicable only for itemType=RECURRING
childItems list user or system In the hierarchical model, the items for the children.
auditLogs array system Array of audit log records for this invoice item

linkedInvoiceItemId: This ID is used to link to another item. For example, an item representing an adjustment would link to the item being adjusted.

itemType: The following invoice item types are currently supported:

Refer to the Subscription Billing document for further details.

Custom Fields

Custom fields are {key, value} attributes that can be attached to any customer resource. In particular, they can be added to invoice items. For details on Custom Fields see Custom Field.

Add custom fields to an invoice item

Adds one or more custom fields to an invoice item. Existing custom fields are not disturbed.

HTTP Request

POST http://127.0.0.1:8080/1.0/kb/invoiceItems/{invoiceItemId}/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": "INVOICE_ITEM", "name": "Test Custom Field", "value": "demo_test_value" }]' \
    "http://127.0.0.1:8080/1.0/kb/invoiceItems/b52528dc-3a5c-4fde-93e3-ccf3585869de/customFields"   
import org.killbill.billing.client.api.gen.InvoiceItemApi;
protected InvoiceItemApi invoiceItemApi;

UUID invoiceItemId = UUID.fromString("480963fe-510f-45ef-afcd-0334806510b8");

final List<AuditLog> EMPTY_AUDIT_LOGS = Collections.emptyList();

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

invoiceItemApi.createInvoiceItemCustomFields(invoiceItemId,
        customFields,
        requestOptions);
user = "demo"
reason = nil
comment = nil

invoice_item = KillBillClient::Model::InvoiceItem.new
invoice_item.invoice_item_id = '75939764-7776-4ae6-8319-a30a20f6a181'

custom_fields = []
custom_field = KillBillClient::Model::CustomFieldAttributes.new
custom_field.object_type = 'INVOICE_ITEM'
custom_field.name = 'Test Custom Field'
custom_field.value = 'test_value'
custom_fields.push custom_field

invoice_item.add_custom_field(custom_fields,
                         user,
                         reason,
                         comment,
                         options)
invoiceItemApi = killbill.api.InvoiceItemApi()

invoice_item_id = 'e212f5bf-6960-4b95-ac4e-c60439447ee5'
body = CustomField(name='Test Custom Field', value='test_value')

invoiceItemApi.create_invoice_item_custom_fields(invoice_item_id,
                                        [body],
                                        created_by='demo',
                                        reason='reason',
                                        comment='comment')
const api: killbill.InvoiceItemApi = new killbill.InvoiceItemApi(config);

const customField: CustomField = {name: "Test Custom Field", value: "test_value"};
const customFields = [customField];

const invoiceItemId = 'df124876-fbe4-4d61-897d-6eb0d3f3862c';

api.createInvoiceItemCustomFields(customFields, invoiceItemId, 'created_by');
$apiInstance = $client->getInvoiceItemApi();

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

$customField = new CustomField();
$customField -> setName('Test Custom Field');
$customField -> setValue('test_value');
$body = array($customField);

$invoiceItemId = "df124876-fbe4-4d61-897d-6eb0d3f3862c";

$result = $apiInstance->createInvoiceItemCustomFields($body, $xKillbillCreatedBy, $invoiceItemId, $xKillbillReason, $xKillbillComment);

Request Body

A list of Custom Field objects. Each object should specify at least the name and value attribute. For example:

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

Query Parameters

None.

Response

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

Retrieve invoice item custom fields

Retrieve the custom fields associated with an invoice item

HTTP Request

GET http://127.0.0.1:8080/1.0/kb/invoiceItems/{invoiceItemId}/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/invoiceItems/b52528dc-3a5c-4fde-93e3-ccf3585869de/customFields"
import org.killbill.billing.client.api.gen.InvoiceItemApi;
protected InvoiceItemApi invoiceItemApi;

UUID invoiceItemId = UUID.fromString("480963fe-510f-45ef-afcd-0334806510b8");

List<CustomField> customFields = invoiceItemApi.getInvoiceItemCustomFields(invoiceItemId, AuditLevel.NONE, requestOptions);
invoice_item = KillBillClient::Model::InvoiceItem.new
invoice_item.invoice_item_id = '75939764-7776-4ae6-8319-a30a20f6a181'

audit = 'NONE'

custom_fields = invoice_item.custom_fields(audit, options)
invoiceItemApi = killbill.api.InvoiceItemApi()

invoice_item_id = 'e212f5bf-6960-4b95-ac4e-c60439447ee5'

custom_fields = invoiceItemApi.get_invoice_item_custom_fields(invoice_item_id)
const api: killbill.InvoiceItemApi = new killbill.InvoiceItemApi(config);

const invoiceItemId = 'df124876-fbe4-4d61-897d-6eb0d3f3862c';
const audit = 'NONE';

const response: AxiosResponse<killbill.CustomField[], any> = await api.getInvoiceItemCustomFields(invoiceItemId, audit, 'created_by');
$apiInstance = $client->getInvoiceItemApi();

$invoiceItemId = "df124876-fbe4-4d61-897d-6eb0d3f3862c";
$audit = "NONE";

$result = $apiInstance->getInvoiceItemCustomFields($invoiceItemId, $audit);

Example Response:

[
  {
    "customFieldId": "5fa2c86e-9a13-4acf-a996-7827549ed7df",
    "objectId": "b52528dc-3a5c-4fde-93e3-ccf3585869de",
    "objectType": "INVOICE_ITEM",
    "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" (only inserts), or "FULL"

Response

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

Modify custom fields for an invoice item

Modify the custom fields associated with an invoice item. Note that it is not possible to modify the name of a custom field, it is only possible to modify its value.

HTTP Request

PUT http://127.0.0.1:8080/1.0/kb/invoiceItem/{invoiceItemId}/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": "5fa2c86e-9a13-4acf-a996-7827549ed7df", "value": "new value" }]' \
    "http://127.0.0.1:8080/1.0/kb/invoiceItems/b52528dc-3a5c-4fde-93e3-ccf3585869de/customFields"   
import org.killbill.billing.client.api.gen.InvoiceItemApi;
protected InvoiceItemApi invoiceItemApi;

UUID invoiceItemId = UUID.fromString("480963fe-510f-45ef-afcd-0334806510b8");

UUID customFieldsId = UUID.fromString("178a9b7c-25d0-42e0-be79-c7d772762c2a");

CustomField customFieldModified = new CustomField();
customFieldModified.setCustomFieldId(customFieldsId);
customFieldModified.setValue("New Value");

CustomFields customFields = new CustomFields();
customFields.add(customFieldModified);

invoiceItemApi.modifyInvoiceItemCustomFields(invoiceItemId, customFields, requestOptions);
user = "demo"
reason = nil
comment = nil

invoice_item = KillBillClient::Model::InvoiceItem.new
invoice_item.invoice_item_id = '75939764-7776-4ae6-8319-a30a20f6a181'

custom_fields = []
custom_field = KillBillClient::Model::CustomFieldAttributes.new
custom_field.custom_field_id = '0580cb5b-b0a7-43a1-8d85-ac3f2316213c'
custom_field.value = 'new value'
custom_fields.push custom_field

invoice_item.modify_custom_field(custom_fields,
                            user,
                            reason,
                            comment,
                            options)
invoiceItemApi = killbill.api.InvoiceItemApi()

invoice_item_id = 'e212f5bf-6960-4b95-ac4e-c60439447ee5'
custom_field_id = '4ea000fc-a25f-47cd-8ddf-a25a0006ec05'
body = CustomField(custom_field_id=custom_field_id, value='New Value')

invoiceItemApi.modify_invoice_item_custom_fields(invoice_item_id,
                                        [body],
                                        created_by='demo',
                                        reason='reason',
                                        comment='comment')
const api: killbill.InvoiceItemApi = new killbill.InvoiceItemApi(config);

const invoiceItemId = 'df124876-fbe4-4d61-897d-6eb0d3f3862c';

const customField: CustomField = {customFieldId: "41adbc99-bd7d-479e-b6e0-7cacf166ebeb", value: "new_value"};
const customFields = [customField];

api.modifyInvoiceItemCustomFields(customFields, invoiceItemId, 'created_by');
$apiInstance = $client->getInvoiceItemApi();

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

$invoiceItemId = "df124876-fbe4-4d61-897d-6eb0d3f3862c";

$customField = new CustomField();
$customField -> setCustomFieldId('16f5b3dc-fafb-418a-ade7-f24ef2d60edc');
$customField -> setValue('new_value');
$body = array($customField);

$apiInstance->modifyInvoiceItemCustomFields($body, $xKillbillCreatedBy, $invoiceItemId, $xKillbillReason, $xKillbillComment);

Requst Body

A list of Custom Field objects specifying the id and the new value for the custom fields to be modified. Each object should specify at least the customFieldId and value attribute. For example:

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

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

Query Parameters

None.

Response

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

Remove custom fields from invoice item

Delete one or more custom fields from an invoice item. It accepts query parameters corresponding to the custom field ids to be deleted. If no query parameters are specified, it deletes all the custom fields corresponding to the invoice item.

HTTP Request

DELETE http://127.0.0.1:8080/1.0/kb/invoiceItems/{invoiceItemId}/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/invoiceItems/b52528dc-3a5c-4fde-93e3-ccf3585869de/customFields?customField=5fa2c86e-9a13-4acf-a996-7827549ed7df"
import org.killbill.billing.client.api.gen.InvoiceItemApi;
protected InvoiceItemApi invoiceItemApi;

UUID invoiceItemId = UUID.fromString("480963fe-510f-45ef-afcd-0334806510b8");

UUID customFieldsId = UUID.fromString("178a9b7c-25d0-42e0-be79-c7d772762c2a");
List<UUID> customFieldsList = List.of(customFieldsId);

invoiceItemApi.deleteInvoiceItemCustomFields(invoiceItemId, customFieldsList, requestOptions);
user = "demo"
reason = nil
comment = nil

invoice_item = KillBillClient::Model::InvoiceItem.new
invoice_item.invoice_item_id = '75939764-7776-4ae6-8319-a30a20f6a181'

custom_field_ids = []
custom_field_id = '0580cb5b-b0a7-43a1-8d85-ac3f2316213c'
custom_field_ids.push custom_field_id

invoice_item.remove_custom_field(custom_field_ids,
                            user,
                            reason,
                            comment,
                            options)
invoiceItemApi = killbill.api.InvoiceItemApi()

invoice_item_id = 'e212f5bf-6960-4b95-ac4e-c60439447ee5'
custom_fields = ['4ea000fc-a25f-47cd-8ddf-a25a0006ec05']

invoiceItemApi.delete_invoice_item_custom_fields(invoice_item_id=invoice_item_id,
                                        custom_field=custom_fields,
                                        created_by='demo',
                                        reason='reason',
                                        comment='comment')
const api: killbill.InvoiceItemApi = new killbill.InvoiceItemApi(config);

const invoiceItemId = 'df124876-fbe4-4d61-897d-6eb0d3f3862c';

const customField = '41adbc99-bd7d-479e-b6e0-7cacf166ebeb';
const customFields = [customField];

api.deleteInvoiceItemCustomFields(invoiceItemId, 'created_by', customFields);
$apiInstance = $client->getInvoiceItemApi();

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

$invoiceItemId = "df124876-fbe4-4d61-897d-6eb0d3f3862c";

$customFields = array("16f5b3dc-fafb-418a-ade7-f24ef2d60edc");

$apiInstance->deleteInvoiceItemCustomFields($invoiceItemId, $xKillbillCreatedBy, $customFields, $xKillbillReason, $xKillbillComment);

Query Parameters

Name Type Required Default Description
customField string yes none Custom field 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 Tags for an introduction to tags.

Note: None of the system tags are applicable for invoice items, only a user tag can be associated with an invoice item.

Add tags to invoice item

This API adds one or more tags to an invoice item. The tag definition corresponding to the tag being added must already exist.

HTTP Request

POST http://127.0.0.1:8080/1.0/kb/invoiceItems/{invoiceItemId}/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 '[ "2c1f8309-24d7-437c-971b-7e68ff2d393a"]' \
    "http://127.0.0.1:8080/1.0/kb/invoiceItems/b52528dc-3a5c-4fde-93e3-ccf3585869de/tags"   
import org.killbill.billing.client.api.gen.InvoiceItemApi;
protected InvoiceItemApi invoiceItemApi;

UUID invoiceItemId = UUID.fromString("480963fe-510f-45ef-afcd-0334806510b8");

UUID tagDefId = UUID.fromString("2c1f8309-24d7-437c-971b-7e68ff2d393a");

Tags result = invoiceItemApi.createInvoiceItemTags(invoiceItemId, List.of(tagDefId), requestOptions);
user = "demo"
reason = nil
comment = nil

invoice_item = KillBillClient::Model::InvoiceItem.new
invoice_item.invoice_item_id = 'df124876-fbe4-4d61-897d-6eb0d3f3862c'
invoice_item.account_id='0f84a73c-9f1d-44e0-962e-e7d554e9cff6'

tag_definition_ids = ['2c1f8309-24d7-437c-971b-7e68ff2d393a']

invoice_item.add_tags_from_definition_ids(tag_definition_ids,
               user,
               reason,
               comment,
               options)
invoiceItemApi = killbill.api.InvoiceItemApi()

invoice_item_id = 'e212f5bf-6960-4b95-ac4e-c60439447ee5'
tagDefIds = ["2c1f8309-24d7-437c-971b-7e68ff2d393a"]

invoiceItemApi.create_invoice_item_tags(invoice_item_id,
                               tagDefIds,
                               created_by='demo',
                               reason='reason',
                               comment='comment')
const api: killbill.InvoiceItemApi = new killbill.InvoiceItemApi(config);

const invoiceItemId = 'df124876-fbe4-4d61-897d-6eb0d3f3862c';
const tagDefIds = ['2c1f8309-24d7-437c-971b-7e68ff2d393a'];

api.createInvoiceItemTags(tagDefIds, invoiceItemId, 'created_by');
$apiInstance = $client->getInvoiceItemApi();

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

$invoiceItemId = "df124876-fbe4-4d61-897d-6eb0d3f3862c";
$tagDefIds = array("2c1f8309-24d7-437c-971b-7e68ff2d393a");

$result = $apiInstance->createInvoiceItemTags($tagDefIds, $xKillbillCreatedBy, $invoiceItemId, $xKillbillReason, $xKillbillComment);

Request Body

A JSON array containing one or more tag definition ids to be added as tags.

Query Parameters

None.

Returns

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

Retrieve invoice item tags

Retrieve all tags attached to this invoice item.

HTTP Request

GET http://127.0.0.1:8080/1.0/kb/invoiceItems/{invoiceItemId}/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/invoiceItems/480963fe-510f-45ef-afcd-0334806510b8/tags?accountId=b34b25b0-1be9-48f1-94a7-3f73f2b33070"    
import org.killbill.billing.client.api.gen.InvoiceItemApi;
protected InvoiceItemApi invoiceItemApi;

UUID invoiceItemId = UUID.fromString("480963fe-510f-45ef-afcd-0334806510b8");
UUID accountId = UUID.fromString("b34b25b0-1be9-48f1-94a7-3f73f2b33070");

Boolean includedDeleted = false; // Will not include deleted tags

List<Tag> tags = invoiceItemApi.getInvoiceItemTags(invoiceItemId, accountId,
        includedDeleted,
        AuditLevel.NONE,
        requestOptions);
invoice_item = KillBillClient::Model::InvoiceItem.new
invoice_item.invoice_item_id = 'df124876-fbe4-4d61-897d-6eb0d3f3862c'
invoice_item.account_id='0f84a73c-9f1d-44e0-962e-e7d554e9cff6'

included_deleted = false
audit = 'NONE'

tags = invoice_item.tags(included_deleted,
             audit,
             options)
invoiceItemApi = killbill.api.InvoiceItemApi()

invoice_item_id = 'e212f5bf-6960-4b95-ac4e-c60439447ee5'
account_id='0f84a73c-9f1d-44e0-962e-e7d554e9cff6'

tags = invoiceItemApi.get_invoice_item_tags(invoice_item_id, account_id)
const api: killbill.InvoiceItemApi = new killbill.InvoiceItemApi(config);

const invoiceItemId = 'df124876-fbe4-4d61-897d-6eb0d3f3862c';
const accountId = '0f84a73c-9f1d-44e0-962e-e7d554e9cff6';
const includeDeleted = false;
const audit = 'NONE';

const response: AxiosResponse<killbill.Tag[], any> = await api.getInvoiceItemTags(invoiceItemId, accountId, includeDeleted, audit);
$apiInstance = $client->getInvoiceItemApi();

$invoiceItemId = "df124876-fbe4-4d61-897d-6eb0d3f3862c";
$accountId = "0f84a73c-9f1d-44e0-962e-e7d554e9cff6";
$includedDeleted = false;
$audit = "NONE";

$result = $apiInstance->getInvoiceItemTags($invoiceItemId, $accountId, $includedDeleted, $audit);

Example Response:

[
  {
    "tagId": "4db8951f-97cd-4f5c-87a5-083d5a5f7770",
    "objectType": "INVOICE_ITEM",
    "objectId": "480963fe-510f-45ef-afcd-0334806510b8",
    "tagDefinitionId": "2c1f8309-24d7-437c-971b-7e68ff2d393a",
    "tagDefinitionName": "subscription_item",
    "auditLogs": []
  }
]

Query Parameters

Name Type Required Default Description
accountId string yes none Account ID
includedDeleted boolean no false If true, include deleted tags
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 list of tag objects.

Remove tags from invoice item

This API deletes one or more tags attached to an invoice item.

HTTP Request

DELETE http://127.0.0.1:8080/1.0/kb/invoiceItems/{invoiceItemId}/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/invoiceItems/480963fe-510f-45ef-afcd-0334806510b8/tags?tagDef=2c1f8309-24d7-437c-971b-7e68ff2d393a"   
import org.killbill.billing.client.api.gen.InvoiceItemApi;
protected InvoiceItemApi invoiceItemApi;

UUID invoiceItemId = UUID.fromString("480963fe-510f-45ef-afcd-0334806510b8");
UUID tagDefId = UUID.fromString("2c1f8309-24d7-437c-971b-7e68ff2d393a");

invoiceItemApi.deleteInvoiceItemTags(invoiceItemId, List.of(tagDefId), requestOptions);
user = "demo"
reason = nil
comment = nil

invoice_item = KillBillClient::Model::InvoiceItem.new
invoice_item.invoice_item_id = 'df124876-fbe4-4d61-897d-6eb0d3f3862c'

tag_definition_ids = ['2c1f8309-24d7-437c-971b-7e68ff2d393a']

invoice_item.remove_tags_from_definition_ids(tag_definition_ids,
                  user,
                  reason,
                  comment,
                  options)
invoiceItemApi = killbill.api.InvoiceItemApi()

invoice_item_id = 'e212f5bf-6960-4b95-ac4e-c60439447ee5'
tagDefIds = ["2c1f8309-24d7-437c-971b-7e68ff2d393a"]

invoiceItemApi.delete_invoice_item_tags(invoice_item_id,
                               tag_def=tagDefIds,
                               created_by='demo',
                               reason='reason',
                               comment='comment')
const api: killbill.InvoiceItemApi = new killbill.InvoiceItemApi(config);

const invoiceItemId = 'df124876-fbe4-4d61-897d-6eb0d3f3862c';
const tagDefIds = ['2c1f8309-24d7-437c-971b-7e68ff2d393a'];

api.deleteInvoiceItemTags(invoiceItemId, 'created_by', tagDefIds);
$apiInstance = $client->getInvoiceItemApi();

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

$invoiceItemId = "df124876-fbe4-4d61-897d-6eb0d3f3862c";
$tagDef = array("2c1f8309-24d7-437c-971b-7e68ff2d393a");

$apiInstance->deleteInvoiceItemTags($invoiceItemId, $xKillbillCreatedBy, $tagDef, $xKillbillReason, $xKillbillComment);

Query Parameters

Name Type Required Default Description
tagDef array of string yes 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 invoice item audit logs with history by invoice item id

Retrieve a list of audit log records showing events that occurred involving changes to a specified invoice item. History information (a copy of the full invoice item object) is included with each record.

Some examples:

HTTP Request

GET http://127.0.0.1:8080/1.0/kb/invoiceItems/{invoiceItemId}/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/invoiceItems/b45ef2ac-e4b7-4e79-89d8-1c2e95838300/auditLogsWithHistory"
import org.killbill.billing.client.api.gen.InvoiceItemApi;
protected InvoiceItemApi invoiceItemApi;

UUID invoiceItemId = UUID.fromString("57f4f41d-81a2-4521-8420-c241ecc90a80");
AuditLogs logs = invoiceItemApi.getInvoiceItemAuditLogsWithHistory(invoiceItemId, requestOptions);
invoice_item = KillBillClient::Model::InvoiceItem.new
invoice_item.invoice_item_id = "6f3d5bd3-f8b3-4615-9940-5a15a5060fb5"

audit_logs = invoice_item.audit_logs_with_history(options)
invoiceItemApi = killbill.api.InvoiceItemApi()

invoice_item_id = "6f3d5bd3-f8b3-4615-9940-5a15a5060fb5"

audit_logs = invoiceItemApi.get_invoice_item_audit_logs_with_history(invoice_item_id)
const api: killbill.InvoiceItemApi = new killbill.InvoiceItemApi(config);

const invoiceItemId = '6f3d5bd3-f8b3-4615-9940-5a15a5060fb5';

const response: AxiosResponse<killbill.AuditLog[], any> = await api.getInvoiceItemAuditLogsWithHistory(invoiceItemId);
$apiInstance = $client->getInvoiceItemApi();

$invoiceItemId = "6f3d5bd3-f8b3-4615-9940-5a15a5060fb5";

$result = $apiInstance->getInvoiceItemAuditLogsWithHistory($invoiceItemId);

Example Response:

[
  {
    "changeType": "INSERT",
    "changeDate": "2019-02-22T22:38:10.000Z",
    "objectType": "INVOICE_ITEM",
    "objectId": "b45ef2ac-e4b7-4e79-89d8-1c2e95838300",
    "changedBy": "SubscriptionBaseTransition",
    "reasonCode": null,
    "comments": null,
    "userToken": "1f03e074-dea1-45c5-aee3-c9464886f476",
    "history": {
      "id": null,
      "createdDate": "2019-02-22T22:38:10.000Z",
      "updatedDate": null,
      "recordId": 2698,
      "accountRecordId": 10,
      "tenantRecordId": 1,
      "type": "RECURRING",
      "invoiceId": "d456a9b3-7e48-4f56-b387-1d65a492e75e",
      "accountId": "7b3e14b1-6e76-46d3-bbfd-5a16e5b5eca2",
      "childAccountId": null,
      "bundleId": "d1b329c7-7dcf-466c-aaca-47bff304dab0",
      "subscriptionId": "70b6856e-6938-495f-9ae9-0a8ec0571c37",
      "description": "foo-monthly-evergreen",
      "productName": "Foo",
      "planName": "foo-monthly",
      "phaseName": "foo-monthly-evergreen",
      "usageName": null,
      "startDate": "2019-02-22",
      "endDate": "2019-03-22",
      "amount": 10,
      "rate": 10,
      "currency": "USD",
      "linkedItemId": null,
      "quantity": null,
      "itemDetails": null,
      "tableName": "INVOICE_ITEMS",
      "historyTableName": "INVOICE_ITEM_HISTORY"
    }
  }
]

Query Parameters

None.

Response

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