Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,677 changes: 853 additions & 824 deletions api/api.gen.go

Large diffs are not rendered by default.

1,641 changes: 833 additions & 808 deletions api/client/go/client.gen.go

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions api/client/javascript/src/client/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6866,6 +6866,12 @@ export interface components {
* discounts that are affecting multiple lines.
*/
readonly discounts?: components['schemas']['InvoiceLineDiscounts']
/**
* @description Credit allocations applied to this line.
*
* Credits are deducted from the line total before taxes are applied.
*/
readonly creditAllocations?: components['schemas']['InvoiceLineCreditAllocation'][]
/** @description The invoice this item belongs to. */
invoice?: components['schemas']['InvoiceReference']
/** @description The currency of this line. */
Expand Down Expand Up @@ -7046,6 +7052,12 @@ export interface components {
* discounts that are affecting multiple lines.
*/
readonly discounts?: components['schemas']['InvoiceLineDiscounts']
/**
* @description Credit allocations applied to this line.
*
* Credits are deducted from the line total before taxes are applied.
*/
readonly creditAllocations?: components['schemas']['InvoiceLineCreditAllocation'][]
/** @description The invoice this item belongs to. */
invoice?: components['schemas']['InvoiceReference']
/** @description The currency of this line. */
Expand Down Expand Up @@ -7169,6 +7181,16 @@ export interface components {
/** @description The external ID of the invoice in the tax app if available. */
readonly tax?: string
}
/** @description InvoiceLineCreditAllocation represents a credit amount allocated to the line before taxes are applied. */
InvoiceLineCreditAllocation: {
/**
* Amount in the currency of the invoice
* @description Amount allocated from credits.
*/
readonly amount: components['schemas']['Numeric']
/** @description Text description as to why the credit was allocated. */
readonly description?: string
}
/** @description InvoiceLineDiscounts represents the discounts applied to the invoice line by type. */
InvoiceLineDiscounts: {
/**
Expand Down Expand Up @@ -7648,6 +7670,8 @@ export interface components {
readonly chargesTotal: components['schemas']['Numeric']
/** @description The amount of value of the line that are due to discounts. */
readonly discountsTotal: components['schemas']['Numeric']
/** @description The amount of value of the line that are due to credits. */
readonly creditsTotal: components['schemas']['Numeric']
/** @description The total amount of taxes that are included in the line. */
readonly taxesInclusiveTotal: components['schemas']['Numeric']
/** @description The total amount of taxes that are added on top of amount from the line. */
Expand Down Expand Up @@ -12683,6 +12707,8 @@ export type InvoiceLineAmountDiscount =
components['schemas']['InvoiceLineAmountDiscount']
export type InvoiceLineAppExternalIds =
components['schemas']['InvoiceLineAppExternalIds']
export type InvoiceLineCreditAllocation =
components['schemas']['InvoiceLineCreditAllocation']
export type InvoiceLineDiscounts = components['schemas']['InvoiceLineDiscounts']
export type InvoiceLineManagedBy = components['schemas']['InvoiceLineManagedBy']
export type InvoiceLineReplaceUpdate =
Expand Down
2 changes: 2 additions & 0 deletions api/client/python/openmeter/_generated/models/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 41 additions & 1 deletion api/client/python/openmeter/_generated/models/_models.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions api/openapi.cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18545,6 +18545,15 @@ components:
New discounts can be added via the invoice's discounts API, to facilitate
discounts that are affecting multiple lines.
readOnly: true
creditAllocations:
type: array
items:
$ref: '#/components/schemas/InvoiceLineCreditAllocation'
description: |-
Credit allocations applied to this line.

Credits are deducted from the line total before taxes are applied.
readOnly: true
invoice:
allOf:
- $ref: '#/components/schemas/InvoiceReference'
Expand Down Expand Up @@ -18794,6 +18803,15 @@ components:
New discounts can be added via the invoice's discounts API, to facilitate
discounts that are affecting multiple lines.
readOnly: true
creditAllocations:
type: array
items:
$ref: '#/components/schemas/InvoiceLineCreditAllocation'
description: |-
Credit allocations applied to this line.

Credits are deducted from the line total before taxes are applied.
readOnly: true
invoice:
allOf:
- $ref: '#/components/schemas/InvoiceReference'
Expand Down Expand Up @@ -18973,6 +18991,22 @@ components:
description: The external ID of the invoice in the tax app if available.
readOnly: true
description: InvoiceLineAppExternalIds contains the external IDs of the invoice in other apps such as Stripe.
InvoiceLineCreditAllocation:
type: object
required:
- amount
properties:
amount:
allOf:
- $ref: '#/components/schemas/Numeric'
description: Amount allocated from credits.
title: Amount in the currency of the invoice
readOnly: true
description:
type: string
description: Text description as to why the credit was allocated.
readOnly: true
description: InvoiceLineCreditAllocation represents a credit amount allocated to the line before taxes are applied.
InvoiceLineDiscounts:
type: object
properties:
Expand Down Expand Up @@ -19636,6 +19670,7 @@ components:
- amount
- chargesTotal
- discountsTotal
- creditsTotal
- taxesInclusiveTotal
- taxesExclusiveTotal
- taxesTotal
Expand All @@ -19656,6 +19691,11 @@ components:
- $ref: '#/components/schemas/Numeric'
description: The amount of value of the line that are due to discounts.
readOnly: true
creditsTotal:
allOf:
- $ref: '#/components/schemas/Numeric'
description: The amount of value of the line that are due to credits.
readOnly: true
taxesInclusiveTotal:
allOf:
- $ref: '#/components/schemas/Numeric'
Expand Down
49 changes: 49 additions & 0 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19036,6 +19036,15 @@ components:
New discounts can be added via the invoice's discounts API, to facilitate
discounts that are affecting multiple lines.
readOnly: true
creditAllocations:
type: array
items:
$ref: '#/components/schemas/InvoiceLineCreditAllocation'
description: |-
Credit allocations applied to this line.

Credits are deducted from the line total before taxes are applied.
readOnly: true
invoice:
allOf:
- $ref: '#/components/schemas/InvoiceReference'
Expand Down Expand Up @@ -19335,6 +19344,15 @@ components:
New discounts can be added via the invoice's discounts API, to facilitate
discounts that are affecting multiple lines.
readOnly: true
creditAllocations:
type: array
items:
$ref: '#/components/schemas/InvoiceLineCreditAllocation'
description: |-
Credit allocations applied to this line.

Credits are deducted from the line total before taxes are applied.
readOnly: true
invoice:
allOf:
- $ref: '#/components/schemas/InvoiceReference'
Expand Down Expand Up @@ -19605,6 +19623,15 @@ components:
New discounts can be added via the invoice's discounts API, to facilitate
discounts that are affecting multiple lines.
readOnly: true
creditAllocations:
type: array
items:
$ref: '#/components/schemas/InvoiceLineCreditAllocation'
description: |-
Credit allocations applied to this line.

Credits are deducted from the line total before taxes are applied.
readOnly: true
invoice:
allOf:
- $ref: '#/components/schemas/InvoiceReference'
Expand Down Expand Up @@ -19655,6 +19682,22 @@ components:
InvoiceLine represents a single item or service sold to the customer.

This is a base class for all line types, and should not be used directly.
InvoiceLineCreditAllocation:
type: object
required:
- amount
properties:
amount:
allOf:
- $ref: '#/components/schemas/Numeric'
description: Amount allocated from credits.
title: Amount in the currency of the invoice
readOnly: true
description:
type: string
description: Text description as to why the credit was allocated.
readOnly: true
description: InvoiceLineCreditAllocation represents a credit amount allocated to the line before taxes are applied.
InvoiceLineDiscounts:
type: object
properties:
Expand Down Expand Up @@ -20325,6 +20368,7 @@ components:
- amount
- chargesTotal
- discountsTotal
- creditsTotal
- taxesInclusiveTotal
- taxesExclusiveTotal
- taxesTotal
Expand All @@ -20345,6 +20389,11 @@ components:
- $ref: '#/components/schemas/Numeric'
description: The amount of value of the line that are due to discounts.
readOnly: true
creditsTotal:
allOf:
- $ref: '#/components/schemas/Numeric'
description: The amount of value of the line that are due to credits.
readOnly: true
taxesInclusiveTotal:
allOf:
- $ref: '#/components/schemas/Numeric'
Expand Down
24 changes: 24 additions & 0 deletions api/spec/packages/legacy/src/billing/invoices/credits.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import "@typespec/http";
import "@typespec/rest";
import "@typespec/openapi3";

namespace OpenMeter;

/**
* InvoiceLineCreditAllocation represents a credit amount allocated to the line before taxes are applied.
*/
@friendlyName("InvoiceLineCreditAllocation")
model InvoiceLineCreditAllocation {
/**
* Amount allocated from credits.
*/
@visibility(Lifecycle.Read)
@summary("Amount in the currency of the invoice")
amount: Money;

/**
* Text description as to why the credit was allocated.
*/
@visibility(Lifecycle.Read)
description?: string;
}
14 changes: 14 additions & 0 deletions api/spec/packages/legacy/src/billing/invoices/invoice.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,14 @@ model InvoiceLineBase {
@visibility(Lifecycle.Read)
discounts?: InvoiceLineDiscounts;

/**
* Credit allocations applied to this line.
*
* Credits are deducted from the line total before taxes are applied.
*/
@visibility(Lifecycle.Read)
creditAllocations?: InvoiceLineCreditAllocation[];

/**
* The invoice this item belongs to.
*/
Expand Down Expand Up @@ -851,6 +859,12 @@ model InvoiceTotals {
@visibility(Lifecycle.Read)
discountsTotal: Numeric;

/**
* The amount of value of the line that are due to credits.
*/
@visibility(Lifecycle.Read)
creditsTotal: Numeric;

/**
* The total amount of taxes that are included in the line.
*/
Expand Down
Loading
Loading