Skip to content

Invoice Items

Operations Summary

Method Endpoint Description
Core CRUD
GET /api/invoice-items/ List Invoice Items
GET /api/invoice-items/{uuid}/ Retrieve
POST /api/invoice-items/{uuid}/create_compensation/ Create compensation invoice item for selected invoice item
PUT /api/invoice-items/{uuid}/ Update
PATCH /api/invoice-items/{uuid}/ Partial Update
DELETE /api/invoice-items/{uuid}/ Delete
Other Actions
GET /api/invoice-items/{uuid}/consumptions/ Consumptions
GET /api/invoice-items/costs/ Get costs breakdown for a project by year and month
GET /api/invoice-items/customer_costs_for_period/ Customer costs for period
GET /api/invoice-items/project_costs_for_period/ Get resource cost breakdown for a project over a specified period
GET /api/invoice-items/total_price/ Calculate total price for filtered invoice items
POST /api/invoice-items/{uuid}/migrate_to/ Move invoice item from one invoice to another one

Core CRUD

List Invoice Items

1
2
3
4
http \
  GET \
  https://api.example.com/api/invoice-items/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.invoice_items import invoice_items_list # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = invoice_items_list.sync(client=client)

for item in response:
    print(item)
  1. API Source: invoice_items_list
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import { invoiceItemsList } from 'waldur-js-client';

try {
  const response = await invoiceItemsList({
  auth: "Token YOUR_API_TOKEN"
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Description
credit_uuid string (uuid)
customer_uuid string (uuid)
month integer
offering_uuid string (uuid)
page integer A page number within the paginated result set.
page_size integer Number of results to return per page.
project_uuid string (uuid)
resource_uuid string (uuid)
start_month number Start month
start_year number Start year
year integer

200 -

The response body is an array of objects, where each object has the following structure:

Field Type Description
invoice string (uri)
resource string (uri)
uuid string (uuid)
article_code string
unit_price string (decimal)
unit string
Enum: month, quarter, half_month, day, hour, quantity
quantity string (decimal)
measured_unit string Unit of measurement, for example, GB.
name string
start string (date-time) Date and time when item usage has started.
end string (date-time) Date and time when item usage has ended.
details any Stores data about scope

Retrieve

1
2
3
4
http \
  GET \
  https://api.example.com/api/invoice-items/a1b2c3d4-e5f6-7890-abcd-ef1234567890/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.invoice_items import invoice_items_retrieve # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = invoice_items_retrieve.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client
)

print(response)
  1. API Source: invoice_items_retrieve
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { invoiceItemsRetrieve } from 'waldur-js-client';

try {
  const response = await invoiceItemsRetrieve({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)

200 -

Field Type Description
invoice string (uri)
resource string (uri)
uuid string (uuid)
article_code string
unit_price string (decimal)
unit string
Enum: month, quarter, half_month, day, hour, quantity
quantity string (decimal)
measured_unit string Unit of measurement, for example, GB.
name string
start string (date-time) Date and time when item usage has started.
end string (date-time) Date and time when item usage has ended.
details any Stores data about scope

Create compensation invoice item for selected invoice item

Create compensation invoice item for selected invoice item.

1
2
3
4
5
http \
  POST \
  https://api.example.com/api/invoice-items/a1b2c3d4-e5f6-7890-abcd-ef1234567890/create_compensation/ \
  Authorization:"Token YOUR_API_TOKEN" \
  offering_component_name="string-value"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.invoice_item_compensation_request import InvoiceItemCompensationRequest # (1)
from waldur_api_client.api.invoice_items import invoice_items_create_compensation # (2)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)

body_data = InvoiceItemCompensationRequest(
    offering_component_name="string-value"
)
response = invoice_items_create_compensation.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client,
    body=body_data
)

print(response)
  1. Model Source: InvoiceItemCompensationRequest
  2. API Source: invoice_items_create_compensation
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
import { invoiceItemsCreateCompensation } from 'waldur-js-client';

try {
  const response = await invoiceItemsCreateCompensation({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  },
  body: {
    "offering_component_name": "string-value"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)
Field Type Required
offering_component_name string

200 -

Field Type
offering_component_name string

Update

1
2
3
4
http \
  PUT \
  https://api.example.com/api/invoice-items/a1b2c3d4-e5f6-7890-abcd-ef1234567890/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.invoice_item_update_request import InvoiceItemUpdateRequest # (1)
from waldur_api_client.api.invoice_items import invoice_items_update # (2)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)

body_data = InvoiceItemUpdateRequest()
response = invoice_items_update.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client,
    body=body_data
)

print(response)
  1. Model Source: InvoiceItemUpdateRequest
  2. API Source: invoice_items_update
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { invoiceItemsUpdate } from 'waldur-js-client';

try {
  const response = await invoiceItemsUpdate({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)
Field Type Required Description
article_code string
quantity string (decimal)
unit_price string (decimal)
start string (date-time) Date and time when item usage has started.
end string (date-time) Date and time when item usage has ended.

200 -

Field Type Description
article_code string
quantity string (decimal)
unit_price string (decimal)
start string (date-time) Date and time when item usage has started.
end string (date-time) Date and time when item usage has ended.

Partial Update

1
2
3
4
http \
  PATCH \
  https://api.example.com/api/invoice-items/a1b2c3d4-e5f6-7890-abcd-ef1234567890/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.patched_invoice_item_update_request import PatchedInvoiceItemUpdateRequest # (1)
from waldur_api_client.api.invoice_items import invoice_items_partial_update # (2)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)

body_data = PatchedInvoiceItemUpdateRequest()
response = invoice_items_partial_update.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client,
    body=body_data
)

print(response)
  1. Model Source: PatchedInvoiceItemUpdateRequest
  2. API Source: invoice_items_partial_update
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { invoiceItemsPartialUpdate } from 'waldur-js-client';

try {
  const response = await invoiceItemsPartialUpdate({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)
Field Type Required Description
article_code string
quantity string (decimal)
unit_price string (decimal)
start string (date-time) Date and time when item usage has started.
end string (date-time) Date and time when item usage has ended.

200 -

Field Type Description
article_code string
quantity string (decimal)
unit_price string (decimal)
start string (date-time) Date and time when item usage has started.
end string (date-time) Date and time when item usage has ended.

Delete

1
2
3
4
http \
  DELETE \
  https://api.example.com/api/invoice-items/a1b2c3d4-e5f6-7890-abcd-ef1234567890/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.invoice_items import invoice_items_destroy # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = invoice_items_destroy.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client
)

print(response)
  1. API Source: invoice_items_destroy
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { invoiceItemsDestroy } from 'waldur-js-client';

try {
  const response = await invoiceItemsDestroy({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)

204 - No response body


Other Actions

Consumptions

1
2
3
4
http \
  GET \
  https://api.example.com/api/invoice-items/a1b2c3d4-e5f6-7890-abcd-ef1234567890/consumptions/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.invoice_items import invoice_items_consumptions_retrieve # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = invoice_items_consumptions_retrieve.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client
)

print(response)
  1. API Source: invoice_items_consumptions_retrieve
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { invoiceItemsConsumptionsRetrieve } from 'waldur-js-client';

try {
  const response = await invoiceItemsConsumptionsRetrieve({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)

200 -

Field Type Description
invoice string (uri)
resource string (uri)
uuid string (uuid)
article_code string
unit_price string (decimal)
unit string
Enum: month, quarter, half_month, day, hour, quantity
quantity string (decimal)
measured_unit string Unit of measurement, for example, GB.
name string
start string (date-time) Date and time when item usage has started.
end string (date-time) Date and time when item usage has ended.
details any Stores data about scope

Get costs breakdown for a project by year and month

Get costs breakdown for a project by year and month.

1
2
3
4
http \
  GET \
  https://api.example.com/api/invoice-items/costs/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.invoice_items import invoice_items_costs_list # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = invoice_items_costs_list.sync(client=client)

for item in response:
    print(item)
  1. API Source: invoice_items_costs_list
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import { invoiceItemsCostsList } from 'waldur-js-client';

try {
  const response = await invoiceItemsCostsList({
  auth: "Token YOUR_API_TOKEN"
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Description
page integer A page number within the paginated result set.
page_size integer Number of results to return per page.
project_uuid string (uuid) UUID of the project for which statistics should be calculated.

200 -

The response body is an array of objects, where each object has the following structure:

Field Type
price number (double)
year integer
month integer

Customer costs for period

1
2
3
4
http \
  GET \
  https://api.example.com/api/invoice-items/customer_costs_for_period/ \
  Authorization:"Token YOUR_API_TOKEN"
1
2
3
4
5
6
7
8
9
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.invoice_items import invoice_items_customer_costs_for_period_retrieve # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = invoice_items_customer_costs_for_period_retrieve.sync(client=client)

print(response)
  1. API Source: invoice_items_customer_costs_for_period_retrieve
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import { invoiceItemsCustomerCostsForPeriodRetrieve } from 'waldur-js-client';

try {
  const response = await invoiceItemsCustomerCostsForPeriodRetrieve({
  auth: "Token YOUR_API_TOKEN"
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Description
customer_uuid string (uuid) UUID of the project for which statistics should be calculated.
period integer Period for which statistics should be calculated.

200 -

Field Type
total_price string
start_date string (date)
end_date string (date)

Get resource cost breakdown for a project over a specified period

Get resource cost breakdown for a project over a specified period.

1
2
3
4
http \
  GET \
  https://api.example.com/api/invoice-items/project_costs_for_period/ \
  Authorization:"Token YOUR_API_TOKEN"
1
2
3
4
5
6
7
8
9
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.invoice_items import invoice_items_project_costs_for_period_retrieve # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = invoice_items_project_costs_for_period_retrieve.sync(client=client)

print(response)
  1. API Source: invoice_items_project_costs_for_period_retrieve
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import { invoiceItemsProjectCostsForPeriodRetrieve } from 'waldur-js-client';

try {
  const response = await invoiceItemsProjectCostsForPeriodRetrieve({
  auth: "Token YOUR_API_TOKEN"
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Description
period integer Period for which statistics should be calculated (1, 3 or 12 months).
project_uuid string (uuid) UUID of the project for which statistics should be calculated.

200 -

Field Type
total_price string
start_date string (date)
end_date string (date)

Calculate total price for filtered invoice items

Calculate total price for filtered invoice items.

1
2
3
4
http \
  GET \
  https://api.example.com/api/invoice-items/total_price/ \
  Authorization:"Token YOUR_API_TOKEN"
1
2
3
4
5
6
7
8
9
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.invoice_items import invoice_items_total_price_retrieve # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = invoice_items_total_price_retrieve.sync(client=client)

print(response)
  1. API Source: invoice_items_total_price_retrieve
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import { invoiceItemsTotalPriceRetrieve } from 'waldur-js-client';

try {
  const response = await invoiceItemsTotalPriceRetrieve({
  auth: "Token YOUR_API_TOKEN"
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Description
credit_uuid string (uuid)
customer_uuid string (uuid)
month integer
offering_uuid string (uuid)
project_uuid string (uuid)
resource_uuid string (uuid)
start_month number Start month
start_year number Start year
year integer

200 -

Field Type
total_price string (decimal)

Move invoice item from one invoice to another one

Move invoice item from one invoice to another one.

1
2
3
4
5
http \
  POST \
  https://api.example.com/api/invoice-items/a1b2c3d4-e5f6-7890-abcd-ef1234567890/migrate_to/ \
  Authorization:"Token YOUR_API_TOKEN" \
  invoice="https://api.example.com/api/invoice/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.invoice_item_migrate_to_request import InvoiceItemMigrateToRequest # (1)
from waldur_api_client.api.invoice_items import invoice_items_migrate_to # (2)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)

body_data = InvoiceItemMigrateToRequest(
    invoice="https://api.example.com/api/invoice/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
)
response = invoice_items_migrate_to.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client,
    body=body_data
)

print(response)
  1. Model Source: InvoiceItemMigrateToRequest
  2. API Source: invoice_items_migrate_to
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
import { invoiceItemsMigrateTo } from 'waldur-js-client';

try {
  const response = await invoiceItemsMigrateTo({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  },
  body: {
    "invoice": "https://api.example.com/api/invoice/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)
Field Type Required
invoice string (uri)

200 -

Field Type
invoice string (uri)