1. Overview
1.1 What This Integration Does
The Younium Xero Integration provides three core capabilities:
| Capability | Direction | Description |
|---|---|---|
| Account Import | Xero → Younium | Imports customer contacts from Xero as accounts in Younium |
| Account Export | Younium → Xero | Exports Younium accounts to Xero as contacts |
| Product Import | Xero → Younium | Imports Xero items as Younium products with charge plans |
| Invoice Posting | Younium → Xero | Automatically posts Younium invoices to Xero |
1.2 Key Features
- ✅ Bi-directional account sync - Keep customer data in sync between systems
- ✅ Incremental sync - Only syncs changed records after initial import
- ✅ Automatic invoice posting - Post invoices to Xero when posted in Younium
- ✅ Product catalog sync - Import Xero items as Younium products
- ✅ Multi-currency support - Handles different currencies with exchange rates
- ✅ Address synchronization - Syncs both invoice and delivery addresses
- ✅ Payment terms mapping - Automatically creates and maps payment terms
- ✅ Tax code mapping - Maps Xero tax codes to Younium custom fields
- ✅ Chart of accounts mapping - Maps Xero sales accounts to Younium custom fields
1.3 Prerequisites
Before setting up the integration, ensure you have:
- ✅ Younium Administrator Access - Required to configure integration settings
- ✅ Xero Organization Access - Must have access to the Xero organization you want to connect
- ✅ Xero Tenant Name - The exact name of your Xero organization (case-sensitive)
- ✅ Matching Currencies - Currencies used in Xero must exist in Younium
2. Authentication & Setup
2.1 Initial Configuration
Step 1: Navigate to Settings
- Log into Younium
- Go to Settings > Integrations > Xero
Step 2: Enter Xero Tenant Name
- In the Xero settings page, enter your Xero Tenant Name
- This must match exactly with your Xero organization name (case-sensitive)
- Example: “My Company Ltd” or “ACME Corporation”
Step 3: Authenticate
- Click Authenticate
- You will be redirected to Xero’s login page
- Log in with your Xero credentials
- Authorize Younium to access your Xero organization
- You will be redirected back to Younium
2.2 OAuth2 Scopes
The integration requests the following Xero permissions:
accounting.transactions- Read and write invoicesaccounting.transactions.read- Read invoice dataaccounting.reports.read- Access to reportsaccounting.journals.read- Read journal entriesaccounting.settings- Read and write settingsaccounting.settings.read- Read settingsaccounting.contacts- Read and write contacts (accounts)accounting.contacts.read- Read contactsaccounting.attachments- Read and write attachmentsaccounting.attachments.read- Read attachmentsoffline_access- Maintain connection without re-authentication
2.3 Automatic Token Refresh
The integration automatically refreshes access tokens when they expire. You don’t need to re-authenticate unless:
- The refresh token expires (typically after 60 days of inactivity)
- You manually disconnect the integration
- Xero revokes access
3. Account Synchronization
3.1 Account Import (Xero → Younium)
Purpose: Import customer contacts from Xero into Younium as accounts.
What Gets Imported:
- Active contacts from Xero (where
ContactStatus == "ACTIVE") - Only contacts where
IsCustomer == true
How to Run:
- Go to Settings > Integrations > Xero
- In the Account Sync section, click Import Accounts
- The system will import all active customer contacts from Xero
Incremental Sync:
- After the first import, only changed contacts are synced
- The system tracks the
LastGetCustomersImporttimestamp - On subsequent imports, only contacts modified after this timestamp are processed
What Happens During Import:
| Xero Field | Younium Field | Notes |
|---|---|---|
ContactID | ExternalERPId | Used to match existing accounts |
Name | Name | Contact name becomes account name |
EmailAddress | InvoiceEmailAddress | Primary email for invoicing |
TaxNumber | TaxRegistrationNumber | VAT/Tax ID |
CompanyNumber | OrganizationNumber | Company registration number |
Website | Domain | Company website |
FirstName + LastName | YourReference | Combined into one field |
DefaultCurrency | CurrencyId | Mapped to Younium currency |
PaymentTerms | DefaultPaymentTermId | Auto-created if doesn’t exist |
Addresses (POBOX) | DefaultInvoiceAddress | Invoice/billing address |
Addresses (STREET) | DefaultDeliveryAddress | Delivery address |
AccountsReceivableTaxType | Custom Field: Xero Tax Code | Tax code mapping |
SalesDefaultAccountCode | Custom Field: Xero Sales Account | Chart of accounts mapping |
Payment Terms Auto-Creation:
- If a Xero contact has payment terms with type
DAYSAFTERBILLDATE, the integration will:
- Look for an existing payment term in Younium with matching days
- If not found, create a new payment term with format “NET{days}”
- Example: 30 days becomes “NET30” with description “30 Day(s) after the invoice date”
Address Handling:
- POBOX address type → Invoice address in Younium
- STREET address type → Delivery address in Younium
- Countries are automatically activated in Younium if marked inactive
New vs. Update Logic:
- New Account: Created if
ExternalERPIddoesn’t match any existing account - Update Account: Updated if
ExternalERPIdmatches and data has changed - No Change: Skipped if data is identical (performance optimization)
3.2 Account Export (Younium → Xero)
Purpose: Export Younium accounts to Xero as contacts.
What Gets Exported:
- Accounts modified since last export (
Modified > LastGetCustomersExport) - On first run, all accounts are exported
- Both new accounts and updates to existing accounts
How to Run:
- Go to Settings > Integrations > Xero
- In the Account Sync section, click Export Accounts
- The system will export all modified accounts to Xero
Rate Limiting:
- Xero has API rate limits
- The integration adds a 1.5 second delay between each account export
- This ensures compliance with Xero’s API limits
What Happens During Export:
| Younium Field | Xero Field | Notes |
|---|---|---|
ExternalERPId | ContactID | Used to match existing contacts |
Name | Name | Account name becomes contact name |
TaxRegistrationNumber | TaxNumber | VAT/Tax ID |
OrganizationNumber | CompanyNumber | Company registration number |
CurrencyId | DefaultCurrency | Mapped to Xero currency code |
YourReference | FirstName + LastName | Split on first space |
DefaultPaymentTerm.Days | PaymentTerms.Sales.Day | Type set to DAYSAFTERBILLDATE |
Custom Field: Xero Tax Code | AccountsReceivableTaxType | Tax code from custom field |
Custom Field: Xero Sales Account | SalesDefaultAccountCode | Sales account from custom field |
DefaultInvoiceAddress | Addresses (POBOX) | Invoice/billing address |
DefaultDeliveryAddress | Addresses (STREET) | Delivery address |
YourReference Splitting:
- Younium’s
YourReferencefield is split into Xero’sFirstNameandLastName - Split occurs on the first space
- Example: “John Smith Doe” → FirstName: “John”, LastName: “Smith Doe”
New vs. Update Logic:
- New Contact: Created if
ExternalERPIdis not set or doesn’t exist in Xero - Update Contact: Updated if
ExternalERPIdmatches a Xero contact - Change Detection: Only exports if account or address data has changed
3.3 Currency Handling
Requirements:
- The currency used in Xero must exist in Younium
- Currency codes must match exactly (e.g., “USD”, “EUR”, “GBP”)
Import Behavior:
- Uses
DefaultCurrencyfrom Xero contact - If
DefaultCurrencyis “0” (not set), uses the organization’sBaseCurrency - Throws error if currency doesn’t exist in Younium
Export Behavior:
- Maps Younium currency to Xero
CurrencyCodeenum - Supported currencies are those available in Xero’s API
4. Product Synchronization
4.1 Product Import (Xero → Younium)
Purpose: Import items from Xero as products in Younium.
What Gets Imported:
- All items from Xero
- Each Xero item becomes a Younium product with one charge plan and one charge
How to Run:
- Go to Settings > Integrations > Xero
- In the Product Sync section, click Import Products
- The system will import all items from Xero
Incremental Sync:
- After the first import, only modified items are synced
- The system tracks
LastGetProductsImporttimestamp - On subsequent imports, only items modified after this timestamp are processed
Product Structure Created:
Product (from Xero Item)
└── Charge Plan (auto-created)
└── Charge (from Xero Item)
Field Mapping:
| Xero Field | Younium Field | Notes |
|---|---|---|
Code | Product.ExternalERPId | Unique identifier |
Code | Charge.ExternalERPId | Same as product |
Name | Product.Name | Item name |
Name | ChargePlan.Name | Same as product |
Name | Charge.Name | Same as product |
Charge Configuration:
- Model: Set to
Quantity(quantity-based pricing) - End of New Sales Date: Set to
null(no end date)
Validation:
- Xero item must have a
Name(required) - Xero item
Codemust be unique in Younium - If duplicate
Codeexists in Younium, the import fails for that item
New vs. Update Logic:
- New Product: Created if
ExternalERPIddoesn’t match any existing product - Update Product: Updated if
ExternalERPIdmatches and data has changed - No Change: Skipped if data is identical
5. Invoice Posting
5.1 Automatic Invoice Posting
Purpose: Automatically post invoices to Xero when they are posted in Younium.
How to Enable:
- Go to Settings > Integrations > Xero
- Enable the Post Invoices to Xero toggle
- Invoices will now automatically post to Xero when posted in Younium
What Gets Posted:
- Invoice header information
- All invoice lines (with quantity and pricing)
- Tax codes (if configured on account)
- Currency and exchange rates
5.2 Invoice vs. Credit Note
The integration automatically determines whether to create an invoice or credit note:
- Debit Invoice: Total amount > 0 → Creates Xero Invoice
- Credit Invoice: Total amount < 0 → Creates Xero Credit Note
5.3 Invoice Field Mapping
Debit Invoice (Normal Invoice):
| Younium Field | Xero Field | Notes |
|---|---|---|
Account.ExternalERPId | Contact.ContactID | Must be a valid Xero contact |
InvoiceDate | Date | Invoice date |
DueDate | DueDate | Payment due date |
YourReference | Reference | Reference text |
Currency.Code | CurrencyCode | ISO currency code |
ExchangeRate | CurrencyRate | Exchange rate calculation |
| Invoice Lines | LineItems | See line item mapping below |
Notes | Added as extra line item | Invoice-level notes |
| - | Status | Always set to DRAFT |
| - | Type | Always set to ACCREC (Accounts Receivable) |
Credit Note (Negative Invoice):
| Younium Field | Xero Field | Notes |
|---|---|---|
Account.ExternalERPId | Contact.ContactID | Must be a valid Xero contact |
InvoiceDate | Date | Credit note date |
DueDate | DueDate | Due date |
Currency.Code | CurrencyCode | ISO currency code |
ExchangeRate | CurrencyRate | Exchange rate calculation |
| Invoice Lines | LineItems | Unit amounts negated |
Notes | Added as extra line item | Credit note-level notes |
| - | Status | Always set to DRAFT |
| - | Type | Always set to ACCRECCREDIT (Accounts Receivable Credit) |
5.4 Invoice Line Mapping
Line Item Fields:
| Younium Field | Xero Field | Notes |
|---|---|---|
ChargeDescription | Description | First line of description |
ServicePeriodStartDate | Description | Added as “YYYY-MM-DD to YYYY-MM-DD” |
ServicePeriodEndDate | Description | Second line of description |
Notes | Description | Added to description if present |
| Calculated quantity | Quantity | Based on charge model and pricing |
| Calculated price | UnitAmount | Price per unit |
OrderProductCharge.ExternalERPId | ItemCode | If charge has ERP ID |
Product.ExternalERPId | ItemCode | Fallback if charge has no ERP ID |
| Account’s tax code | TaxType | From custom field “Xero Tax Code” |
Description Format:
[ChargeDescription] [ServicePeriodStartDate] to [ServicePeriodEndDate] (if recurring/subscription) [Notes] (if present)
Example:
Monthly Subscription - Premium Plan 2026-01-01 to 2026-01-31 Includes support package
Quantity and Price Calculation:
- Handles different charge types (quantity-based, usage-based, etc.)
- For credit notes, unit amount is negated (quantity stays positive)
5.4 Invoice Line Filtering
Settings Applied:
- Hide Zero Amount Recurring Lines: If enabled, recurring charges with 0 amount are excluded
- Hide Zero Amount Usage Lines: If enabled, usage/measurement charges with 0 amount are excluded
These settings are configured in Younium’s invoice settings and automatically applied during posting.
5.5 Post-Posting Update
After successful posting to Xero:
- Younium invoice’s
ExternalERPIdis updated with the Xero invoice/credit note number - Success logged in integration event log
6. Field Mapping Reference
6.1 Custom Fields Created
The integration automatically creates two custom field lists in Younium:
Xero Tax Code
Field Name: Xero - Xero Tax Code
Object: Account
Type: List
Available Values:
| Key | Value | Description |
|---|---|---|
| OUTPUT | Tax on Consulting | Standard output tax |
| INPUT | Tax on Purchases | Input tax |
| RROUTPUT | 5% (VAT on Income) | Reduced rate output |
| OUTPUT2 | 20% (VAT on Income) | Standard rate output |
| EXEMPTOUTPUT | Exempt Income | Exempt from tax |
| NONE | Tax Exempt | No tax applied |
| ECZROUTPUT | Zero Rated EC Goods Income | EU goods at 0% |
| ECZROUTPUTSERVICES | Zero Rated EC Services | EU services at 0% |
| ZERORATEDOUTPUT | Zero Rated Income | Zero rated sales |
Xero Sales Account
Field Name: Xero - Xero Sales Account
Object: Account
Type: List
Values: Dynamically populated from your Xero Chart of Accounts
- Lists all financial accounts from Xero
- Format:
Code - Name(e.g., “200 - Sales Revenue”) - Refreshed when settings are saved
6.2 Address Type Mapping
Xero Address Types:
POBOX→ Younium Invoice AddressSTREET→ Younium Delivery Address
Address Fields Mapped:
| Xero Field | Younium Field |
|---|---|
AddressLine1 | Street |
AddressLine2 | Street2 |
Region | State |
City | City |
PostalCode | Zip |
Country | CountryId (matched by name) |
6.3 Payment Terms Mapping
Xero to Younium:
- Only
DAYSAFTERBILLDATEpayment term type is supported - Other types are ignored
- Days value is used to match or create payment term
Example Conversion:
- Xero: Type =
DAYSAFTERBILLDATE, Days = 30 - Younium: Name = “NET30”, Days = 30, Description = “30 Day(s) after the invoice date”
Younium to Xero:
- Payment term days are converted to Xero payment terms
- Type is always set to
DAYSAFTERBILLDATE
7. Sync Behavior & Logic
7.1 Change Detection
Account Import (Xero → Younium):
The system checks if any of these fields have changed:
- Name
- Domain (Website)
- TaxRegistrationNumber
- OrganizationNumber
- DefaultPaymentTermId
- CurrencyId
- YourReference
Additionally checks addresses:
- Invoice Address fields (Street, Street2, State, City, Zip, Country)
- Delivery Address fields (Street, Street2, State, City, Zip, Country)
Account Export (Younium → Xero):
Exports accounts where:
- Account
Modified>LastGetCustomersExport, OR DefaultInvoiceAddress.Modified>LastGetCustomersExport, ORDefaultDeliveryAddress.Modified>LastGetCustomersExport
7.2 Matching Logic
Accounts:
- Xero
ContactID↔︎ YouniumExternalERPId - If
ExternalERPIdmatches, account is updated - If no match, new account is created
Products:
- Xero Item
Code↔︎ Younium ProductExternalERPId - If
ExternalERPIdmatches, product is updated - If no match, new product is created
Invoices:
- After posting to Xero, Younium
ExternalERPIdis set to Xero invoice/credit note number - This field is for reference only (no reverse sync)
7.3 Pagination
Account Import:
- Loads accounts from Xero in pages
- Continues until no more accounts are returned
- Page count increments automatically
- Handles large account lists efficiently
Product Import:
- Uses Xero’s built-in pagination
- Ordered by “Name ASC”
- Handles
ifModifiedSincefor incremental sync
7.4 Error Handling
Per-Record Error Handling:
- If one account/product fails, others continue processing
- Failed records are logged with error details
- Success count, update count, and failure count are tracked separately
Integration Event Logging:
- Success events logged with counts (e.g., “50 new accounts and updated 25 accounts. 2 accounts failed”)
- Failure events logged with error message and full record JSON
- Events visible in Younium integration log
Common Errors:
- Currency not found in Younium
- Missing required fields
- Duplicate External ERP IDs
8. Troubleshooting
8.1 Authentication Issues
Problem: “Not Authenticated” status
Solutions:
- Check that the Xero Tenant Name exactly matches your Xero organization name (case-sensitive)
- Click Authenticate again to refresh the connection
- Verify you have the necessary permissions in Xero
- Check that the Xero organization is active
Problem: Token expired
Solution:
- The integration automatically refreshes tokens
- If automatic refresh fails, manually re-authenticate
- Check integration logs for token refresh errors
8.2 Account Sync Issues
Problem: “No currency exists in Younium”
Solution:
- Check which currency the Xero contact uses
- Add that currency to Younium if missing
- Ensure currency codes match exactly (USD, EUR, GBP, etc.)
Problem: Accounts not syncing
Solutions:
- Verify accounts have
ContactStatus == "ACTIVE"in Xero - Check that
IsCustomeris true (suppliers-only are skipped) - Look for error messages in the integration log
- Verify
ExternalERPIdfield is not corrupted
Problem: Addresses not syncing
Solutions:
- Verify Xero address type is POBOX or STREET
- Check that country name in Xero matches Younium country list
- Ensure country is active in Younium
- Check address fields for invalid characters
8.3 Product Sync Issues
Problem: “Xero product id/code: [code] has no name”
Solution:
- Add a name to the item in Xero
- All Xero items must have a name to sync
Problem: “Xero product id/code: [code] exist twice in Younium”
Solution:
- Fix the duplicate
ExternalERPIdin Younium - Each product must have a unique External ERP ID
8.4 Invoice Posting Issues
Problem: “Could not post invoice to Xero”
Solutions:
- Verify the account has a valid
ExternalERPId(Xero ContactID) - Ensure the account exists in Xero
- Check that invoice lines have valid product/charge references
- Verify currency is supported in Xero
- Check Xero API rate limits
Problem: Invoice posted but not showing in Xero
Solution:
- Check that invoice was created as DRAFT (as designed)
- Look for the invoice by reference number in Xero
9. Best Practices
9.1 Initial Setup
- Test in Sandbox First
- Connect to a Xero sandbox/demo organization first
- Test account import/export with a few records
- Verify field mappings are correct
- Then connect to production
- Data Preparation
- Ensure all currencies in Xero exist in Younium before syncing
- Clean up duplicate contacts in Xero
- Verify all active contacts have required fields populated
- Custom Field Setup
- Configure “Xero Tax Code” custom field on accounts
- Configure “Xero Sales Account” custom field on accounts
- These fields are created automatically but need to be populated
9.2 Ongoing Operations
- Incremental Sync
- Use incremental sync for regular updates
- Only do full sync when needed (initial setup, data cleanup)
- Click “Remove Last Sync Date” to force full sync
- Invoice Posting
- Enable automatic invoice posting only after testing
- Invoices are created as DRAFT in Xero (review before finalizing)
- Monitor integration logs for posting failures
- Data Quality
- Keep
ExternalERPIdfield clean (don’t manually edit) - Ensure accounts in Younium that sync to Xero have all required fields
- Regularly check for sync errors in integration logs
- Keep
- Address Management
- Use consistent country names between systems
- Ensure countries are active in Younium
- Update addresses in the system where they originated
10. Technical Specifications
10.1 Integration Architecture
Type: Server-side Integration
Protocol: OAuth2 with token refresh
API: Xero NetStandard OAuth2 SDK
Sync Type: Pull (from Xero) and Push (to Xero)
Event Handling: Younium event subscription for invoice posting
10.2 Error Codes
Common Integration Errors:
| Error Code | Description | Solution |
|---|---|---|
No currency exists | Currency in Xero not found in Younium | Add currency to Younium |
Could not find Tenant name | Xero tenant name doesn’t match | Verify exact tenant name (case-sensitive) |
Create authorization error | OAuth callback missing parameters | Re-authenticate |
Could not post invoice | Invoice posting failed | Check account has valid ExternalERPId |
Xero product has no name | Item in Xero missing name | Add name to item in Xero |
Product exists twice | Duplicate ExternalERPId | Clean up duplicate products in Younium |
10.3 Logging & Monitoring
Integration Events:
- All sync operations logged
- Success/failure status recorded
- Record counts tracked (new, updated, failed)
- Error messages captured with full record details
Log Retention:
- Integration logs retained per Younium’s data retention policy
- View in Settings > Integrations > Xero > Event Log
Monitoring Points:
- Authentication status
- Last sync timestamps
- Record counts per sync
- Failed record count
- Error messages
Appendix A: Field Reference Tables
Complete Account Field Mapping
| Younium Field | Xero Field | Direction | Data Type | Required | Notes |
|---|---|---|---|---|---|
ExternalERPId | ContactID | Both | GUID | Yes | Matching key |
Name | Name | Both | String | Yes | Primary name |
InvoiceEmailAddress | EmailAddress | Import | String | No | Email for invoices |
TaxRegistrationNumber | TaxNumber | Both | String | No | VAT/Tax ID |
OrganizationNumber | CompanyNumber | Both | String | No | Registration number |
Domain | Website | Import | String | No | Company website |
YourReference | FirstName + LastName | Both | String | No | Split/joined on space |
CurrencyId | DefaultCurrency | Both | Currency Code | Yes | Must exist in both systems |
DefaultPaymentTermId | PaymentTerms.Sales.Day | Both | Integer | No | Days after invoice |
DefaultInvoiceAddress | Addresses[POBOX] | Both | Address | No | Billing address |
DefaultDeliveryAddress | Addresses[STREET] | Both | Address | No | Delivery address |
Custom: Xero Tax Code | AccountsReceivableTaxType | Both | String | No | Tax code mapping |
Custom: Xero Sales Account | SalesDefaultAccountCode | Both | String | No | Sales account code |
AccountType | - | N/A | Enum | Yes | Always “Customer” on import |
Complete Product Field Mapping
| Younium Field | Xero Field | Direction | Data Type | Required | Notes |
|---|---|---|---|---|---|
Product.ExternalERPId | Code | Import | String | Yes | Unique identifier |
Product.Name | Name | Import | String | Yes | Product name |
ChargePlan.Name | Name | Import | String | Yes | Same as product |
Charge.Name | Name | Import | String | Yes | Same as product |
Charge.ExternalERPId | Code | Import | String | Yes | Same as product code |
Charge.Model | - | N/A | Enum | Yes | Always “Quantity” |
Product.EndOfNewSalesDate | - | N/A | Date | No | Always null on import |
Complete Invoice Field Mapping
| Younium Field | Xero Field | Direction | Data Type | Required | Notes |
|---|---|---|---|---|---|
Account.ExternalERPId | Contact.ContactID | Export | GUID | Yes | Must exist in Xero |
InvoiceDate | Date | Export | Date | Yes | Invoice/credit date |
DueDate | DueDate | Export | Date | Yes | Payment due date |
YourReference | Reference | Export | String | No | Reference text |
Currency.Code | CurrencyCode | Export | Currency Code | Yes | ISO currency code |
ExchangeRate | CurrencyRate | Export | Decimal | No | Calculated exchange rate |
TotalAmount.Amount | - | N/A | Decimal | Yes | Determines invoice/credit |
Notes | LineItem description | Export | String | No | Added as extra line |
ExternalERPId | Invoice/Credit Number | Both | String | No | Xero-generated number |
| - | Status | N/A | Enum | Yes | Always “DRAFT” |
| - | Type | N/A | Enum | Yes | ACCREC or ACCRECCREDIT |
Invoice Line Field Mapping
| Younium Field | Xero Field | Direction | Data Type | Required | Notes |
|---|---|---|---|---|---|
ChargeDescription | Description (line 1) | Export | String | Yes | Charge name |
ServicePeriodStartDate | Description (line 2) | Export | Date | No | Start of period |
ServicePeriodEndDate | Description (line 2) | Export | Date | No | End of period |
Notes | Description (line 3) | Export | String | No | Line notes |
| Calculated quantity | Quantity | Export | Decimal | Yes | From pricing model |
| Calculated price | UnitAmount | Export | Decimal | Yes | Price per unit |
OrderProductCharge.ExternalERPId | ItemCode | Export | String | No | First priority |
Product.ExternalERPId | ItemCode | Export | String | No | Fallback if charge has no ID |
| Account’s tax code custom field | TaxType | Export | String | No | From “Xero Tax Code” |
Related to