Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
395 views
in Technique[技术] by (71.8m points)

xero api - Account list doesn't return account id for "grouped" accounts

I'm using the Xero API to do some integration and I'm using the accounts get feature to return a list of accounts. I'd like to join this to some of the reports, for example the profit and loss report which would allow me to then group the accounts returned by type. All looks good, other than some accounts have an extra "groupID" attribute. When an account has this extra attribute, the "account" attribute that usually contains a GUID which I can link to reports now contains what could be a GUID, only without the dashes, and doesn't link to any other report.

For example, this is an account that all works correctly...

{
    "RowType": "Row",
    "Cells": [
        {
            "Value": "General Expenses",
            "Attributes": [
                {
                    "Value": "8d631f87-7304-401f-a7cd-d1d42c1b458a",
                    "Id": "account"
                }
            ]
        },
        {
            "Value": "179.07",
            "Attributes": [
                {
                    "Value": "8d631f87-7304-401f-a7cd-d1d42c1b458a",
                    "Id": "account"
                }
            ]
        }
    ]
},

This one doesn't, and the GUID isn't formatted as a GUID anymore...

{
    "RowType": "Row",
    "Cells": [
        {
            "Value": "Directors' Remuneration",
            "Attributes": [
                {
                    "Value": "a02584cbb64e4c109b4355b292da0de5",
                    "Id": "account"
                },
                {
                    "Value": "a02584cbb64e4c109b4355b292da0de5",
                    "Id": "groupID"
                }
            ]
        },
        {
            "Value": "55737.84",
            "Attributes": [
                {
                    "Value": "a02584cbb64e4c109b4355b292da0de5",
                    "Id": "account"
                },
                {
                    "Value": "a02584cbb64e4c109b4355b292da0de5",
                    "Id": "groupID"
                }
            ]
        }
    ]
},

Any idea what would cause that? Is there a way I can list "grouped" accounts?

Thanks in advance.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I believe that is due to the org having multi-currency for that account.

However I don't see much other documentation related to how to lookup the account from that. I will update this answer If I can find anything else out internally.

Multi-Currency System Accounts - FXGROUPID

For organisations in most regions, the standard layout of the profit and loss report will group multi currency system accounts into a single line with a Value of FXGROUPID (instead of an AccountID).

This is not the case for US organisations and Australian demo companies. Multi-currency system accounts will be displayed seperately with their respective AccountIDs.


Multi currency support could be seen here: https://go.xero.com/Setup/CurrencyRates.aspx

I think you can also just query the currencies endpoint to find out if an org may support mutiple.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...