Skip to content

Import normalized supplier payments or refunds and run deterministic duplicate-payment checks (ANALYST+)

POST
/payments/import
curl --request POST \
--url https://api.invogi.com/v1/payments/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "rows": [ { "supplierName": "example", "supplierTaxId": "example", "supplierExternalId": "example", "invoiceExternalId": "example", "invoiceNumber": "example", "amount": "example", "currency": "GBP", "paidAt": "2026-04-15", "paymentReference": "example", "method": "example", "direction": "PAYMENT", "sourceRowNumber": 1 } ], "source": "BANK_STATEMENT", "dataProfile": { "profileId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "revisionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "clientDiagnostics": { "inputRowCount": 1, "rejectedRowCount": 1, "warningRowCount": 1, "unusedColumnCount": 1 } } }'
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.

Idempotency-Key
string
X-Invogi-Source-Name
string
<= 255 characters

Optional source label, percent-encoded UTF-8 (as encodeURIComponent produces). Only a bounded base filename is retained; raw file contents and local paths are not stored.

Media typeapplication/json
object
rows
required
Array<object>
>= 1 items <= 5000 items
object
supplierName

Payee name as exported

string
supplierTaxId
string
supplierExternalId

The payee’s ID in the customer’s system; kept as evidence

string
<= 200 characters
invoiceExternalId

Matches an invoice’s externalId

string
invoiceNumber

Matches an invoice by number when there is no invoice ID

string
<= 200 characters
amount
required

A positive payment amount; at most 18 integer and 6 decimal digits

string
/^-?[0-9]+(\.[0-9]{1,6})?$/
currency

Optional; defaults to the organization’s base currency

string
/^[A-Za-z]{3}$/
paidAt
required
string format: date
paymentReference
string
method
string
direction

REFUND is money the supplier sent back (in an export, a row of the opposite sign to the payments). It is kept as a supplier refund that can be suggested on a matching recovery case, never checked as a payment. The amount stays positive. A refund already imported (same payee, currency, amount, date and reference) is not added again.

string
default: PAYMENT
Allowed values: PAYMENT REFUND
sourceRowNumber
required
integer
source

What kind of file the rows came from. AP_PAYMENT_EXPORT (the default): an AP or ERP payment report, where every REFUND row is a supplier refund. BANK_STATEMENT: a bank account export, where a REFUND (credit) row is kept as a supplier refund only when it resolves to a known supplier by invoice, tax ID or exact name. A credit that matches an earlier payment to that supplier (same amount and currency, paid within the previous 14 days, explicit return/rejection wording, and containing the earlier payment’s non-empty reference) is counted as a returned payment instead and sets that payment’s returnedOn, which excludes it from later duplicate-payment checks. A credit matching a payment in an undismissed duplicate-payment finding or a recovery case is kept as a supplier refund instead. Other credits are counted and not stored. BANK_STATEMENT rows are processed in date order, credits first on each date.

string
Allowed values: BANK_STATEMENT AP_PAYMENT_EXPORT
dataProfile

Optional SETTLED_PAYMENTS profile (dashboard users only); its file type must equal source. Accepted on preview for early validation; only an import records a receipt.

object
profileId
required
string format: uuid
revisionId
required
string format: uuid
clientDiagnostics

Counts the browser observed, stored labelled as client-reported

object
inputRowCount
integer
rejectedRowCount
integer
warningRowCount
integer
unusedColumnCount
integer

Payments and refunds imported; any candidates were added to the review queue

Media typeapplication/json
object
importBatchId
required
string format: uuid
paymentsImported
required
integer
refundsImported
required
integer
creditsIgnored
required

BANK_STATEMENT credits not tied to a known supplier; not stored.

integer
returnedPayments
required

BANK_STATEMENT credits that matched an earlier payment; not stored as refunds.

integer
recordsNeedingReview
required

Distinct imported payment records routed to review; one record can produce several findings.

integer
findingCounts
required
object
key
additional properties
integer
coverage
required
object
linkedToInvoice
required
integer
linkedToSupplier
required
integer
provisionalPayee
required
integer
unmatched
required
integer
dataProfile
object
bindingId
required
string
profileId
required
string
revisionId
required
string
revisionNumber
required
number
name
required
string

Example generated

{
"importBatchId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"paymentsImported": 1,
"refundsImported": 1,
"creditsIgnored": 1,
"returnedPayments": 1,
"recordsNeedingReview": 1,
"findingCounts": {
"additionalProperty": 1
},
"coverage": {
"linkedToInvoice": 1,
"linkedToSupplier": 1,
"provisionalPayee": 1,
"unmatched": 1
},
"dataProfile": {
"bindingId": "example",
"profileId": "example",
"revisionId": "example",
"revisionNumber": 1,
"name": "example"
}
}

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"
}
}

Conflicting idempotency key or resource processing state

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"
}
}