Merge vendors
Merge the duplicate vendors in source_vendor_ids into the vendor in target_vendor_id. 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
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
ID of the survivor vendor. Its ID, code and records stay.
IDs of the duplicate vendors. The merge moves their records to the survivor and archives them.
1 - 25 elementsFor each field, the ID of the vendor whose value the survivor keeps. A field that is not in this object keeps its default.
For each custom field ID, the ID of the vendor whose value the survivor keeps.
Response
OK