xero_invoices_update_status
Update an invoice's status to submitted, authorised, or voided.
Instructions
Update the status of an existing invoice. Can submit, authorise, or void an invoice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| invoiceId | Yes | The invoice ID to update (required) | |
| Status | Yes | New status for the invoice (required) |
Implementation Reference
- src/domains/invoices.ts:235-248 (handler)The handler function that executes the 'xero_invoices_update_status' tool logic. It extracts invoiceId and Status from args and makes a POST request to Invoices/{invoiceId} to update the invoice status.
case "xero_invoices_update_status": { const { invoiceId, Status } = args as { invoiceId: string; Status: string; }; const response = await client.post(`Invoices/${invoiceId}`, { InvoiceID: invoiceId, Status, }); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }], }; } - src/domains/invoices.ts:121-140 (schema)The schema definition for the tool, defining its name, description, and input validation (invoiceId string + Status enum of SUBMITTED, AUTHORISED, VOIDED, both required).
{ name: "xero_invoices_update_status", description: "Update the status of an existing invoice. Can submit, authorise, or void an invoice.", inputSchema: { type: "object", properties: { invoiceId: { type: "string", description: "The invoice ID to update (required)", }, Status: { type: "string", enum: ["SUBMITTED", "AUTHORISED", "VOIDED"], description: "New status for the invoice (required)", }, }, required: ["invoiceId", "Status"], }, }, - src/index.ts:258-259 (registration)The tool routing/registration in the main index.ts file. All xero_invoices_* tools (including xero_invoices_update_status) are routed to handleInvoiceTool.
if (name.startsWith("xero_invoices_")) { return await handleInvoiceTool(name, toolArgs); - src/domains/invoices.ts:12-141 (helper)The invoiceTools array (and the handleInvoiceTool function) are exported from invoices.ts and imported into index.ts, linking the tool definitions and handler to the main server.
export const invoiceTools: Tool[] = [ { name: "xero_invoices_list", description: "List invoices in Xero with pagination. Optionally filter by status and type (ACCREC for sales, ACCPAY for bills).", inputSchema: { type: "object", properties: { page: { type: "number", description: "Page number (1-based, default: 1). Each page returns up to 100 invoices.", }, Status: { type: "string", enum: ["DRAFT", "SUBMITTED", "AUTHORISED", "PAID", "VOIDED", "DELETED"], description: "Filter by invoice status", }, Type: { type: "string", enum: ["ACCREC", "ACCPAY"], description: "Filter by invoice type: ACCREC (accounts receivable / sales invoices) or ACCPAY (accounts payable / bills)", }, }, }, }, { name: "xero_invoices_get", description: "Get detailed information about a specific invoice by its ID. Returns full invoice details including line items, amounts, and payment status.", inputSchema: { type: "object", properties: { invoiceId: { type: "string", description: "The unique invoice ID (UUID)", }, }, required: ["invoiceId"], }, }, { name: "xero_invoices_create", description: "Create a new invoice in Xero. Requires type, contact, and at least one line item.", inputSchema: { type: "object", properties: { Type: { type: "string", enum: ["ACCREC", "ACCPAY"], description: "Invoice type: ACCREC (sales invoice) or ACCPAY (bill) (required)", }, ContactID: { type: "string", description: "The contact ID to create the invoice for (required)", }, LineItems: { type: "array", description: "Array of line items (required). Each item needs Description, Quantity, UnitAmount, and AccountCode.", items: { type: "object", properties: { Description: { type: "string", description: "Line item description", }, Quantity: { type: "number", description: "Quantity", }, UnitAmount: { type: "number", description: "Unit price", }, AccountCode: { type: "string", description: "Account code for the line item", }, TaxType: { type: "string", description: "Tax type code (e.g., OUTPUT, INPUT, NONE)", }, }, required: ["Description", "Quantity", "UnitAmount", "AccountCode"], }, }, Date: { type: "string", description: "Invoice date in YYYY-MM-DD format", }, DueDate: { type: "string", description: "Due date in YYYY-MM-DD format", }, Reference: { type: "string", description: "Invoice reference/PO number", }, Status: { type: "string", enum: ["DRAFT", "SUBMITTED", "AUTHORISED"], description: "Initial invoice status (default: DRAFT)", }, }, required: ["Type", "ContactID", "LineItems"], }, }, { name: "xero_invoices_update_status", description: "Update the status of an existing invoice. Can submit, authorise, or void an invoice.", inputSchema: { type: "object", properties: { invoiceId: { type: "string", description: "The invoice ID to update (required)", }, Status: { type: "string", enum: ["SUBMITTED", "AUTHORISED", "VOIDED"], description: "New status for the invoice (required)", }, }, required: ["invoiceId", "Status"], }, }, ];