Skip to content

Connect an ERP to sync vendors and vendor bills/purchase invoices into a company (ADMIN+, requires an active subscription)

POST
/erp-connections
curl --request POST \
--url https://api.invogi.com/v1/erp-connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "provider": "BUSINESS_CENTRAL", "config": { "tenantId": "example", "environmentName": "example", "companyId": "example", "clientId": "example", "bankAccountEndpoint": "https://example.com", "bankAccountVendorIdField": "example", "bankAccountIbanField": "example" }, "client_secret": "example", "company_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

provider selects the request shape (discriminated union). Credentials (client_secret/api_key) are write-only and never returned. Business Central and Odoo take static credentials directly; Xero and QuickBooks Online instead use POST /erp-connections/oauth/start and are never created directly through this endpoint (docs/20_ERP_CONNECTORS.md “OAuth (authorization-code) connectors”).

X-Invogi-Organization
string format: uuid

For a Clerk session, selects a workspace in which the user has an active membership. If omitted, the remembered accessible workspace is used. API keys remain bound to their own workspace and cannot select another tenant.

Media typeapplication/json
One of: discriminator: provider
object
provider
required
string
Allowed value: BUSINESS_CENTRAL
config
required
object
tenantId
required

Microsoft Entra ID tenant ID

string
environmentName
required

Business Central environment name, e.g. “production”

string
companyId
required

Business Central company ID within that environment

string
clientId
required

Entra app registration client ID

string
bankAccountEndpoint

Optional HTTPS Business Central custom API page URL for vendor IBANs; supports a {companyId} placeholder

string format: uri
bankAccountVendorIdField
string
bankAccountIbanField
string
client_secret
required

Entra app registration client secret

string
>= 1 characters
company_id

Invogi company this connection imports into; defaults to the default company

string format: uuid

Connection saved as PENDING; syncs hourly and on demand

Media typeapplication/json
object
id
required
string format: uuid
provider
required
string
Allowed values: BUSINESS_CENTRAL ODOO XERO QUICKBOOKS_ONLINE
companyId
required
string format: uuid
backfill

Bills the first sync left out and an owner has not analyzed yet; null when none

object
left_out
integer
>= 1
unpaid_left_out
integer
estimated_max_overage

Most the overage could add

number | null
currency
string | null
companyName
required
string
config
required

Provider-specific, non-secret config as stored (credentials are never included)

object
key
additional properties
any
status
required
string
Allowed values: PENDING CONNECTED ERROR DISABLED
mode
required

SCAN_ONLY: connected on the free tier for a one-shot historical scan; never syncs until activated

string
Allowed values: SYNC SCAN_ONLY
scanAccessExpiresAt
required

SCAN_ONLY: fallback revocation time if the grant was not revoked when the scan finished

string | null format: date-time
lastSyncedAt
required
string | null format: date-time
lastErrorMessage
required
string | null
createdAt
required
string format: date-time
recentRuns
required
Array<object>
object
id
required
string format: uuid
status
required
string
Allowed values: RUNNING COMPLETED FAILED
vendorsSeen
required
integer
invoicesSeen
required
integer
invoicesImported
required
integer
invoicesLinked
required

Of the imported invoices

integer
scanJobId
required

Set when this run was a historical scan rather than a sync

string | null format: uuid
errorMessage
required
string | null
startedAt
required
string format: date-time
completedAt
required
string | null format: date-time
company_id
string

Example

{
"provider": "BUSINESS_CENTRAL",
"status": "PENDING",
"mode": "SYNC",
"recentRuns": [
{
"status": "RUNNING"
}
]
}

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
details

Optional stable, content-free context, e.g. {reason, resets_at, preparation_id}.

object
key
additional properties
One of:
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
details

Optional stable, content-free context, e.g. {reason, resets_at, preparation_id}.

object
key
additional properties
One of:
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
details

Optional stable, content-free context, e.g. {reason, resets_at, preparation_id}.

object
key
additional properties
One of:
string

Example

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