Skip to content

feat: allow date/reference updates on authorised credit notes#195

Open
rathga wants to merge 1 commit into
XeroAPI:mainfrom
rathga:feat/update-authorised-credit-note
Open

feat: allow date/reference updates on authorised credit notes#195
rathga wants to merge 1 commit into
XeroAPI:mainfrom
rathga:feat/update-authorised-credit-note

Conversation

@rathga

@rathga rathga commented Jun 10, 2026

Copy link
Copy Markdown

What

Relaxes the DRAFT-only guard on update-credit-note so that AUTHORISED credit notes can have their date and reference updated. Line items and contact remain locked once a credit note is approved, and PAID/VOIDED credit notes are still rejected.

Why

Xero's API (and UI) permit limited edits to an approved credit note — most commonly correcting its date or reference. The MCP currently rejects any update to a non-draft credit note, forcing users into the Xero UI for a simple date fix. This pairs with #194: a fully allocated credit note reports status PAID, so the workflow for correcting it is de-allocate (PAID → AUTHORISED) → fix the date via this tool → re-allocate.

Changes

  • src/handlers/update-xero-credit-note.handler.ts — AUTHORISED credit notes accept date/reference updates; supplying lineItems or contactId for an authorised credit note returns a clear error; other non-draft statuses are rejected as before (with an updated message)
  • src/tools/update/update-credit-note.tool.ts — tool description updated to match

Testing

  • npm run build, npm run lint, npm test all pass
  • Live-verified against a real Xero tenant: re-dated an AUTHORISED (unallocated) credit note successfully; confirmed the handler rejects a line-item update on an AUTHORISED credit note; confirmed a PAID (fully allocated) credit note is still rejected with the new error message. Throwaway fixtures voided/archived afterwards.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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