Update match

PUT https://api.invunion.com/api/v1/matches/:id matches:write Idempotency-Key Markdown

Update match status or allocated amount.

Partial update. This call cannot change which invoice or bank line is linked. It only updates matchedAmount, status, or metadata on an existing row, and the path is the match UUID from List, Create, or a webhook — not from the product.

status cancelled on an active or confirmed match reverses the payment with reason other, exactly like Reverse match: the row is kept as cancelled with who and when, and one invoice.settlement_changed webhook is sent. Use Reverse match to give the real reason or match the right transaction in the same step. pending_review can be confirmed or rejected. Changing matchedAmount on an active match recalculates invoice and transaction remaining amounts.

To change the amount on the same pair, list the match then send matchedAmount. To confirm a suggestion, list pending_review then send status confirmed. To deny a suggestion, Create match with status rejected and the invoice number plus transaction code. To undo an auto-match, Reconcile transaction with unlink_all on the transaction code. To point the payment at another invoice, unlink then Create match with the new invoice number. Do not use Reconcile save; that is the Invunion workbench.

See also

  • Matches . Which call to use for each change.
  • List matches (GET/api/v1/matches). Get the UUID by invoice number and transaction code.
  • Create match (POST/api/v1/matches). Allocate, or deny a pair with status rejected.
  • Reconcile transaction (POST/api/v1/transactions/:code/reconcile). Undo every live match on a bank line with unlink_all.
  • Reverse match (POST/api/v1/matches/:id/reverse). Reverse a wrong payment with a reason.
  • Delete match (DELETE/api/v1/matches/:id). Delete a suggested, rejected, or cancelled row.

Path parameters

NameTypeRequired
id

Match UUID.

Example: 1c9e6679-7425-40de-944b-e07fc1f90ae7

string

No maximum

Required

Body parameters

NameTypeRequired
status

New match status.

string

No maximum

Optional
Allowed valuesactivecancelledconfirmedrejected
matchedAmount

New positive allocated amount.

Example: 800

number
Optional
metadata

JSON object. At most 32 keys, nested depth 3, 8 KB serialized, and 64-character key names. Keys __proto__, constructor, and prototype are rejected.

Example: {"reason":"partial bank fee"}

object
Optional

Errors

This operation can return the following errors in addition to generic HTTP failures.

Error HTTP code Description
Missing Bearer token 401 The Authorization header is missing or is not a Bearer token.
Invalid or revoked API key 401 The API key is unknown, malformed, expired, or has been revoked.
API key is missing scope matches:write 403 The key does not include matches:write. A write scope does not imply the matching read scope.
Too many requests, please try again later 429 More than 100 requests in one minute from this API key or IP address. Wait for the Retry-After header (seconds) and retry.
Validation failed 400 The body failed schema validation. details lists field and message.
Match not found 404 No match with this UUID exists in the authenticated tenant.
Internal server error 500 Unexpected server error. The JSON body includes correlationId. Retry with backoff.
Idempotency-Key must be 8-255 characters: letters, digits, ".", "_", ":" or "-". 400 The Idempotency-Key header is present but malformed.
A request with this Idempotency-Key is still being processed. 409 The first request with this key has not finished. Retry after it completes. code is idempotency_in_progress.
This Idempotency-Key was already used with a different request body. 422 Send a new key for a different request. code is idempotency_key_reuse.