Skip to main content
POST
Merge vendors
field_sources and custom_field_sources select the vendor whose value the survivor keeps for each field. A field that they do not name keeps the survivor value. When the survivor value is empty, the field gets the first duplicate value. Bank and payment details always stay on the survivor. You cannot undo a merge. Side effects
  • DualEntry moves all records, attachments and company access of the duplicate vendors to the survivor vendor.
  • DualEntry archives the duplicate vendors and sets their merged_into_id to the survivor vendor.
  • When the survivor takes the name of a duplicate vendor, DualEntry adds (merged into <survivor code>) to the name of that duplicate.
  • DualEntry sets each changed open 1099 run back to draft. Compute these runs again.
  • DualEntry sends one core.vendor/merged webhook event for each duplicate vendor.
Additional validations
  • Fails with 422 if a vendor is an intercompany vendor, if the vendors have different tax IDs, tax registrations or subsidiaries, or if a 1099 run for these vendors is in progress.
  • Fails with 422 if the merge must move or read more than 20,000 rows, if the API key cannot access a company where the duplicate vendors have records, if the merge gives the survivor access to companies that the API key cannot access, or if the selected company_access does not include a company where the vendors have records.
  • Fails with 422 if field_sources or custom_field_sources selects a vendor that is not part of the merge, or an unknown custom field.
  • Fails with 409 if another merge uses one of the vendors.
  • Fails with 417 and changes no data if the merge does not finish in 25 seconds.

Authorizations

X-API-KEY
string
header
required

Headers

Idempotency-Key
string

Optional. A unique value (a UUID works well) identifying this operation. If the request is repeated with the same key, the original response is replayed instead of the operation running again, so a retry cannot create a duplicate record. Results are replayable for 48 hours. Reusing a key with a different request body returns 422.

Maximum string length: 255

Body

application/json
target_vendor_id
integer
required

ID of the survivor vendor. Its ID, code and records stay.

source_vendor_ids
integer[]
required

IDs of the duplicate vendors. The merge moves their records to the survivor and archives them.

Required array length: 1 - 25 elements
field_sources
Field Sources · object

For each field, the ID of the vendor whose value the survivor keeps. A field that is not in this object keeps its default.

custom_field_sources
Custom Field Sources · object

For each custom field ID, the ID of the vendor whose value the survivor keeps.

Response

OK

target_vendor_id
integer
required
merged_vendor_ids
integer[]
required
moved_counts
Moved Counts · object
required
applied_field_sources
Applied Field Sources · object
required
applied_custom_field_sources
Applied Custom Field Sources · object
required
reset_tax_1099_run_ids
integer[]
required
success
boolean
default:true