XeroAPI / Xero-OpenAPI

An OpenAPI description of the Xero API

Home Page:https://developer.xero.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Couldn't create Credit Card account through XERO Accounting API

Abu-Zakaria opened this issue · comments

Expected Behavior

When sending this request, it should create an account that is a type of Credit card with the given information.
API Endpoint: PUT https://api.xero.com/api.xro/2.0/Accounts

{
  "Name": "Credit Card account",
  "Type": "BANK",
  "BankAccountType": "CREDITCARD",
  "BankAccountNumber": "1234"
}

Current Behavior

This is the response after sending the request -

{
  "ErrorNumber": 10,
  "Type": "ValidationException",
  "Message": "A validation exception occurred",
  "Elements": [
    {
      "AccountID": "00000000-0000-0000-0000-000000000000",
      "Name": "Credit Card account",
      "Type": "BANK",
      "BankAccountNumber": "1234",
      "BankAccountType": "CREDITCARD",
      "ValidationErrors": [
        {
          "Message": "The Bank Account Number must contain a 6-digit BSB code and account number"
        }
      ]
    }
  ]
}

Why the error is talking about "6-digit BSB"? Credit card accounts don't have BSB code.

About the XERO Organisation, its country is set to Australia.

Sadly this is a known limitation.

It's listed in the Docs if you do a search for "Credit Card" on the Accounts Page