# Custom URL Parameter

## **useCustomer**

The `useCustomer` parameter ensures that a user is redirected to the correct context when they have access to multiple customer accounts. It allows you to define exactly which customer context should be active when a link is clicked.

#### Why use it?

In B2B environments, a single user often manages or buys for multiple companies. If a user is currently logged in under "Company A" but clicks an email link intended for "Company B", they might encounter an error or see the wrong data.

By appending `useCustomer`, the platform automatically switches the user to the correct customer context before loading the page, provided the user has the necessary permissions for that customer.

#### Implementation Details

* Availability: This parameter is currently supported exclusively for the `/b2b_platform` controller (all Vue.js-based B2B Platform URLs).
* Accepted Values: You can pass either the Customer Number or the Customer ID (UUID).

#### Practical Example: Offer Management

This function is primarily used within the Offer Management workflow. When a sales representative sends an offer to a customer:

1. The "Order Offer" button in the email includes the `useCustomer` parameter.
2. Upon clicking, the user is instantly switched to the correct customer account.
3. The offer checkout pop-up opens immediately with the correct context, preventing manual switching.

{% hint style="info" %}
Always include the `useCustomer` parameter when generating URLs for emails or third-party integrations to ensure a seamless user experience.
{% endhint %}

{% hint style="warning" %}
For better security and to avoid exposing internal database structures, we recommend using the Customer Number rather than the Customer UUID in public-facing links.
{% endhint %}


---

# 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.b2b-sellers.com/b2b-platform/developer-guide/b2bsellers-core-plugin/custom-url-parameter.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.
