xero-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and verify Xero webhooks. Use when setting up Xero webhook handlers, debugging x-xero-signature verification, passing Xero's Intent to Receive (ITR)…
от hookdeck★ 104 звезды на GitHubОб этом скилле
Xero Webhooks
When to Use This Skill
- How do I receive Xero webhooks?
- How do I verify the
x-xero-signatureheader? - Why is my Xero webhook stuck at "'Intent to receive' required" / failing Intent to Receive (ITR)?
- How do I handle
CONTACT,INVOICE,CREDITNOTE,PAYMENT,PREPAYMENT,OVERPAYMENT, orSUBSCRIPTIONevents? - How do I fetch the changed record from a Xero webhook payload?
Verification (core)
Xero signs the raw request body with HMAC-SHA256 keyed on the app's webhook signing key, base64-encodes the digest, and sends it in the x-xero-signature header. Capture the raw body before JSON parsing (parsing re-serializes the bytes and breaks the HMAC). Compare timing-safe. The official SDKs (xero-node, xero-python) do not ship a webhook-signature helper — verify manually.
Node:
const crypto = require('crypto');
function verifyXeroSignature(rawBody, signatureHeader, signingKey) {
if (!signatureHeader) return false;
const expected = crypto.createHmac('sha256', signingKey).update(rawBody).digest('base64');
try {
return crypto.timingSafeEqual(Buffer.from(signatureHeader), Buffer.from(expected));
} catch {
return false; // length mismatch = invalid
}
}
Python:
import hmac, hashlib, base64
def verify_xero_signature(raw_body: bytes, signature_header: str, signing_key: str) -> bool:
if not signature_header:
return False
expected = base64.b64encode(
hmac.new(signing_key.encode(), raw_body, hashlib.sha256).digest()
).decode()
return hmac.compare_digest(signature_header, expected)
Intent to Receive (ITR): After you save the webhook, you start the ITR validation from the portal. Xero POSTs correctly and incorrectly signed payloads (with an empty
eventsarray) and your server MUST respond within 5 seconds: a 2xx when the signature matches, HTTP 401 when it does not. Anything else (including a 400) fails ITR and the webhook stays at 'Intent to receive' required, so no events are delivered. Return401— not400— for a bad signature. The same verify-then-200/401 logic serves both ITR probes and real events.
For complete handlers with route wiring, event dispatch, and tests, see:
Payload Structure
Xero payloads are thin — they tell you what changed, not the record itself. Call resourceUrl (authenticated with an OAuth2 access token + Xero-tenant-id) to fetch the full record.
Xero's example (from its webhooks OpenAPI spec):
{
"events": [
{
"resourceUrl": "https://api.xero.com/api.xro/2.0/Contacts/717f2bfc-c6d4-41fd-b238-3f2f0c0cf777",
"resourceId": "717f2bfc-c6d4-41fd-b238-3f2f0c0cf777",
"eventDateUtc": "2024-06-21T01:15:39.902",
"eventType": "UPDATE",
"eventCategory": "CONTACT",
"tenantId": "c2cc9b6e-9458-4c7d-93cc-f02b81b0594f",
"tenantType": "ORGANISATION"
}
],
"lastEventSequence": 1,
"firstEventSequence": 1,
"entropy": "S0m3r4Nd0mt3xt"
}
events may contain more than one item. Credit note, payment, prepayment and overpayment events also carry a small data object (type and status). If your endpoint doesn't answer with a 2xx in time, Xero retries immediately and then for up to 24 hours before disabling the webhook, and it replays held events after you re-enable it, so the same event can arrive more than once. Xero tells consumers to implement idempotency; events have no ID, so dedupe on eventCategory + eventType + resourceId + eventDateUtc.
Common Event Types
Dispatch on the combined eventCategory/eventType (e.g. CONTACT/CREATE). The spec's eventType values are CREATE and UPDATE, but some of Xero's page examples print Update, so upper-case eventType before comparing.
Category (eventCategory) |
Types (eventType) |
Triggered When |
|---|---|---|
CONTACT |
CREATE, UPDATE |
A contact is created or changed |
INVOICE |
CREATE, UPDATE |
An invoice is created or changed (including archived) |
CREDITNOTE |
CREATE, UPDATE |
A credit note is created or changed |
PAYMENT |
CREATE, UPDATE |
A payment is created (data.Status AUTHORISED) or deleted (UPDATE, data.Status DELETED) |
PREPAYMENT |
CREATE, UPDATE |
A prepayment is created or changed |
OVERPAYMENT |
CREATE, UPDATE |
An overpayment is created or changed |
SUBSCRIPTION |
CREATE, UPDATE |
A Xero App Store subscription is created or changes (upgrade, downgrade, cancel, renew) |
tenantType is ORGANISATION, or APPLICATION for subscription events.
For the full reference, see [Xero webhooks documentation](https://developer.xero.com/documentation/guides/webhooks/overvie
Установить xero-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл xero-webhooks?
Receive and verify Xero webhooks. Use when setting up Xero webhook handlers, debugging x-xero-signature verification, passing Xero's Intent to Receive (ITR) validation, or handling accounting events like CONTACT/CREATE, INVOICE/UPDATE, PAYMENT, CREDITNOTE, and SUBSCRIPTION changes.
Как установить скилл xero-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл xero-webhooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
gtm-enterprise-account-planning
Strategic account planning and execution for enterprise deals. Use when planning complex sales cycles, managing multiple stakeholders, applying MEDDICC…
от GitHubgtm-partnership-architecture
Build and scale partner ecosystems that drive revenue and platform adoption. Use when building partner programs from scratch, tiering partnerships, managing…
от GitHublanding-page-conversion-audit
Audit a landing page, sales page or checkout page for conversion leaks and return a fix list ordered by expected revenue impact. Use when asked to review…
от GitHubpower-platform-architect
Use this skill when the user needs to transform business requirements, use case descriptions, or meeting transcripts into a technical Power Platform solution…
от GitHub