Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

1.3 KB
Raw Blame
---
title: "Select Seller"
api: "POST /vendor/sellers/select"
description: "Set the active seller for the member's session."
---

Verifies the member belongs to the chosen seller. For session-authenticated requests the seller is also stored in the session.

<Note>
  Requires only the `Authorization` header. Session-based clients get the seller stored server-side; token-based clients should send `x-seller-id` on subsequent requests instead.
</Note>

## Body parameters

<ParamField body="seller_id" type="string" required>
  The ID of the seller to activate for this session.
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the seller was selected.
</ResponseField>

<ResponseField name="seller_id" type="string">
  The selected seller's ID. Token-based clients send it as `x-seller-id` on subsequent requests.
</ResponseField>

<RequestExample>
```bash cURL
curl -X POST 'http://localhost:9000/vendor/sellers/select' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"seller_id": "sel_01HXYZ"}'
```

```ts JS Client
const { seller_id } = await client.vendor.sellers.select.mutate({
  seller_id: "sel_01HXYZ",
})
```
</RequestExample>

<ResponseExample>
```json 200
{ "success": true, "seller_id": "sel_01HXYZ" }
```
</ResponseExample>