Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Connector Development
Answered

Creating a Xero Oauth2.0 Custom Connector

(0) ShareShare
ReportReport
Posted on by 2,314 Super User 2025 Season 1

I am new to creating custom connectors and need some help creating a connector for Xero. I was able to connect using Postman but can't seem to get the settings correct on the Power Platform Custom Connector.

 

Can someone tell me what the parameters should be for the Security tab. No matter what I try will not connect to Xero.

365Assist_0-1661479751787.png

 

When I try to Test the connection get error 500

365Assist_0-1661480813396.png

 

 

  • danny90 Profile Picture
    149 on at
    Re: Creating a Xero Oauth2.0 Custom Connector

    @s1hl3_ukuvuma you're an absolute legend! thankyou so much

  • s1hl3_ukuvuma Profile Picture
    59 on at
    Re: Creating a Xero Oauth2.0 Custom Connector

    Correct I have been using mine for months and never expires.

  • danny90 Profile Picture
    149 on at
    Re: Creating a Xero Oauth2.0 Custom Connector

    thanks @s1hl3_ukuvuma 

     

    I've gone one step further now and stored the access/refresh tokens, tennant id and client id/secret in environment variables and im really pleased with how this works.

     

    so am i right thinking that because this is running every 20 minuets - it wont ever expire? the access token lasts for 30 minuets and the refresh token lasts for 60 days but if this flow is constantly refreshing.. the connection should remain live?

  • s1hl3_ukuvuma Profile Picture
    59 on at
    Re: Creating a Xero Oauth2.0 Custom Connector

    That is great news man, I am glad it worked.

  • danny90 Profile Picture
    149 on at
    Re: Creating a Xero Oauth2.0 Custom Connector

    Got that working mate - with only 1 failed test because of a spelling mistake!! Absolutely fantastic! Thankyou.

     

    Now I need to work out how to re authorise every 60 days in an intuitive way; and

     

    Get the info I need and get it into my app. I presume this will be done with a collection of some sort 🤔

     

    thanks!

    dan

  • danny90 Profile Picture
    149 on at
    Re: Creating a Xero Oauth2.0 Custom Connector

    Thanks Sihle, i really appreciate you taking the time to explain! im going to give it a go this evening.

     

    i take it that because this is refreshing every 20 mins, i wont need to renew the connection every 60 days?

     

    and once ive set this up.. how on earth do i make requests to the endpoints to retrieve data from the xero tennant, like a list of customers for example.

     

    Thanks,

    Dan

  • s1hl3_ukuvuma Profile Picture
    59 on at
    Re: Creating a Xero Oauth2.0 Custom Connector

    Forget the Custom Connector.

     

    1. Get a Refresh Token via Postman.

    2. Create a SharePoint List as per below and add the Refresh Token from Postman:

    s1hl3_ukuvuma_0-1718285837817.png

    3. Create an Instant flow as per below:

    s1hl3_ukuvuma_1-1718286011251.png

    - The Get Item is the SharePoint List you created that keeps the refresh token:

    s1hl3_ukuvuma_2-1718286172835.png

     

    4. Next step is sending the HTTP request copy this as is and add the variables as per previous actions:


    s1hl3_ukuvuma_3-1718286290532.png

     

    5. Parse JSON: The Content will be the body from HTTP,

    s1hl3_ukuvuma_5-1718286465806.png

    Schema here:

    {
        "type": "object",
        "properties": {
            "id_token": {
                "type": "string"
            },
            "access_token": {
                "type": "string"
            },
            "expires_in": {
                "type": "integer"
            },
            "token_type": {
                "type": "string"
            },
            "refresh_token": {
                "type": "string"
            },
            "scope": {
                "type": "string"
            }
        }
    }

     

     

    6. Initialize the New Access Tokens and New Refresh Tokens, and pass the values from the Parse JSON as per below:

    s1hl3_ukuvuma_6-1718286518434.png

     

    7. Update the SharePoint List Refresh and Access Tokens with the New Tokens:

    s1hl3_ukuvuma_7-1718286878897.png

     . You can modify the trigger to occur every 20 minutes so the Access and Refresh Tokens can be updated:

    s1hl3_ukuvuma_8-1718286998926.png

     

    9. Flow in full:

    s1hl3_ukuvuma_9-1718287068800.png


    Good luck please let me know how it goes.
    ~ Sihle



  • danny90 Profile Picture
    149 on at
    Re: Creating a Xero Oauth2.0 Custom Connector

    Has anybody achieved consolidated way to create this connector? either by flow or custom connector? i really need to create one and i cant see any clear answers.. some people have it working with a connector but not sure how the refresh process will work after the 60 days. some people are struggling with the flow type because of it refreshing so often or not returning the token.. has anybody got this working consistently?

  • danny90 Profile Picture
    149 on at
    Re: Creating a Xero Oauth2.0 Custom Connector

    Hi, i don't suppose you'd be interested in giving me a more in-depth breakdown of how you achieved this? im willing to pay 😄 haha

  • Kabilesh Profile Picture
    177 on at
    Re: Creating a Xero Oauth2.0 Custom Connector

    Hi everyone,

     

    I'm currently working on a similar task where I'm attempting to create a scheduled flow to refresh my token and store it in a SharePoint list. However, I've encountered a hiccup in extracting the access token from an HTTP request in Power Automate for Xero.

     

    Could anyone assist me with this particular scenario?

     

    Thanks in advance!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1

Featured topics