Mark duplicate vendors

Operation ID: markVendorDuplicate

Group: Accounting › Vendors

Open in the interactive reference

POST /accounting/vendors/{id}/mark-duplicate

Retry-safe: A write that accepts Idempotency-Key: repeating a request with the same key replays the stored answer instead of executing twice.

Marks duplicate vendors. The vendor in the path becomes the parent of each vendor in duplicateVendorIds. The duplicates are deactivated. Their vendor bills and vendor credits that are unposted, or posted only in open accounting periods, are reassigned to the parent. Documents in locked periods stay with the duplicate. Vendors already marked as duplicates of a listed vendor are reassigned to the new parent too.

The parent vendor must be active. If any id in duplicateVendorIds doesn't exist, nothing is written. The request fails if a reassigned bill has the same bill number as one of the parent's bills.

The response gives foldedCount, the number of ids in duplicateVendorIds. Vendors reassigned from a listed vendor aren't counted.

Parameters

Name In Type Required Description
Api-Version header string · v1 yes The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1.
Idempotency-Key header string no An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with 400 IDEMPOTENCY_NOT_SUPPORTED rather than silently ignored.
id path string yes Id (a UUID) of the parent vendor the duplicates are folded into; bound from the :id path segment. Example: "a17c3e58-4b62-4d19-8f70-2c5d9e1a6b34".

Request body

Required, application/json: markVendorDuplicateInput.

Field Type Required Description
duplicateVendorIds array<string> yes Ids (UUIDs) of the vendors to mark as duplicates of the parent. At least one is required. Example: ["9b2d5e10-4c78-4a36-8f51-6e0a3c7b2d95"].
{
  "duplicateVendorIds": [
    "9b2d5e10-4c78-4a36-8f51-6e0a3c7b2d95"
  ]
}

Response

200 Success

Under data (markVendorDuplicateOutput):

Field Type Required Description
foldedCount number yes How many vendors were folded into the parent. Example: 1.
{
  "data": {
    "foldedCount": 1
  },
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}

Response headers

Errors

Code Status
NOT_FOUND 400
REFERENCE_NOT_FOUND 400
VENDOR_IS_DRAFT 400
EMPTY_CHILDREN 400
PARENT_INACTIVE 400
IDEMPOTENCY_KEY_CONFLICT 409
IDEMPOTENCY_PAYLOAD_MISMATCH 422

Statuses