Merge a duplicate case into this one (ADMIN+, dashboard user)
const url = 'https://api.invogi.com/v1/recoveries/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/merge';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"fromCaseId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","reason":"example"}'};
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/recoveries/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/merge \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "fromCaseId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "reason": "example" }'For two cases about the same loss (§7). The other case’s findings,
invoices, payments, refunds, credits and recorded money move here.
It becomes MERGED with mergedInto pointing at this case, keeps its
timeline, and contributes no value of its own.
The loss is counted once: the confirmed and identified amounts become
the larger of the two, never their sum, and an increase is recorded as
an amount adjustment.
Refused (409) when the cases differ in currency or supplier, when
this case is closed, when either is already merged, or when the money
recorded on both would exceed the loss.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
The duplicate case; one of the other case’s mergeCandidates lists this case
Example generated
{ "fromCaseId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "reason": "example"}Responses
Section titled “Responses”This case after the merge
object
CONFIRMED, IN_RECOVERY and AGREED are set by people (the stage); CREDIT_RECEIVED, PARTIALLY_REALIZED and REALIZED are derived from instruments and applications; the CLOSED statuses from closure.
What the source records suggested
What a person confirmed as recoverable
object
object
object
The case claims a payment that went out twice
The finding, invoice and payment this case claims. Each belongs to one case only.
object
object
object
object
Ledger credits the case claims, with the ledger’s current balance
object
PREPAYMENT is money paid to the supplier in advance and not yet applied to a bill
The credit’s number; for a prepayment
The ledger’s unused balance at lastSeenAt
Set once the ledger stopped listing the credit as open (used
Refunds from imported payment history the case claims (accepted suggested matches)
object
As the payment file named the payee
The other side of the duplicate pair, as evidence
object
object
object
object
Not counted as recovered
object
object
Append-only timeline, newest first
object
What should stop this loss happening again (§6.6)
Recent bills from the same supplier, in the case currency, with no recorded payment — open cases only
object
Open cases in the same currency (and supplier, where both have one) that this case could merge into or move a source to
object
The supplier’s contacts, primary first
object
E.g. Accounts receivable
Open cases only. Money that may answer this case: an unused ledger credit no case claims yet, or a refund from imported payment history, from the same supplier in the case currency, dated no more than 30 days before the case opened, and no larger than what the case is still waiting for (open less unapplied credit). Each credit or refund is offered to one case — the one it covers exactly, else the oldest. Accept or dismiss with /recoveries/{caseId}/matches/*.
object
The supplier credit or supplier refund
EXACT covers what the case is waiting for; PARTIAL is less
The credit’s unused balance
Issue date of the credit
For LEDGER_CREDIT
As the ledger or payment file named the supplier
Example
{ "status": "CONFIRMED", "stage": "CONFIRMED", "vatAdjustment": { "status": "REQUIRED" }, "sources": { "supplierCredits": [ { "provider": "XERO", "kind": "CREDIT_NOTE" } ] }, "instruments": [ { "kind": "CASH_REFUND" } ], "applications": [ { "verificationBasis": "USER_ATTESTED" } ], "prevention": { "suggestions": [ { "action": "MONITOR_NEW_BILLS" } ], "decision": { "decision": "DONE" } }, "suggestedMatches": [ { "kind": "LEDGER_CREDIT", "fit": "EXACT", "source": "XERO", "creditKind": "CREDIT_NOTE" } ]}Invalid request
object
object
Example
{ "error": { "code": "NOT_FOUND" }}API key lacks required scope/role
object
object
Example
{ "error": { "code": "NOT_FOUND" }}Resource not found
object
object
Example
{ "error": { "code": "NOT_FOUND" }}Conflicting idempotency key or resource processing state
object
object
Example
{ "error": { "code": "NOT_FOUND" }}