Merge vendors
Merge the duplicate vendors in source_vendor_ids into the survivor in target_vendor_id. For each field, field_sources and custom_field_sources select the vendor that gives the value. A field that you do not name keeps the survivor value. When that value is empty, the field gets the first duplicate value. The survivor always keeps its bank and payment details, and 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
422when a vendor is an intercompany vendor, or when a 1099 run for these vendors is in progress. It also fails when the vendors have different subsidiaries, tax IDs, or VAT or GST registrations. - Fails with
422when the merge must move or read more than 20,000 rows. It also fails when your API key cannot access a company where the duplicates have records. The same rule applies to a company that the merge adds to the company access of the survivor. A selectedcompany_accessmust include each company where the vendors have records. - Fails with
422whenfield_sourcesorcustom_field_sourcesselects a vendor that is not in the merge, or a custom field that does not exist. - Fails with
409when another merge uses one of the vendors. - Fails with
417when the merge does not finish in 25 seconds. No data changes.
Headers
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.
255Body
Response
OK