# Detecting Merchants Connections

Violet recommends storing the Violet `merchant_id` in your database once a merchant has successfully completed Violet Connect Onboarding. This is so that you are able to fetch details about this merchant adhoc to power your own dashboard.

There are two methods to accomplish this:

## Using Redirects

Violet appends `merchant_id` to the end of a [re-direct URL](/prism/violet-connect/setup.md#redirect-url) that you provide us as a query parameter. You can parse the `merchant_id` from this re-direct.

Here is a sample of how you could use the Violet Connect flow and where you can retrieve the `merchant_id`:

1. Merchant starts your onboarding flow
2. You send Merchant to Violet Connect
3. Merchant completes Violet Connect flow
4. Merchant is re-directed back to your dashboard through your re-direct URL
5. Merchant completes your onboarding flow

Step 4 is where Violet takes the re-direct URL you’ve set in the channel dashboard, appends the `merchant_id` as a query parameter show in the end of the URL and directs back to your onboarding dashboard. You can then take this `merchant_id` in Step 5, and store it on your end.

## Using Webhooks

You can subscribe to the [Merchant Connected](/prism/webhooks.md#merchants) webhook to receive the full `Merchant` object when a merchant connects to your channel. This object will contain useful details, including the `merchant_id`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.violet.io/prism/violet-connect/guides/detecting-merchants-post-connection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
