Invoice Aggregation API
| Action | Endpoint |
|---|---|
| Fetch Invoices for Aggregate Invoice | GET/billing/{tenantLocator}/invoices/{locator}/invoices/list |
| Fetch Invoice Details for Aggregate Invoice | GET/billing/{tenantLocator}/invoices/{locator}/invoices/details/list |
| Create Aggregate Invoice | POST/billing/{tenantLocator}/invoices |
| Update Aggregate Invoice | PATCH/billing/{tenantLocator}/invoices/{locator}/aggregate |
| Transfer Invoices Between Aggregate Invoices | POST/billing/{tenantLocator}/invoices/{locator}/transfer |
| Discard Aggregate Invoice | PATCH/billing/{tenantLocator}/invoices/{locator}/discard |
Fetch Invoices for Aggregate Invoice
fetchInvoicesForAggregateInvoice/billing/{tenantLocator}/invoices/{locator}/invoices/listParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenantLocator | path | uuid | Yes | |
locator | path | ulid | Yes | |
offset | query | integer? | No | |
count | query | integer? | No |
ListPageResponseInvoiceSummaryViewinvoicesread,listRequired properties
| Property | Type | Description |
|---|---|---|
listCompleted | boolean | |
items | InvoiceSummaryView[] |
Fetch Invoice Details for Aggregate Invoice
getInvoiceDetailsAttachedToAggregate/billing/{tenantLocator}/invoices/{locator}/invoices/details/listParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenantLocator | path | uuid | Yes | |
locator | path | ulid | Yes | |
offset | query | integer? | No | |
count | query | integer? | No |
ListPageResponseInvoiceDetailsinvoicesread,listRequired properties
| Property | Type | Description |
|---|---|---|
listCompleted | boolean | |
items | InvoiceDetailsResponse[] |
Create Aggregate Invoice
createAggregateInvoice/billing/{tenantLocator}/invoicesParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenantLocator | path | uuid | Yes |
AggregateInvoiceCreateRequestInvoiceResponseinvoiceswriteThis endpoint returns the new invoice with invoiceType set to aggregate and empty invoiceItems. Its invoiceState is open, or settled if none of the included invoices are open.
Required properties
| Property | Type | Description |
|---|---|---|
accountLocator | ulid | The account associated with the aggregate invoice. |
invoiceLocators | ulid[] | Up to 100, no duplicates. Each must belong to the account, share one currency, and not already be on an aggregate invoice. May be empty or omitted. |
Optional properties
| Property | Type | Description |
|---|---|---|
startTime | datetime? | Defaults to the earliest startTime of the included invoices, or the creation time if not present. Must be before endTime. |
endTime | datetime? | Defaults to the latest endTime of the included invoices, or the creation time if not present. |
dueTime | datetime? | Defaults to the earliest dueTime of the included invoices, or the creation time if not present. |
currency | string? | Must match the included invoices. Defaults to their currency, then the tenant default. |
timezone | string? | Defaults to the shared timezone of the included invoices, then the account timezone, then the tenant default. |
Update Aggregate Invoice
patchAggregateInvoice/billing/{tenantLocator}/invoices/{locator}/aggregateParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenantLocator | path | uuid | Yes | |
locator | path | ulid | Yes |
This endpoint returns the updated aggregate invoice. At least one body parameter is required, and no locator may appear in both addInvoices and removeInvoices. Omitted parameters keep their current values. Dates are not recalculated when invoices are added or removed.
Required properties
| Property | Type | Description |
|---|---|---|
addInvoices | ulid[] | Up to 100, no duplicates. Each must belong to the account, share one currency, and not already be on an aggregate invoice. |
removeInvoices | ulid[] | Up to 100, no duplicates. Locators not on this aggregate invoice are ignored. |
Optional properties
| Property | Type | Description |
|---|---|---|
startTime | datetime? | Must be before endTime. |
endTime | datetime? | |
dueTime | datetime? | |
currency | string? | Must match the contained invoices. |
timezone | string? |
Transfer Invoices Between Aggregate Invoices
transferInvoicesBetweenAggregateInvoices/billing/{tenantLocator}/invoices/{locator}/transferParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenantLocator | path | uuid | Yes | |
locator | path | ulid | Yes |
AggregateInvoiceTransferRequestInvoiceResponseinvoiceswriteThis endpoint returns the source aggregate invoice. Both the source and destination re-evaluate their state afterwards.
Required properties
| Property | Type | Description |
|---|---|---|
targetAggregateInvoiceLocator | ulid | The destination aggregate invoice. Must differ from the source and belong to the same account. |
invoiceLocators | ulid[] | 1 to 100, no duplicates, and each must currently be on the source. |
Discard Aggregate Invoice
discardAggregateInvoice/billing/{tenantLocator}/invoices/{locator}/discardParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenantLocator | path | uuid | Yes | |
locator | path | ulid | Yes |
InvoiceResponseinvoiceswrite