Skip to content

Commit

Permalink
Merge pull request killbill#268 from reshmabidikar/invoice-docs-updat…
Browse files Browse the repository at this point in the history
…e-overall-corrections

Overall corrections to invoice docs
  • Loading branch information
pierre authored Oct 11, 2023
2 parents 762d306 + 1ad8a11 commit 9dd8f51
Showing 1 changed file with 68 additions and 44 deletions.
112 changes: 68 additions & 44 deletions source/includes/_invoice.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,35 +49,35 @@ An `Invoice` resource represents an invoice associated with a specific account.

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 | TODO | TODO|
| **itemDetails** | string | user or system | In usage mode, details about what was invoiced. |
| **catalogEffectiveDate** | DateTime | system | TODO |
| **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 |
| 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.

Expand Down Expand Up @@ -338,7 +338,7 @@ invoiceApi.create_migration_invoice(account_id,
const api: killbill.InvoiceApi = new killbill.InvoiceApi(config);

const accountId = 'b462d167-d9bc-459a-bdb7-23ebf99f5b76';
const item: InvoiceItem = {amount: 10, itemType: "EXTERNAL_CHARGE","description":"a migration item"};
const item: InvoiceItem = {amount: 10, itemType: "EXTERNAL_CHARGE",description:"a migration item"};
const items = [item];

api.createMigrationInvoice(items, accountId, 'created_by');
Expand Down Expand Up @@ -442,7 +442,7 @@ invoice_item.description = 'My charge'

auto_commit = true

invoice_item.create(auto_commit,
invoice_item = invoice_item.create(auto_commit,
user,
reason,
comment,
Expand All @@ -458,7 +458,7 @@ body = InvoiceItem(account_id=account_id,
currency='USD',
description='External charge')

invoiceApi.create_external_charges(account_id,
invoice_item = invoiceApi.create_external_charges(account_id,
[body],
auto_commit=True,
created_by='demo',
Expand All @@ -470,10 +470,10 @@ invoiceApi.create_external_charges(account_id,
const api: killbill.InvoiceApi = new killbill.InvoiceApi(config);

const accountId = 'b462d167-d9bc-459a-bdb7-23ebf99f5b76';
const item: InvoiceItem = {amount: 10, itemType: "EXTERNAL_CHARGE","description":"external charge"};
const item: InvoiceItem = {amount: 10, itemType: "EXTERNAL_CHARGE",description:"external charge"};
const items = [item];

api.createExternalCharges(items, accountId, 'created_by');
const response: AxiosResponse<killbill.InvoiceItem, any> = await api.createExternalCharges(items, accountId, 'created_by');
````

````php
Expand Down Expand Up @@ -616,7 +616,7 @@ invoice_item.description = 'Tax item'

auto_commit = true

invoice_item.create_tax_item(auto_commit,
invoice_item = invoice_item.create_tax_item(auto_commit,
user,
reason,
comment,
Expand All @@ -632,7 +632,7 @@ body = InvoiceItem(account_id=account_id,
currency='USD',
description='Tax item')

invoiceApi.create_tax_items(account_id,
invoice_item = invoiceApi.create_tax_items(account_id,
[body],
auto_commit=True,
created_by='demo',
Expand All @@ -644,10 +644,10 @@ invoiceApi.create_tax_items(account_id,
const api: killbill.InvoiceApi = new killbill.InvoiceApi(config);

const accountId = 'b462d167-d9bc-459a-bdb7-23ebf99f5b76';
const item: InvoiceItem = {amount: 10, itemType: "TAX","description":"a tax item"};
const item: InvoiceItem = {amount: 10, itemType: "TAX",description:"a tax item"};
const items = [item];

api.createTaxItems(items, accountId, 'created_by');
const response: AxiosResponse<killbill.InvoiceItem, any> = await api.createTaxItems(items, accountId, 'created_by');
````

````php
Expand Down Expand Up @@ -848,10 +848,10 @@ $result = $apiInstance->getInvoice($invoiceId, $withChildrenItems, $audit);

**Query Parameters**

| Name | Type | Required | Default | Description |
| ---- | -----| -------- | ------- |----------------------------------------------------------------------------------|
| **withChildrenItems** | boolean | no | false | If true, include children items (applicable only in the hierarchical mode if the current invoice corresponds to a parent invoice). |
| **audit** | string | no | "NONE" | Level of audit information to return:"NONE", "MINIMAL" (only inserts), or "FULL" |
| Name | Type | Required | Default | Description |
| ---- | -----| -------- | ------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **withChildrenItems** | boolean | no | false | If true, include children items (applicable only in the hierarchical mode if the current invoice corresponds to a parent invoice and isPaymentDelegatedToParent=true). |
| **audit** | string | no | "NONE" | Level of audit information to return:"NONE", "MINIMAL" (only inserts), or "FULL" |

**Returns**

Expand Down Expand Up @@ -983,7 +983,7 @@ $result = $apiInstance->getInvoiceByNumber($invoiceNumber, $withChildrenItems, $

| Name | Type | Required | Default | Description |
| ---- | -----| -------- | ------- |----------------------------------------------------------------------------------|
| **withChildrenItems** | boolean | no | false | If true, include children items (applicable only in the hierarchical mode if the current invoice corresponds to a parent invoice).|
| **withChildrenItems** | boolean | no | false | If true, include children items (applicable only in the hierarchical mode if the current invoice corresponds to a parent invoice and isPaymentDelegatedToParent=true).|
| **audit** | string | no | "NONE" | Level of audit information to return:"NONE", "MINIMAL" (only inserts), or "FULL" |

**Returns**
Expand Down Expand Up @@ -1119,7 +1119,7 @@ $result = $apiInstance->getInvoiceByItemId($itemId, $withChildrenItems, $audit);

| Name | Type | Required | Default | Description |
| ---- | -----| -------- | ------- | ----------- |
| **withChildrenItems** | boolean | no | false | If true, include children items (applicable only in the hierarchical mode if the current invoice corresponds to a parent invoice).|
| **withChildrenItems** | boolean | no | false | If true, include children items (applicable only in the hierarchical mode if the current invoice corresponds to a parent invoice and isPaymentDelegatedToParent=true).|
| **audit** | string | no | "NONE" | Level of audit information to return:"NONE", "MINIMAL" (only inserts), or "FULL" |

**Response**
Expand Down Expand Up @@ -3372,6 +3372,9 @@ curl -v \
```
```java
import org.killbill.billing.client.api.gen.InvoiceApi;
protected InvoiceApi invoiceApi;
String locale = "en_US";
String body = "gold-monthly=plan";
Boolean deleteIfExists = true;
Expand Down Expand Up @@ -3473,6 +3476,9 @@ curl -v \
```
```java
import org.killbill.billing.client.api.gen.InvoiceApi;
protected InvoiceApi invoiceApi;
String locale = "en_US";
String translation = invoiceApi.getCatalogTranslation(locale, requestOptions);
```
Expand Down Expand Up @@ -3568,6 +3574,9 @@ curl -v \
```
```java
import org.killbill.billing.client.api.gen.InvoiceApi;
protected InvoiceApi invoiceApi;
String locale = "en_US";
String body = "gold-monthly=plan";
Boolean deleteIfExists = true;
Expand Down Expand Up @@ -3674,6 +3683,9 @@ curl -v \
```
```java
import org.killbill.billing.client.api.gen.InvoiceApi;
protected InvoiceApi invoiceApi;
String locale = "en_US";
String translation = invoiceApi.getInvoiceTranslation(locale, requestOptions);
Expand Down Expand Up @@ -3771,6 +3783,9 @@ curl -v \
```
```java
import org.killbill.billing.client.api.gen.InvoiceApi;
protected InvoiceApi invoiceApi;
String body = "Test HTML String";
Boolean deleteIfExists = true;
String template = invoiceApi.uploadInvoiceMPTemplate(body, deleteIfExists,requestOptions);
Expand Down Expand Up @@ -3861,6 +3876,9 @@ curl -v \
```
```java
import org.killbill.billing.client.api.gen.InvoiceApi;
protected InvoiceApi invoiceApi;
String locale = "fr_FR";
String template = invoiceApi.getInvoiceMPTemplate(locale, requestOptions);
```
Expand Down Expand Up @@ -4048,6 +4066,9 @@ curl -v \
```
```java
import org.killbill.billing.client.api.gen.InvoiceApi;
protected InvoiceApi invoiceApi;
String body = "Test HTML String";
Boolean deleteIfExists = true;
String template = invoiceApi.uploadInvoiceTemplate(body, deleteIfExists,requestOptions);
Expand Down Expand Up @@ -4141,6 +4162,9 @@ curl -v \
```
```java
import org.killbill.billing.client.api.gen.InvoiceApi;
protected InvoiceApi invoiceApi;
String template = invoiceApi.getInvoiceTemplate(requestOptions);
```
Expand Down

0 comments on commit 9dd8f51

Please sign in to comment.