Skip to content

feat: add linked-transaction (billable expense) tools + surface Line Item ID#191

Open
rathga wants to merge 6 commits into
XeroAPI:mainfrom
rathga:feat/linked-transactions
Open

feat: add linked-transaction (billable expense) tools + surface Line Item ID#191
rathga wants to merge 6 commits into
XeroAPI:mainfrom
rathga:feat/linked-transactions

Conversation

@rathga

@rathga rathga commented Jun 8, 2026

Copy link
Copy Markdown

Adds four thin-wrapper tools mapping 1:1 to the SDK: list-linked-transactions, create-linked-transaction, update-linked-transaction, and delete-linked-transaction. These cover the billable-expense flow — marking a cost on a source bill (ACCPAY) line as billable to a customer (stage 1) and allocating it onto that customer's sales invoice line (stage 2). Also surfaces each line's Line Item ID in formatLineItem, which the flow depends on to obtain source/target line IDs (with a Vitest test, matching the repo's helper-test convention). Mirrors the existing list-credit-notes / create-invoice / update-invoice / delete-payroll-timesheet patterns.

🤖 Generated with Claude Code

rathga and others added 6 commits June 8, 2026 20:00
…ense prep)

create-linked-transaction needs a bill line's sourceLineItemId, and the only
way to read line-item IDs via MCP is list-invoices. Until now that tool only
printed line items when filtering by invoiceNumbers — but email-imported bills
frequently have no InvoiceNumber, so their line-item IDs were unreadable and
the billable-expense flow couldn't be driven for them.

Add an invoiceIds filter to list-invoices (threaded into the existing getInvoices
iDs slot) and return line items for invoiceIds fetches as well, so any bill —
numbered or not — can have its Line Item IDs read by ID. This completes the
"surface Line Item ID" half of this PR for the no-InvoiceNumber case.

Note: PR XeroAPI#110 also introduces an invoiceIds filter (among broader list-invoices
filters); this adds the minimal slice needed for the linked-transaction flow and
supersedes that part of XeroAPI#110 for this purpose.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rathga

rathga commented Jun 15, 2026

Copy link
Copy Markdown
Author

Pushed ac144e1: adds a minimal invoiceIds filter to list-invoices and returns line items for invoiceIds fetches, so a bill's Line Item IDs can be read by ID even when it has no InvoiceNumber (common for email-imported bills). That Line Item ID is exactly the sourceLineItemId that create-linked-transaction needs, so this completes the "surface Line Item ID" half of this PR for the numberless-bill case.

Heads-up on overlap: #110 also introduces an invoiceIds filter, as part of a broader list-invoices filter set. This PR only adds the minimal invoiceIds slice needed to drive the linked-transaction flow; happy to rebase onto / defer to #110's version if that lands first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant