Capabilities & Permissions
Channel partner capabilities determine which API endpoints a partner can access. Capabilities are defined by the PartnerCapabilityType enum, granted or revoked by e2c staff in the boss admin panel, and enforced by ChannelPartnerAuthMiddleware per request path.
Available Capabilities
| Capability | Description | Enforced scope |
|---|---|---|
outbound_submit | Submit outbound requests, read outbound orders, dispatch | /channel/api/v1/outbound/* (except attachment/evidence sub-paths), /channel/api/v1/dispatch/* |
outbound_view | Outbound viewing capability; granted only on the registration path together with outbound_submit; editing a member in the admin panel grants only outbound_submit + inventory_view and never this capability alone | — |
outbound_attachment_upload | Upload, update, delete and batch-process outbound attachments | /channel/api/v1/outbound/attachment/* |
outbound_evidence_view | Read-only access to warehouse execution evidence | /channel/api/v1/outbound/evidence/* |
outbound_webhook_manage | Manage outbound webhook subscriptions | /channel/api/v1/webhook/* |
inventory_view | View owned inventory | /channel/api/v1/inventory/* |
platform_stock | Include platform-owned stock in inventory queries and outbound deduction | No path gate; the inventory/outbound services check the capability |
Path Enforcement Rules
The middleware matches a path prefix and checks the mapped capability; a missing capability returns business code 606:
api/v1/outbound/attachment/→outbound_attachment_uploadapi/v1/outbound/evidence/→outbound_evidence_viewapi/v1/webhook/→outbound_webhook_manageapi/v1/inventory/→inventory_viewapi/v1/outbound/→outbound_submitapi/v1/dispatch/→outbound_submit
Orders (order/*), products, shops, cart drafts and reconciliation paths do not check capabilities; a valid token is enough. platform_stock is a data-scope capability and never a path gate.
Default Grants
- Registration with
warehouseinuser_types: all 7 capabilities are granted automatically (outbound_submit,outbound_view,outbound_attachment_upload,outbound_evidence_view,outbound_webhook_manage,inventory_view,platform_stock). - Registration without
warehouse: no capability is granted automatically; staff must grant them explicitly. - Editing a member in the admin panel and setting
user_typestowarehouse/warehouse_operator: grantsoutbound_submit+inventory_view; removing those roles revokes the same two capabilities. - Capability rows are keyed by
member_id + capability; onlyactive=1counts.
Checking Capabilities
POST /channel/api/v1/auth/me returns the user profile and granted capabilities (the endpoint is inside the auth/* whitelist and resolves Authorization: Bearer itself):
{
"code": 200,
"data": {
"id": 1,
"member_id": 42,
"email": "ops@example.com",
"name": "Ops",
"role": "admin",
"is_primary": true,
"user_type": "buyer,warehouse",
"capabilities": [
"outbound_submit",
"outbound_view",
"outbound_attachment_upload",
"outbound_evidence_view",
"outbound_webhook_manage",
"inventory_view",
"platform_stock"
]
}
}
/auth/medoes not return amenufield. The portal sidebar is generated by the frontend fromcapabilities; the API promises no menu structure.
Portal Menu
The partner portal renders its sidebar from capabilities: without inventory_view there is no Inventory entry, without outbound_submit no Outbound entry, and without outbound_webhook_manage no Webhook settings.
Admin Management
e2c staff can grant or revoke capabilities via the boss admin panel:
- Navigate to CRM → Members
- Find the
channel_partnermember - Click Capabilities in the action column
- Toggle individual capabilities on/off
Or via admin API:
POST /api/v1/partner/capability/grant—{ member_id, capability }POST /api/v1/partner/capability/revoke—{ member_id, capability }POST /api/v1/partner/capability/list—{ member_id }