> ## Documentation Index
> Fetch the complete documentation index at: https://docs.closient.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage Product Merchant Links

> Add, update, list, and remove a product's merchant links (direct links to the product's page at the online stores that sell it) -- the programmatic equivalent of the dashboard's merchant links page.

Programmatic equivalent of the dashboard's `products/<gtin>/merchant-links/` page.

## When to use

* A brand owner wants shoppers who scan a product to see where to buy it online, with a direct
  link to the product at each store.
* A store moved the product to a new address, or stopped selling it.

## Auth

`X-API-Key` header or OAuth token. Writing takes membership of the product's organization with
the contribute role (Editor or Manager). A read-only key is refused with `403`; a product or
link another organization owns answers `404`, so the API never confirms it exists.

## Flow

```
GET    /products/api/v1/merchant-links?gtin={gtin}
GET    /products/api/v1/merchant-links/{link_id}
POST   /products/api/v1/merchant-links
PATCH  /products/api/v1/merchant-links/{link_id}
DELETE /products/api/v1/merchant-links/{link_id}
```

* **List** -- every merchant link of the product in `gtin`, ordered by name, with each link's
  `id`, `name`, `url` and the read-only `merchant_name`.
* **Create** -- the body is `gtin`, `name` (the store's name) and `url`; fields are listed in the
  OpenAPI document at `/products/api/v1/openapi.json`. The `url` must start with `https://`.
* **Update** -- `PATCH` with only the fields you are changing, addressed by the link's `id`.
* **Delete** -- removes the link permanently.
* **Read back** -- every create and update returns the saved link; list again to confirm.

Returns `403` for a read-only key, `404` for a product or link the caller cannot see, and `422`
for an invalid value, such as an address that is not `https://`.

## Notes

Closient staff can attach a merchant from Closient's catalog to a link (`merchant_name`), and the
hosted page then shows that merchant's name in place of `name`. The API cannot change that
attachment.

The fields a brand writes on a link are defined once on the model
(`MerchantLink.BRAND_EDITABLE_FIELDS`); both API schemas and the dashboard form are pinned to
that set.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.