I am integrating with the xero API, I have a token which was requested with the following scopes
openid profile email offline_access files accounting.transactions accounting.contacts accounting.settings
I am running the following code :
var bankAccount = await _accountingApi.CreateAccountAsync(token.AccessToken, token.Tenants.FirstOrDefault()?.ToString(), new Account
{
Type = AccountType.BANK,
BankAccountType = Account.BankAccountTypeEnum.BANK,
Name = "Clearing Account",
BankAccountNumber = "00000000"
}, null, cancellationToken);
However when this executes I get a 403 error returned.
From what I have read in the docs this should work, the Account PUT notes in the Xero docs suggest that Im right, I just cant get it to work - what am I missing?
Did you also get a Ref number with the HTTP 403 response? If so, it can be used by Xero API Support to find the exact cause.
There are a few reasons why you could be hitting a 403.