Xero

💸 Integrate Xero for financial operations.

Xero integration lets Clevero connect with Xero for seamless accounting and financial management.

Configuration

To use Xero integration, you need to configure it with the following steps:

  1. Connect to Xero

Before using Xero functions, ensure that you've connected your application to Xero from the "Company Settings" or "Standard Connections" section.

  1. Xero Tenant ID

Retrieve the Xero Tenant ID, which identifies your Xero organization. You can obtain this ID by calling C.getCompanySettings() and extracting the xeroOrganisation.xeroId property.

  1. Xero Functions

Utilise Xero functions like xeroUpsert, xeroGet, and xeroUtility to interact with Xero data. These functions require specific parameters, including the Xero Tenant ID and data related to the operation you want to perform (e.g., creating a contact and fetching invoices).

Here's an example of how to configure and use Xero functions:

async function script(C) {
    const tenantId = (await C.getCompanySettings()).xeroOrganisation.xeroId;
    if (!tenantId) {
        throw "Default xero organisation is not set in company settings";
    }

    const xeroContactEntryData = {
        contactID: "c4a3c327-a7fc-4262-9920-f027cc05f302",
        name: "Tester Kit",
        emailAddress: "[email protected]",
    };

    const xeroClient = await C.xeroUpsert({
        recordId: 591600,
        entryId: 698937,
        xeroTenantId: tenantId,
        correspondingRecordType: "contact",
        xeroEntryData: xeroContactEntryData,
    });
    
    const xeroGet = await C.xeroGet({
        xeroTenantId: tenantId,
    });

await C.xeroUtility({
        recordId: 1234, 
        entryId: "base-entryId-for-invoice",
        xeroTenantId: "123245-123c-47c4-a060-112badd5cd",
        correspondingRecordType: "emailInvoice",
        xeroUtilityData: {
            invoiceID: "ea1a49cd-23ba-47c4-a060-371cbdd5f5db",
        },
    });
    
    return {xeroClient, xeroGet, tenantId };
}

Output

The output will indicate whether the operation was successful or if any errors occurred. If the operation is successful, the response will include relevant data, such as details of the created or updated record, fetched data, or the result of the specific utility operation.

📌 Need Help?

If you require assistance or encounter any issues, please don't hesitate to contact us for further support.