Begin the OAuth authorization-code flow for Xero or QuickBooks Online (ADMIN+)
POST
/erp-connections/oauth/start
const url = 'https://api.invogi.com/v1/erp-connections/oauth/start';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"provider":"XERO","company_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.invogi.com/v1/erp-connections/oauth/start \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "provider": "XERO", "company_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Returns the provider’s own authorize URL with a signed, short-lived
state parameter bound to this organization, provider, and target
company. apps/app redirects the browser to it directly; this endpoint
does not redirect. See docs/20_ERP_CONNECTORS.md “OAuth
(authorization-code) connectors” for what state encodes and why.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
provider
required
string
company_id
Defaults to the organization’s default company
string format: uuid
Responses
Section titled “Responses”Authorize URL to redirect the browser to
Media typeapplication/json
object
authorize_url
required
string format: uri
Example generated
{ "authorize_url": "https://example.com"}Invalid request
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
request_id
required
string
Example
{ "error": { "code": "NOT_FOUND" }}Missing or invalid API key
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
request_id
required
string
Example
{ "error": { "code": "NOT_FOUND" }}API key lacks required scope/role
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
request_id
required
string
Example
{ "error": { "code": "NOT_FOUND" }}