Skip to content

Upsert external invoices

POST
/api/v1/tenants/{tenant_id}/workspaces/{workspace_id}/invoices/import/upsert

Create or update invoices by immutable external source identity.

X-Workspace-ID
Any of:
string
X-API-Key
Any of:
string
X-Tenant-ID
Any of:
string
ExternalInvoiceImportRequest

Batch external invoice import request.

object
invoices
required
Invoices
Array<object>
>= 1 items <= 200 items
ExternalInvoicePayload

Single external invoice payload for import/upsert.

object
source_system
required
Source System
string
>= 1 characters <= 50 characters
source_invoice_id
required
Source Invoice Id
string
>= 1 characters <= 200 characters
source_document_version
Any of:
string
<= 100 characters
invoice_number
Any of:
string
<= 200 characters
irn
Any of:
string
<= 200 characters
issue_date
required
Issue Date
string format: date
due_date
Any of:
string format: date
document_currency_code
Document Currency Code
string
default: NGN <= 3 characters
supplier_id
Any of:
string format: uuid
customer_id
Any of:
string format: uuid
supplier_name
Any of:
string
<= 500 characters
supplier_tin
Any of:
string
<= 100 characters
customer_name
Any of:
string
<= 500 characters
customer_tin
Any of:
string
<= 100 characters
direction
InvoiceDirection

Invoice direction - sent or received.

string
default: outbound
Allowed values: outbound inbound
invoice_type_code
Invoice Type Code
string
default: 380 <= 10 characters
line_extension_amount
required
Any of:
number
tax_amount_total
Any of:
number
payable_amount
required
Any of:
number
note
Any of:
string
metadata
Any of:
object
key
additional properties
any
import_policy
ExternalInvoiceImportPolicy

Conflict behavior for external invoice numbering.

string
default: preserve_if_unique_else_fallback
Allowed values: preserve_if_unique_else_fallback always_preserve_and_reject_on_conflict always_local_numbering
numbering_policy_id
Any of:
string format: uuid
Examples

Request payload example

{
"invoices": [
{
"source_system": "string",
"source_invoice_id": "string",
"source_document_version": "string",
"invoice_number": "string",
"irn": "string",
"issue_date": "2026-02-11",
"due_date": "2026-02-11",
"line_extension_amount": 0,
"payable_amount": 0
}
],
"import_policy": "preserve_if_unique_else_fallback",
"numbering_policy_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

Successful Response

ExternalInvoiceImportResult

Batch import/upsert execution result.

object
imported_count
Imported Count
integer
0
updated_count
Updated Count
integer
0
skipped_count
Skipped Count
integer
0
conflict_count
Conflict Count
integer
0
errors
Errors
Array<object>
default:
object
key
additional properties
any
invoice_ids
Invoice Ids
Array<string>
default:
conflict_ids
Conflict Ids
Array<string>
default:
Examples

200 response example

{
"imported_count": 0,
"updated_count": 0,
"skipped_count": 0,
"conflict_count": 0
}

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examples

422 response example

{
"detail": [
{
"loc": [],
"msg": "string",
"type": "string"
}
]
}