The invoice module

class magento.models.invoice.Invoice(data, client)[source]View on GitHub

Bases: Model

Wrapper for the invoices endpoint

DOCUMENTATION: str = 'https://adobe-commerce.redoc.ly/2.3.7-admin/tag/invoices'

Link to the Official Magento 2 API documentation for the endpoint wrapped by the Model

IDENTIFIER: str = 'entity_id'

The API response field that the endpoint’s uid comes from

__init__(data, client)[source]View on GitHub

Initialize an Invoice object using an API response from the invoices endpoint

Parameters
  • data (dict) – API response from the invoices endpoint

  • client (Client) – an initialized Client object

property excluded_keys: List[str]

API response keys that shouldn’t be set as object attributes by set_attrs()

Returns

list of API response keys that shouldn’t be set as attributes

property id: int

Alias for entity_id

property number: str

Alias for increment_id

property order: Order

The corresponding Order

property items: List[InvoiceItem]

The invoiced items, returned as a list of InvoiceItem objects

class magento.models.invoice.InvoiceItem(item, invoice)[source]View on GitHub

Bases: Model

Wraps an item entry of an Invoice

DOCUMENTATION: str = 'https://adobe-commerce.redoc.ly/2.3.7-admin/tag/invoicesid'

Link to the Official Magento 2 API documentation for the endpoint wrapped by the Model

IDENTIFIER: str = 'entity_id'

The API response field that the endpoint’s uid comes from

__init__(item, invoice)[source]View on GitHub

Initialize an InvoiceItem of an Invoice

Parameters
  • item (dict) – API response to use as source data

  • invoice (Invoice) – the Invoice that this is an item of

data_endpoint(scope=None)[source]View on GitHub

No data endpoint exists for invoice items

query_endpoint()[source]View on GitHub

No search endpoint exists for invoice items

property excluded_keys: List[str]

API response keys that shouldn’t be set as object attributes by set_attrs()

Returns

list of API response keys that shouldn’t be set as attributes

property order: Order

The Order this item is from

property order_item: OrderItem

The item’s corresponding OrderItem

property product: Product

The item’s corresponding simple Product

property product_id: int

Id of the corresponding simple Product