{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Invoices and Quotes","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":"invoices-and-quotes","__idx":0},"children":["Invoices and Quotes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following hooks are provided for Invoices and Quotes related events."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"acceptquote","__idx":1},"children":["AcceptQuote"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when a client is accepting a quote."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters","__idx":2},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["quoteid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The id of the quote being accepted."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The id of the invoice created for the quote (if applicable)."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response","__idx":3},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code","__idx":4},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('AcceptQuote', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"addinvoicelatefee","__idx":5},"children":["AddInvoiceLateFee"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when a late fee has been added to an invoice"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-1","__idx":6},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-1","__idx":7},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-1","__idx":8},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('AddInvoiceLateFee', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"addinvoicepayment","__idx":9},"children":["AddInvoicePayment"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Invoked when a payment is applied to an invoice (including partial payments)."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-2","__idx":10},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The invoice id payment was applied to"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-2","__idx":11},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-2","__idx":12},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('AddInvoicePayment', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"addtransaction","__idx":13},"children":["AddTransaction"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when a transaction is created. Can be a payment or a refund."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-3","__idx":14},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Transaction reference ID"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["userid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Client ID"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["currency"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Currency ID (if not related to a client, otherwise client currency)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["gateway"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["date"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\\datetime"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["description"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["amountin"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["fees"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["amountout"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["rate"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Exchange rate"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["transid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Transaction reference ID provided by gateway or admin user"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invocieid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invoice ID to which the transaction was applied"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["refundid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ID of original Transaction, if this transaction is a refund"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-3","__idx":15},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-3","__idx":16},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('AddTransaction', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"afterinvoicinggenerateinvoiceitems","__idx":17},"children":["AfterInvoicingGenerateInvoiceItems"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes after invoice generation allowing for after invoicing clean-up."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-4","__idx":18},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No input parameters for this hook point."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-4","__idx":19},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-4","__idx":20},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('AfterInvoicingGenerateInvoiceItems', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"cancelandrefundorder","__idx":21},"children":["CancelAndRefundOrder"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Runs when an order is requested to be cancelled and refunded, prior to the change of status actually occurring."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-5","__idx":22},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["orderid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The order ID"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-5","__idx":23},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-5","__idx":24},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('CancelAndRefundOrder', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"invoicecancelled","__idx":25},"children":["InvoiceCancelled"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when an invoice is being cancelled"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-6","__idx":26},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-6","__idx":27},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-6","__idx":28},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('InvoiceCancelled', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"invoicechangegateway","__idx":29},"children":["InvoiceChangeGateway"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when changing the gateway on an invoice."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-7","__idx":30},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The id of the invoice being updated."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["paymentmethod"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The new payment method selected."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-7","__idx":31},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-7","__idx":32},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('InvoiceChangeGateway', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"invoicecreated","__idx":33},"children":["InvoiceCreated"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executed when an invoice has left \"Draft\" status and is available to its respective client. Execution of this hook occurs after sending the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Invoice Created"]}," email."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-8","__idx":34},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["source"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Indicates where the invoice creation action originated, can be one of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["adminarea"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["autogen"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["user"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["mixed"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The user who initiated the invoice creation (either ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["system"]}," or an admin ID value)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The invoice ID."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["status"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The status of the released invoice."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-8","__idx":35},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-8","__idx":36},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('InvoiceCreated', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"invoicecreation","__idx":37},"children":["InvoiceCreation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when an invoice is first created. The invoice has not been finalised and delivered to the client at this point. Changes can be made to line items at this point. The invoice totals will be recalculated post execution of this hook point."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-9","__idx":38},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["source"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Indicates where the invoice creation action originated, can be one of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["adminarea"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["autogen"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["user"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["mixed"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["User who initiated the invoice creation, either ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["system"]}," or an admin ID value"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ID of the newly created invoice"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["status"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The status of the newly created invoice"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-9","__idx":39},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-9","__idx":40},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('InvoiceCreation', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"invoicecreationpreemail","__idx":41},"children":["InvoiceCreationPreEmail"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes as an invoice is being created in the admin area before the email is being sent"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-10","__idx":42},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["source"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["When the invoice is being created"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["user"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The id of the newly created invoice"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["status"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The status of the newly created invoice"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-10","__idx":43},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-10","__idx":44},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('InvoiceCreationPreEmail', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"invoicepaid","__idx":45},"children":["InvoicePaid"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when an invoice is Paid following the email receipt having been sent and any automation tasks associated with the payment action having been run."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-11","__idx":46},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoice"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\\WHMCS\\Billing\\Invoice"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-11","__idx":47},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-11","__idx":48},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('InvoicePaid', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"invoicepaidpreemail","__idx":49},"children":["InvoicePaidPreEmail"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when an invoice is Paid prior to any email or automation tasks associated with the payment action having been run."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-12","__idx":50},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-12","__idx":51},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-12","__idx":52},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('InvoicePaidPreEmail', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"invoicepaymentreminder","__idx":53},"children":["InvoicePaymentReminder"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when an automated invoice payment reminder is sent."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-13","__idx":54},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["type"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-13","__idx":55},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-13","__idx":56},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('InvoicePaymentReminder', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"invoicerefunded","__idx":57},"children":["InvoiceRefunded"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when an invoice status is changed to Refunded."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-14","__idx":58},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invoice ID"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-14","__idx":59},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-14","__idx":60},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('InvoiceRefunded', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"invoicesplit","__idx":61},"children":["InvoiceSplit"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes as an invoice is being split"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-15","__idx":62},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["originalinvoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The id of the original invoice"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["newinvoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The id of the new invoice"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-15","__idx":63},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-15","__idx":64},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('InvoiceSplit', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"invoiceunpaid","__idx":65},"children":["InvoiceUnpaid"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when an invoice is being marked as Unpaid"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-16","__idx":66},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-16","__idx":67},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-16","__idx":68},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('InvoiceUnpaid', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"logtransaction","__idx":69},"children":["LogTransaction"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Runs any time a payment gateway callback is received and logged."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-17","__idx":70},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["gateway"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The payment gateway name"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["data"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A string formatted version of all post data received"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["result"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The status the gateway module returned"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-17","__idx":71},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-17","__idx":72},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('LogTransaction', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"manualrefund","__idx":73},"children":["ManualRefund"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when an invoice is refunded via the Manual Refund option."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-18","__idx":74},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["transid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Transaction ID of the original payment"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["amount"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The amount to be refunded"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-18","__idx":75},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-18","__idx":76},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('ManualRefund', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"preinvoiceautomaticcancellation","__idx":77},"children":["PreInvoiceAutomaticCancellation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes prior to an invoice being automatically cancelled. Allows the action to be aborted."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-19","__idx":78},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The id of the invoice being automatically cancelled."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-19","__idx":79},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Accepts a return of key/value pairs. Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["abortCancel=true"]}," to abort the automatic cancellation."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-19","__idx":80},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('PreInvoiceAutomaticCancellation', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"preinvoicinggenerateinvoiceitems","__idx":81},"children":["PreInvoicingGenerateInvoiceItems"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes prior to invoice generation to allow for manipulation of stored data prior to aggregation of due items."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-20","__idx":82},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No input parameters for this hook point."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-20","__idx":83},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-20","__idx":84},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\n\nuse WHMCS\\Service\\Service;\n\n/**\n * Prevent invoicing of any new services added to clientID 5\n */\n\nadd_hook('PreInvoicingGenerateInvoiceItems', 1, function() {\n    $services = Service::where('userid', 5)\n        ->where('billingcycle', '!=', 'Free Account')\n        ->get();\n\n    foreach ($services as $service) {\n        $service->billingcycle = 'Free Account';\n        $service->save();\n    }\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"quotecreated","__idx":85},"children":["QuoteCreated"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when a quote is created."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-21","__idx":86},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["quoteid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["status"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-21","__idx":87},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-21","__idx":88},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('QuoteCreated', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"quotestatuschange","__idx":89},"children":["QuoteStatusChange"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when a quote status is updated"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-22","__idx":90},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["quoteid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["status"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-22","__idx":91},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-22","__idx":92},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('QuoteStatusChange', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"updateinvoicetotal","__idx":93},"children":["UpdateInvoiceTotal"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when an invoice is updated with changes to or additions of line items. Can be used to manipulate the invoice."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-23","__idx":94},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The invoice ID."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-23","__idx":95},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-23","__idx":96},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('UpdateInvoiceTotal', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"viewinvoicedetailspage","__idx":97},"children":["ViewInvoiceDetailsPage"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes as the invoice is being viewed as a client"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-24","__idx":98},"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":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["invoiceid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-24","__idx":99},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-24","__idx":100},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('ViewInvoiceDetailsPage', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]}]},"headings":[{"value":"Invoices and Quotes","id":"invoices-and-quotes","depth":1},{"value":"AcceptQuote","id":"acceptquote","depth":2},{"value":"Parameters","id":"parameters","depth":4},{"value":"Response","id":"response","depth":4},{"value":"Example Code","id":"example-code","depth":4},{"value":"AddInvoiceLateFee","id":"addinvoicelatefee","depth":2},{"value":"Parameters","id":"parameters-1","depth":4},{"value":"Response","id":"response-1","depth":4},{"value":"Example Code","id":"example-code-1","depth":4},{"value":"AddInvoicePayment","id":"addinvoicepayment","depth":2},{"value":"Parameters","id":"parameters-2","depth":4},{"value":"Response","id":"response-2","depth":4},{"value":"Example Code","id":"example-code-2","depth":4},{"value":"AddTransaction","id":"addtransaction","depth":2},{"value":"Parameters","id":"parameters-3","depth":4},{"value":"Response","id":"response-3","depth":4},{"value":"Example Code","id":"example-code-3","depth":4},{"value":"AfterInvoicingGenerateInvoiceItems","id":"afterinvoicinggenerateinvoiceitems","depth":2},{"value":"Parameters","id":"parameters-4","depth":4},{"value":"Response","id":"response-4","depth":4},{"value":"Example Code","id":"example-code-4","depth":4},{"value":"CancelAndRefundOrder","id":"cancelandrefundorder","depth":2},{"value":"Parameters","id":"parameters-5","depth":4},{"value":"Response","id":"response-5","depth":4},{"value":"Example Code","id":"example-code-5","depth":4},{"value":"InvoiceCancelled","id":"invoicecancelled","depth":2},{"value":"Parameters","id":"parameters-6","depth":4},{"value":"Response","id":"response-6","depth":4},{"value":"Example Code","id":"example-code-6","depth":4},{"value":"InvoiceChangeGateway","id":"invoicechangegateway","depth":2},{"value":"Parameters","id":"parameters-7","depth":4},{"value":"Response","id":"response-7","depth":4},{"value":"Example Code","id":"example-code-7","depth":4},{"value":"InvoiceCreated","id":"invoicecreated","depth":2},{"value":"Parameters","id":"parameters-8","depth":4},{"value":"Response","id":"response-8","depth":4},{"value":"Example Code","id":"example-code-8","depth":4},{"value":"InvoiceCreation","id":"invoicecreation","depth":2},{"value":"Parameters","id":"parameters-9","depth":4},{"value":"Response","id":"response-9","depth":4},{"value":"Example Code","id":"example-code-9","depth":4},{"value":"InvoiceCreationPreEmail","id":"invoicecreationpreemail","depth":2},{"value":"Parameters","id":"parameters-10","depth":4},{"value":"Response","id":"response-10","depth":4},{"value":"Example Code","id":"example-code-10","depth":4},{"value":"InvoicePaid","id":"invoicepaid","depth":2},{"value":"Parameters","id":"parameters-11","depth":4},{"value":"Response","id":"response-11","depth":4},{"value":"Example Code","id":"example-code-11","depth":4},{"value":"InvoicePaidPreEmail","id":"invoicepaidpreemail","depth":2},{"value":"Parameters","id":"parameters-12","depth":4},{"value":"Response","id":"response-12","depth":4},{"value":"Example Code","id":"example-code-12","depth":4},{"value":"InvoicePaymentReminder","id":"invoicepaymentreminder","depth":2},{"value":"Parameters","id":"parameters-13","depth":4},{"value":"Response","id":"response-13","depth":4},{"value":"Example Code","id":"example-code-13","depth":4},{"value":"InvoiceRefunded","id":"invoicerefunded","depth":2},{"value":"Parameters","id":"parameters-14","depth":4},{"value":"Response","id":"response-14","depth":4},{"value":"Example Code","id":"example-code-14","depth":4},{"value":"InvoiceSplit","id":"invoicesplit","depth":2},{"value":"Parameters","id":"parameters-15","depth":4},{"value":"Response","id":"response-15","depth":4},{"value":"Example Code","id":"example-code-15","depth":4},{"value":"InvoiceUnpaid","id":"invoiceunpaid","depth":2},{"value":"Parameters","id":"parameters-16","depth":4},{"value":"Response","id":"response-16","depth":4},{"value":"Example Code","id":"example-code-16","depth":4},{"value":"LogTransaction","id":"logtransaction","depth":2},{"value":"Parameters","id":"parameters-17","depth":4},{"value":"Response","id":"response-17","depth":4},{"value":"Example Code","id":"example-code-17","depth":4},{"value":"ManualRefund","id":"manualrefund","depth":2},{"value":"Parameters","id":"parameters-18","depth":4},{"value":"Response","id":"response-18","depth":4},{"value":"Example Code","id":"example-code-18","depth":4},{"value":"PreInvoiceAutomaticCancellation","id":"preinvoiceautomaticcancellation","depth":2},{"value":"Parameters","id":"parameters-19","depth":4},{"value":"Response","id":"response-19","depth":4},{"value":"Example Code","id":"example-code-19","depth":4},{"value":"PreInvoicingGenerateInvoiceItems","id":"preinvoicinggenerateinvoiceitems","depth":2},{"value":"Parameters","id":"parameters-20","depth":4},{"value":"Response","id":"response-20","depth":4},{"value":"Example Code","id":"example-code-20","depth":4},{"value":"QuoteCreated","id":"quotecreated","depth":2},{"value":"Parameters","id":"parameters-21","depth":4},{"value":"Response","id":"response-21","depth":4},{"value":"Example Code","id":"example-code-21","depth":4},{"value":"QuoteStatusChange","id":"quotestatuschange","depth":2},{"value":"Parameters","id":"parameters-22","depth":4},{"value":"Response","id":"response-22","depth":4},{"value":"Example Code","id":"example-code-22","depth":4},{"value":"UpdateInvoiceTotal","id":"updateinvoicetotal","depth":2},{"value":"Parameters","id":"parameters-23","depth":4},{"value":"Response","id":"response-23","depth":4},{"value":"Example Code","id":"example-code-23","depth":4},{"value":"ViewInvoiceDetailsPage","id":"viewinvoicedetailspage","depth":2},{"value":"Parameters","id":"parameters-24","depth":4},{"value":"Response","id":"response-24","depth":4},{"value":"Example Code","id":"example-code-24","depth":4}],"frontmatter":{"title":"Invoices and Quotes","seo":{"title":"Invoices and Quotes"}},"lastModified":"2026-08-03T17:00:42.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/hooks-reference/invoices-and-quotes","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}