{"templateId":"markdown","versions":[{"version":"9.0","label":"9.0","link":"/classes/whmcs/billing/invoice/item","default":true,"active":true,"folderId":"9d7dc099"},{"version":"8.13","label":"8.13","link":"/classes/8.13/whmcs/billing/invoice/item","default":false,"active":false,"folderId":"9d7dc099"}],"sharedDataIds":{"sidebar":"sidebar-classes/@8.13/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"WHMCS\\Billing\\Invoice\\Item","description":"Developer documentation for the WHMCS API — the","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"whmcsbillinginvoiceitem","__idx":0},"children":["WHMCS\\Billing\\Invoice\\Item"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Class"]}," · extends ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AbstractModel"]}," · implements ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["InvoiceItemInterface"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ImmutableModelInterface"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Invoice line items"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each invoice is made up of individual line items."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each line item is associated with a specific invoiceId."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"traits","__idx":1},"children":["Traits"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ImmutableModelTrait"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"properties","__idx":2},"children":["Properties"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["``"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$timestamps"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"methods","__idx":3},"children":["Methods"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"boot","__idx":4},"children":["boot"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public static function boot()\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"isimmutable","__idx":5},"children":["isImmutable"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function isImmutable(): bool\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"validatemutability","__idx":6},"children":["validateMutability"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function validateMutability(?string $attribute): void\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"throwimmutabilityexception","__idx":7},"children":["throwImmutabilityException"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function throwImmutabilityException(string $message = '', string $column = ''): never\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Parameters"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$message"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Exception message, leave empty for default"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$column"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["If specified, offending column name will be added to the exception message."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Returns"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["never"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"invoice","__idx":8},"children":["invoice"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function invoice()\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each invoice item belongs to an invoice."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Returns"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\\Illuminate\\Database\\Eloquent\\Relations\\BelongsTo"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"addon","__idx":9},"children":["addon"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function addon()\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Returns"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\\Illuminate\\Database\\Eloquent\\Relations\\BelongsTo"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"domain","__idx":10},"children":["domain"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function domain()\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Returns"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\\Illuminate\\Database\\Eloquent\\Relations\\BelongsTo"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"service","__idx":11},"children":["service"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function service()\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Returns"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\\Illuminate\\Database\\Eloquent\\Relations\\BelongsTo"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"scopeonlyservices","__idx":12},"children":["scopeOnlyServices"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function scopeOnlyServices($query)\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"scopeonlyaddons","__idx":13},"children":["scopeOnlyAddons"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function scopeOnlyAddons($query)\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"scopeonlydomains","__idx":14},"children":["scopeOnlyDomains"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function scopeOnlyDomains($query)\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"scopeclientid","__idx":15},"children":["scopeClientId"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function scopeClientId(Builder $query, int $userId)\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"scopenotinvoiced","__idx":16},"children":["scopeNotInvoiced"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function scopeNotInvoiced(Builder $query)\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"getrelatedentity","__idx":17},"children":["getRelatedEntity"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function getRelatedEntity()\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Returns"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Service\\|Domain\\|Addon\\|null"]}]}]},"headings":[{"value":"WHMCS\\Billing\\Invoice\\Item","id":"whmcsbillinginvoiceitem","depth":1},{"value":"Traits","id":"traits","depth":2},{"value":"Properties","id":"properties","depth":2},{"value":"Methods","id":"methods","depth":2},{"value":"boot","id":"boot","depth":3},{"value":"isImmutable","id":"isimmutable","depth":3},{"value":"validateMutability","id":"validatemutability","depth":3},{"value":"throwImmutabilityException","id":"throwimmutabilityexception","depth":3},{"value":"invoice","id":"invoice","depth":3},{"value":"addon","id":"addon","depth":3},{"value":"domain","id":"domain","depth":3},{"value":"service","id":"service","depth":3},{"value":"scopeOnlyServices","id":"scopeonlyservices","depth":3},{"value":"scopeOnlyAddons","id":"scopeonlyaddons","depth":3},{"value":"scopeOnlyDomains","id":"scopeonlydomains","depth":3},{"value":"scopeClientId","id":"scopeclientid","depth":3},{"value":"scopeNotInvoiced","id":"scopenotinvoiced","depth":3},{"value":"getRelatedEntity","id":"getrelatedentity","depth":3}],"frontmatter":{"title":"WHMCS\\Billing\\Invoice\\Item","seo":{"title":"WHMCS\\Billing\\Invoice\\Item"}},"lastModified":"2026-08-05T14:37:16.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/classes/whmcs/billing/invoice/item","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}