Skip to content

Begin the OAuth authorization-code flow for Xero or QuickBooks Online (ADMIN+)

POST
/erp-connections/oauth/start
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.

Media typeapplication/json
object
provider
required
string
Allowed values: XERO QUICKBOOKS_ONLINE
company_id

Defaults to the organization’s default company

string format: uuid

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
Allowed values: NOT_FOUND UNAUTHORIZED FORBIDDEN INVALID_REQUEST CONFLICT RATE_LIMITED USAGE_LIMIT_EXCEEDED PROCESSING_FAILED
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
Allowed values: NOT_FOUND UNAUTHORIZED FORBIDDEN INVALID_REQUEST CONFLICT RATE_LIMITED USAGE_LIMIT_EXCEEDED PROCESSING_FAILED
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
Allowed values: NOT_FOUND UNAUTHORIZED FORBIDDEN INVALID_REQUEST CONFLICT RATE_LIMITED USAGE_LIMIT_EXCEEDED PROCESSING_FAILED
message
required
string
request_id
required
string

Example

{
"error": {
"code": "NOT_FOUND"
}
}