Businesses and multi-tenancy
A tenant is one business on Sedra, for example Foulad Store or Midad Store. A tenant has a handle (foulad-store), an ID (ten_…) and a mode:
single: the business runs its own store.marketplace: the business hosts vendors that sell through it (for example Foulad Market).
How isolation works
Section titled “How isolation works”Sedra enforces tenant boundaries in the application layer, on every request:
- Storefront API: the publishable key selects the business. Product, category, promotion and order reads are limited to that business’s sales channel and links.
- Merchant Agent API and MCP: each capability checks that your credential is a member of the business you name (
tenant) with the required role. Records are linked to their tenant; lookups outside your business returnnot_foundortenant_forbidden. - Fail closed: a record that is not linked to a business is invisible to every business-scoped call.
Choosing the business in a call
Section titled “Choosing the business in a call”| API | How the business is chosen |
|---|---|
| Storefront | The x-publishable-api-key header |
| Merchant Agent API | The required tenant field (handle or ten_… ID) in the request body |
| MCP | select_business once per session, or tenant on each tool call |
| Sedra App API | tenant on invoke; the user’s memberships come from GET /me |
Marketplace vendors
Section titled “Marketplace vendors”In a marketplace business, a vendor seat sees only:
- products that belong to the vendor,
- the vendor’s share of each order (lines, subtotal, commission, payout amount),
- payout summaries. Payouts are reported, not transferred: Sedra does not move money to vendors.
Capabilities marked vendor-aware in the tool catalog apply these limits automatically.