Knowledge base

Allowing Xplenty access to my data on Xero

Xplenty can access your Xero data. This article details creating the Xero connection in Xplenty.

To create a Xero connection in Xplenty:

    1. Click the Connections icon (lightning bolt) on the top left menu.
    2. To create a connection, click New connection.Screen+Shot+2020-03-16+at+3.44.54+PM.jpg
    3. Choose Xero.
    4. Click Authenticate. (If required, sign in to Xero)
    5. Click Connect to authorize Xplenty access to your Xero account.
    6. In the new new Xero connection window, name the connection and click Create Xero connection.

To modify Xero connections in Xplenty:

    1. Click the Connections icon (lightning bolt) on the top left menu.
    2. Click a connection to re-connect if your password has changed or the token has expired.
    3. To delete a Xero connection, click on the three vertical dots on the far right of the connection listing and select the Delete connection option.

To build a data pipeline to read Xero account data in Xplenty:undefined

REST API Component: accounts

  • Authentication - Click Connection and then select your Xero connection. If you haven't created your Xero connection yet, click + New and follow the instructions found above. undefined
  • URL - Enter the URL for the Accounts endpoint of the Xero API: Make sure the method is set to GET. Click Add beneath Headers twice to add the following two headers: Accept: application/json, If-Modified-Since: $last_updated_at. Replace the variable $last_updated_at with a timestamp for the minimum age of the updated data. undefined
  • Response - Make sure the JSON response type is selected.  Edit the Base record JSON Path Expression field like this: $.Accounts[*].undefined
  • Input fields - Click Select all to move all the Available fields over to the Selected fields or pick and choose which fields you would like by clicking on the + icon next to the field name in the Available Fields column. Then click Save. undefined

Select Component: parse_account_fields

  • Click Autofill to bring in all the fields from the source component. Convert the UpdatedDateUTC field into a datetime data type using these functions: ToDate((long)REPLACE(REPLACE(UpdatedDateUTC,'\\/Date\\(',''),'\\+.*','')). Click Save. undefined

Destination Component: xero_accounts_destination

  • The template shows a Redshift destination component; however, if you'd prefer to use a different destination, delete the Redshift component and select a destination component of your choice.Destinations.jpg
  • Choose target connection - Select your target connection. If you haven't created your connection yet, click + New. undefined
  • Destination properties - Fill in the values for target schema and table, select an operation type, pre or post-action SQL, and advanced options.
  • Schema mapping - Click Auto-fill to bring in all of the fields. If you've selected a Merge operation type, click the Key box next to the merge key field(s). Click Save.undefined