Closed manugentoo closed 3 months ago
Hello there,
I'm using your package and im trying to list an invoice from a tenantID code goes like:
` if ($xeroCredentials->exists()) { $xero = resolve(\XeroAPI\XeroPHP\Api\AccountingApi::class); $tenantId = $xeroCredentials->getTenantId();
// this returns data $organisationName = $xero->getOrganisations(tenantId)
// this throws exception $xero->getInvoices($tenantId } `
that block of code returns
XeroAPI\XeroPHP\ApiException [401] Client error:GET https://api.xero.com/api.xro/2.0/Invoices?summaryOnly=falseresulted in a401 Unauthorizedresponse: {"Type":null,"Title":"Unauthorized","Status":401,"Detail":"AuthorizationUnsuccessful","Instance":"3fcae45a-0ee2-4078-b83 (truncated...)
XeroAPI\XeroPHP\ApiException [401] Client error:
resulted in a
response: {"Type":null,"Title":"Unauthorized","Status":401,"Detail":"AuthorizationUnsuccessful","Instance":"3fcae45a-0ee2-4078-b83 (truncated...)
any idea why?
Resolved this by adding: 'accounting.transactions' in 'scopes' of config/xero.php
Hello there,
I'm using your package and im trying to list an invoice from a tenantID code goes like:
` if ($xeroCredentials->exists()) { $xero = resolve(\XeroAPI\XeroPHP\Api\AccountingApi::class); $tenantId = $xeroCredentials->getTenantId();
// this returns data $organisationName = $xero->getOrganisations(tenantId)
// this throws exception $xero->getInvoices($tenantId } `
that block of code returns
XeroAPI\XeroPHP\ApiException [401] Client error:
GET https://api.xero.com/api.xro/2.0/Invoices?summaryOnly=falseresulted in a
401 Unauthorizedresponse: {"Type":null,"Title":"Unauthorized","Status":401,"Detail":"AuthorizationUnsuccessful","Instance":"3fcae45a-0ee2-4078-b83 (truncated...)
any idea why?