Xero
List Bank Transactions
Paginated, filterable, sortable list of locally-cached Xero bank transactions (synced from Xero's BankTransactions API).
Get Bank Transaction Detail
Full detail view for a single cached Xero bank transaction — header, contact, bank account, amounts, every line item, and the raw Xero `json_object` payload.
Sync Bank Transactions from Xero
Dispatch a tracked background sync that pulls bank transactions from Xero's BankTransactions API into the local cache (paged 100/request, upserted by BankTransactionID).
Generate OAuth URL
Generate a Xero OAuth 2.0 authorization URL to initiate the connection flow. Redirect the user to the returned URL to authenticate with Xero.
List Integration Instances
List all Xero integration instances. Used by the application UI to determine whether to show the empty state (Connect to Xero) or the dashboard.
Update Integration Instance
Update Xero integration settings. All fields are optional.
Delete Integration Instance
Delete a Xero integration instance and all associated data.
Show Dashboard
Get the Xero integration dashboard data including integration status, connection health, entity counts, and webhook summary.
Download Accounts from Xero
Fetch and sync all accounts from the Xero API into the local database.
Create Nominal Codes from Accounts
Create SKU.io nominal codes from selected Xero account records. Requires an active Xero accounting integration.
Create Account in Xero (asset)
Create a GL account in the connected Xero tenant and mirror it locally. Type is restricted to Xero ASSET types (CURRENT/FIXED/NONCURRENT) — used by the onboarding flow to provision a missing inventory ASSET account (Xero won't let you post inventory journal movements to an INVENTORY-type account). Requires a connected Xero accounting integration.
Nominal Code → Xero Account Suggestions
Smart-default suggestions for the onboarding mapping step: for each SKU nominal code, the Xero account it most likely maps to (matched by exact code → type → name). Read-only.
Map Nominal Codes → Xero Accounts
Persist SKU nominal code → Xero account mappings (polymorphic integration_account link). Enforces the inventory→ASSET guard: rejects mapping any code to a Xero INVENTORY-type account, and requires the inventory-control role's code to map to an ASSET-class account (422 otherwise).
Adopt Xero Chart of Accounts (hard-replace)
Onboarding: hard-replace SKU's chart of accounts with Xero's. Imports every mapped Xero account as a nominal code, re-points every reference (sales order lines, settings roles, product/channel/warehouse overrides, …) onto the replacements, then deletes the old chart. EVERY existing nominal code must appear in `mappings` (a complete old→new map is what makes the delete safe) — otherwise 422-equivalent failure listing the unmapped ids. Runs as a tracked job; returns its log id so the UI can follow progress via the tracked job log endpoints. Pass `repost: true` to also repost every current ledger entry after the replace (chained inside the job) so posted GL lines pick up the new accounts.
Download Tax Rates from Xero
Fetch and sync tax rates from the Xero API.
Sync Contacts
Push your suppliers to Xero as contacts — creates or updates the matching Xero contact for each supplier. Requires a connected Xero integration with syncing active.
Link Contact to SKU Entity
Link this Xero contact to a SKU.io customer or supplier via its polymorphic reverse link. Provide `link_type` (the SKU.io model class — `App\\Models\\Customer` or `App\\Models\\Supplier`) and `link_id` (that record's ID). Returns the updated contact with its resolved `sku_link_type`, `sku_link_id`, and `sku_link_reference`.
Unlink Contact from SKU Entity
Clear this Xero contact's link to a SKU.io customer or supplier (nulls the polymorphic reverse link). Read-safe — leaves the contact record otherwise untouched.
List Accounts (V2)
Paginated list of Xero accounts with advanced filtering via Spatie QueryBuilder + GroupedFilterSupport.
List Tax Rates (V2)
Paginated list of Xero tax rates.
List Contacts (V2)
Paginated list of Xero contacts with advanced filtering.
List Invoices (V2)
Paginated list of Xero invoices (ACCREC type) with advanced filtering via Spatie QueryBuilder + GroupedFilterSupport.
List Bills (V2)
Paginated list of Xero bills (ACCPAY type). Same filter and sort options as invoices.
List Credit Notes (V2)
Paginated list of Xero credit notes. Same filter and sort options as invoices.
List Purchase Orders (V2)
Paginated list of Xero purchase orders. Same filter and sort options as invoices.
List Manual Journals (V2)
Paginated list of Xero manual journal entries.
List Journals (V2)
Paginated list of Xero general-ledger journal lines.
Get Journal Detail (V2)
Detail view of a single Xero general-ledger journal, grouped by journal_number.
List Payments (V2)
Paginated list of Xero payments. Payments use a payment relation (not accountingTransaction) to link to SKU.io Payment entities.
Get Account (V2)
Detail view-model for a single Xero account (chart of accounts) — backs the /v2/integrations/xero/accounts/{id} detail page. Returns the stored generated columns, descriptive fields that only live in the raw Xero json_object payload, the linked SKU nominal code, and local sync metadata.
Get Bill (V2)
Get a single synced Xero bill (an ACCPAY invoice in Xero) — header fields, line items, the reverse link to the SKU.io record it was generated from, and sync metadata (`sync_status`, `last_error`, and `url`, a deep link to the bill in Xero). Monetary amounts are in the bill's currency; datetimes are UTC ISO-8601.
Get Contact (V2)
Get a single synced Xero contact — name, primary email/phone, customer/supplier flags, status, addresses, the reverse link to the SKU.io customer or supplier it maps to (`sku_link_type`/`sku_link_id`), and sync metadata (`last_error`, plus `url`, a deep link to the contact in Xero).
Get Credit Note (V2)
Get a single synced Xero credit note (ACCRECCREDIT) — header fields including `remaining_credit`, line items, the reverse link to the SKU.io record it was generated from, and sync metadata (`sync_status`, `last_error`, and `url`, a deep link to the credit note in Xero). Monetary amounts are in the credit note's currency; datetimes are UTC ISO-8601.
Get Invoice (V2)
Get a single synced Xero sales invoice (ACCREC) — header fields, line items, the reverse link to the SKU.io record it was generated from, and sync metadata (`sync_status`, `last_error`, and `url`, a deep link to the invoice in Xero). Monetary amounts are in the invoice's currency; datetimes are UTC ISO-8601.
Get Manual Journal (V2)
Get a single synced Xero manual journal — status, narration, journal lines (positive amounts are debits, negative are credits), the reverse link to the SKU.io record it was generated from, and sync metadata (`sync_status`, `last_error`, and `url`, a deep link to the journal in Xero). Datetimes are UTC ISO-8601.
Get Payment (V2)
Get a single synced Xero payment — amount, bank account, reconciliation state, the Xero invoice it was applied to (`invoice_id`/`invoice_number`), the reverse link to the SKU.io payment's source record (`sku_link_type`/`sku_link_id`/`sku_link_reference`), and sync metadata. Payments have no line items and no accounting-transaction link; sync health is derived from `last_error` (null = OK). Datetimes are UTC ISO-8601.
Get Purchase Order (V2)
Get a single synced Xero purchase order — header and delivery fields, line items, the reverse link to the SKU.io accounting transaction and purchase order it was generated from (`at_id`/`at_reference`, `sku_link_type`/`sku_link_id`), and sync metadata (`sync_status`, `last_error`, and `url`, a deep link to the purchase order in Xero). Monetary amounts are in the order's currency; datetimes are UTC ISO-8601.
Get Tax Rate (V2)
Get a single synced Xero tax rate — name, tax type, effective rate, status, applicability flags (`can_apply_to_*`), and the individual tax components that make up the rate. Tax rates are configuration records: they carry no line items and no reverse SKU.io link.
Get Account Activity Log (V2)
Paginated change history for a single synced Xero account — one entry per recorded change, newest first. Each entry includes the change type (`event`: created / updated / deleted / bulk_upsert), the changed field values (`properties.attributes` = new values, `properties.old` = previous values), the source tag of whatever made the change (`properties.source`), an optional `batch_uuid` grouping changes made by one bulk operation, and `causer_name` (the user who triggered it; null for system/sync changes).
Get Bill Activity Log (V2)
Paginated change history for a single synced Xero bill — one entry per recorded change, newest first. Each entry includes the change type (`event`: created / updated / deleted / bulk_upsert), the changed field values (`properties.attributes` = new values, `properties.old` = previous values), the source tag of whatever made the change (`properties.source`), an optional `batch_uuid` grouping changes made by one bulk operation, and `causer_name` (the user who triggered it; null for system/sync changes).
Get Contact Activity Log (V2)
Paginated change history for a single synced Xero contact — one entry per recorded change, newest first. Each entry includes the change type (`event`: created / updated / deleted / bulk_upsert), the changed field values (`properties.attributes` = new values, `properties.old` = previous values), the source tag of whatever made the change (`properties.source`), an optional `batch_uuid` grouping changes made by one bulk operation, and `causer_name` (the user who triggered it; null for system/sync changes).
Get Credit Note Activity Log (V2)
Paginated change history for a single synced Xero credit note — one entry per recorded change, newest first. Each entry includes the change type (`event`: created / updated / deleted / bulk_upsert), the changed field values (`properties.attributes` = new values, `properties.old` = previous values), the source tag of whatever made the change (`properties.source`), an optional `batch_uuid` grouping changes made by one bulk operation, and `causer_name` (the user who triggered it; null for system/sync changes).
Get Invoice Activity Log (V2)
Paginated change history for a single synced Xero invoice — one entry per recorded change, newest first. Each entry includes the change type (`event`: created / updated / deleted / bulk_upsert), the changed field values (`properties.attributes` = new values, `properties.old` = previous values), the source tag of whatever made the change (`properties.source`), an optional `batch_uuid` grouping changes made by one bulk operation, and `causer_name` (the user who triggered it; null for system/sync changes).
Get Manual Journal Activity Log (V2)
Paginated change history for a single synced Xero manual journal — one entry per recorded change, newest first. Each entry includes the change type (`event`: created / updated / deleted / bulk_upsert), the changed field values (`properties.attributes` = new values, `properties.old` = previous values), the source tag of whatever made the change (`properties.source`), an optional `batch_uuid` grouping changes made by one bulk operation, and `causer_name` (the user who triggered it; null for system/sync changes).
Get Payment Activity Log (V2)
Paginated change history for a single synced Xero payment — one entry per recorded change, newest first. Each entry includes the change type (`event`: created / updated / deleted / bulk_upsert), the changed field values (`properties.attributes` = new values, `properties.old` = previous values), the source tag of whatever made the change (`properties.source`), an optional `batch_uuid` grouping changes made by one bulk operation, and `causer_name` (the user who triggered it; null for system/sync changes).
Get Purchase Order Activity Log (V2)
Paginated change history for a single synced Xero purchase order — one entry per recorded change, newest first. Each entry includes the change type (`event`: created / updated / deleted / bulk_upsert), the changed field values (`properties.attributes` = new values, `properties.old` = previous values), the source tag of whatever made the change (`properties.source`), an optional `batch_uuid` grouping changes made by one bulk operation, and `causer_name` (the user who triggered it; null for system/sync changes).
Get Tax Rate Activity Log (V2)
Paginated change history for a single synced Xero tax rate — one entry per recorded change, newest first. Each entry includes the change type (`event`: created / updated / deleted / bulk_upsert), the changed field values (`properties.attributes` = new values, `properties.old` = previous values), the source tag of whatever made the change (`properties.source`), an optional `batch_uuid` grouping changes made by one bulk operation, and `causer_name` (the user who triggered it; null for system/sync changes).
Export Accounts (V2)
Download the synced Xero chart of accounts as a CSV or XLSX file. Exports every account matching the given filters (no pagination) using the same filter parameters as List Accounts (V2). The response is a file attachment named `xero-accounts-<timestamp>.<format>`.
Show Webhook Settings
Get the webhook settings for a Xero integration instance. Lazily generates a webhook UUID if one doesn't exist. Returns a masked signing key preview (first 4 + last 4 chars) and the 20 most recent webhook events.
Update Webhook Settings
Enable or disable Xero webhooks and update the signing key. Key rotation is supported with a 1-hour grace period for the previous key.
List Webhook Events
Paginated feed of the webhook events Xero has delivered for this connection, newest first (by `event_date_utc`). Each event records what changed in Xero (`event_category` CONTACT / INVOICE / CREDITNOTE, `event_type` CREATE / UPDATE, `resource_id` — the Xero GUID), how it was handled (`status`: received, processing, processed, failed, duplicate, ignored; `processing_attempts`; `error_message`), the raw event payload as delivered by Xero, and `app_link`/`app_link_label` — a path to the synced record inside SKU.io (null until the referenced record has been synced in).
Bulk Delete Webhook Events
Permanently delete webhook events in bulk. This only removes the stored event records (the audit feed); it does not undo any data changes the events triggered. Requires an explicit `confirmation` value of `YES`.
Get Webhook Events Summary
Per-status counts of every webhook event received for this connection, plus a `total`. Every known status is always present (zero-filled): received, processing, processed, failed, duplicate, ignored. Useful for monitoring webhook processing health — a growing `failed` count indicates events that need to be retried (see Retry Failed Webhook Events).
Reprocess Webhook Events
Reprocess webhook events in bulk: each targeted event is reset to `received` status and a background job is queued per event to re-fetch the referenced record's current state from Xero. Returns immediately with the number of events queued; processing happens asynchronously.
Retry Failed Webhook Events
Reprocess every currently-failed webhook event for this connection in one call — equivalent to Reprocess Webhook Events with all failed event IDs. Each failed event is reset to `received` and a background job is queued per event; the call returns immediately with the number of events queued, and processing happens asynchronously. No request body is required.
Reprocess Webhook Event
Reprocess a single webhook event: resets it to `received` status and queues a background job that re-fetches the referenced record's current state from Xero. Returns the refreshed event immediately (status `received`, pending the queued job); processing happens asynchronously.
Delete All Webhook Events
Permanently delete every stored webhook event for this connection. This only clears the event history; it does not undo any data changes the events triggered, and it does not disable webhooks. Requires an explicit `confirmation` value of `YES`.