Repository navigation
feat(xero): add Xero integration - #249
Open
RishadAlam wants to merge 6 commits into
Open
RishadAlam wants to merge 6 commits into
RishadAlam wants to merge 6 commits into
Conversation
XeroController uses the OAuth2 connection, finds the organisation from the token's auth event and caches its tenant ID on the connection, and serves the contact, account, item, tax rate, currency and branding theme lists. RecordApiHelper sends each of the 71 actions to its Pro hook.
OAuth connection, 71 Pro actions with one line per document, a contact dropdown, and selects for fixed options and fetched lists.
Remove the unused utilities config, mark locked required rows, give the list routes a fallback error, and add notes for contact, account, bank transfer, batch payment and ID-only actions.
Xero rejects DAYSAFTERINVOICEDATE and DAYSAFTERBILLMONTH for repeating invoices. Also tell users to pick the receivable or payable account for an overpayment.
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
Reject connections that belong to another app, report Xero's error when the organisation lookup fails, use the full organisation list only when it holds one organisation, build dropdown labels once per list, and keep the developer portal sentence in one translatable string.
Member
Author
Self-review: findings and fixes (f5cac84)Fixed
Kept as is
Verified live: organisation rediscovery after |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Adds Xero as a Bit Integrations action with 71 write actions. The free plugin owns the connection, the dropdown lists and the screens. The actions run in Pro: https://github.com/bit-apps-pro/bit-integrations-pro/pull/169
Motivation & Context
Xero is a widely used accounting app. This ports the bit-pi Xero integration (Bit-Apps-Pro/bit-pi#891). Only write actions are ported (create, update, approve, void, delete, allocate, email, attach, download PDF). The bit-pi webhook triggers are left out.
Type of Change
Key Changes
Backend (
backend/Actions/Xero)XeroController.$authConfigOAuth2. The core OAuth2 handler already stores the rotating Xero refresh token.xero-tenant-idheader. The controller reads theauthentication_event_idfrom the access token, asksGET /connections?authEventId=for the organisation picked on the consent screen, and cachestenant_idin the connection.RecordApiHelper: oneswitchcase per action fires its ownxero_*hook with the field map, the API client and the dropdown settings, then callsLogHandler::save.Frontend (
AllIntegrations/Xero)Authorizationwith Xero's granular scopes (accounting.contacts,.settings,.attachments,.invoices,.payments,.banktransactions,.manualjournals). Apps created after 2 March 2026 must use these scopes.staticData.js.*), the wizard and the edit screens. Changing the action clears every dropdown value, so a value from another action is never sent.NewInteg,EditInteg,IntegInfo,SelectActionandtutorialLinks, plus a 128px logo.Testing
DAYSAFTERINVOICEDATE) andDAYSAFTERBILLMONTHdue date types for repeating invoices. The list now offers only the four types Xero accepts.--max-warnings=0) and Prettier are clean. PHP passesphp -l, PHPCompatibilityWP 7.4+ and php-cs-fixer.Checklist
Changelog
🤖 Generated with Claude Code