Import normalized supplier payments or refunds and run deterministic duplicate-payment checks (ANALYST+)
const url = 'https://api.invogi.com/v1/payments/import';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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}}}'};
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/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 } } }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”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.
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.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Payee name as exported
The payee’s ID in the customer’s system; kept as evidence
Matches an invoice’s externalId
Matches an invoice by number when there is no invoice ID
A positive payment amount; at most 18 integer and 6 decimal digits
Optional; defaults to the organization’s base currency
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.
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.
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
Counts the browser observed, stored labelled as client-reported
object
Responses
Section titled “Responses”Payments and refunds imported; any candidates were added to the review queue
object
BANK_STATEMENT credits not tied to a known supplier; not stored.
BANK_STATEMENT credits that matched an earlier payment; not stored as refunds.
Distinct imported payment records routed to review; one record can produce several findings.
object
object
object
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
Missing or invalid API key
API key lacks required scope/role
Conflicting idempotency key or resource processing state