When you create an invoice in SyncPay, a unique SPTC code is generated simultaneously and pushed to Xero. Your client pays via bank transfer using the SPTC as reference. SyncPay detects the payment and calls the Xero Payments API to mark the invoice paid — before reconciliation is even needed.
The SPTC is the thread that links the invoice in SyncPay, the entry in Xero, and the bank transfer — without needing Xero's bank feed API (which is partner-only and closed).
POST /Invoices with SPTC in Reference field.PUT /Payments — Xero invoice status becomes PAID. Done.Step through a real cycle — from invoice creation to Xero showing PAID, driven by a single SPTC reference.
| Description | Qty | Total |
|---|---|---|
| Xero Integration Module | 1 | $3,200.00 |
| Setup & Onboarding | 1 | $800.00 |
| GST (10%) | $400.00 |
// Step 1: Exchange auth code for tokens // identity.xero.com/connect/token const tokens = await fetch('https://identity.xero.com/connect/token', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams({ grant_type: 'authorization_code', code: authCode, redirect_uri: 'https://syncpay.au/xero/callback', client_id: XERO_CLIENT_ID, client_secret: XERO_CLIENT_SECRET }) }).then(r => r.json()); // Response { "access_token": "eyJhbGci...", // expires 30min "refresh_token": "abc123...", // store securely "token_type": "Bearer", "expires_in": 1800 }
Link your Xero organisation in 30 seconds via OAuth 2.0. Every invoice you raise from that point gets a SPTC, syncs to Xero, and marks itself paid when your client transfers the funds.