# I encountered a situation where I need to link an existing catalog with \`vendorRef=null\` to a vendor and am looking for some guidance

**URL:** <https://forums.broadleafcommerce.com/t/i-encountered-a-situation-where-i-need-to-link-an-existing-catalog-with-vendorref-null-to-a-vendor-and-am-looking-for-some-guidance/52>\
**Category:** Catalog\
**Created:** [December 9, 2024, 4:57pm UTC](https://forums.broadleafcommerce.com/t/i-encountered-a-situation-where-i-need-to-link-an-existing-catalog-with-vendorref-null-to-a-vendor-and-am-looking-for-some-guidance/52 "2024-12-09T16:57:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![broadleaf-moderator](https://yyz1.discourse-cdn.com/flex011/user_avatar/forums.broadleafcommerce.com/broadleaf-moderator/32/7_2.png) [@broadleaf-moderator](https://forums.broadleafcommerce.com/u/broadleaf-moderator)\
**Post date:** [December 9, 2024, 4:57pm UTC](https://forums.broadleafcommerce.com/t/i-encountered-a-situation-where-i-need-to-link-an-existing-catalog-with-vendorref-null-to-a-vendor-and-am-looking-for-some-guidance/52/1 "2024-12-09T16:57:00Z")

</div>

Full Question:

I encountered a situation where I need to link an existing catalog with `vendorRef=null` to a vendor and am looking for some guidance. I am considering an approach of copying the catalog along with the related categories, products, and relationships between them. However, the catalog already contains a large number of relations in our database and I am concerned that something might be missed during the copying process. Is it possible to instead update the `vendorRef` field for the catalog? What steps would you recommend to achieve this?

Answer:

[In our documentation regarding marketplace concepts](https://developer.broadleafcommerce.com/services/tenant-services/marketplace-concepts) the `catalog.vendorRef` field is immutable after creation for security and consistency purposes. The reasoning for this is because in the marketplace context, the `vendorRef` reference is propagated to a number of related, supporting tables.

If you only need to include a reference to a Vendor on the Catalog, you can safely update this value so it is no longer `null` in it’s entry.

However, if your requirements extend to the following, then you’ll need to do more work.

- External vendors using the admin to manage aspects of the catalog
- Two stage approval where the vendor can make changes that are separately approved in the scope of the marketplace application.

In these cases, you need to update all relevant relationships to support these functions which include:

- Corresponding catalog tables at `tenant.blc_tenant_catalog` and `catalog.blc_catalog`
- The vendor itself will have references in `blc_vendor`, `blc_mpl_appl_cat` and `blc_tenant_mpl_appl_cat` for the vendor entity and marketplace application catalog entities. It should have an auto generated catalog which would also be visible in `blc_tenant_catalog_ref`and `blc_catalog_ref`.
- Other potential entities, such as Order fulfillment or Inventory location
