B2B
@archibald/commerce/b2b covers the SAP Commerce B2B module: organizational units, cost centers, B2B users and org-scoped carts. It underpins the quotes domain and the shop template's portal platform (the B2B storefront reference).
How to use
The subpath ships typed interfaces for the client and services for the server. Components and project interfaces type against the schemas:
import { CommerceB2BUnitSchema, type CommerceB2BUnit } from '@archibald/commerce/b2b';
import type { CommerceB2BCostCenter, CommerceB2BCostCenterShallow } from '@archibald/commerce/b2b';
Server-side, the services are consumed by your controllers/modules (and by the auth extension seam — portal subclasses CommerceUserAuthProvider to attach the user's B2B unit to the session):
import { CommerceB2BUsersService, CommerceB2BCostCentersService, CommerceB2BCartsService } from '@archibald/commerce/b2b';
API reference
| Export | Side | What it is |
|---|---|---|
CommerceB2BUnit, CommerceB2BUnitSchema | client | Org-unit shape (id, name, hierarchy) |
CommerceB2BCostCenter, CommerceB2BCostCenterShallow, schemas | client | Cost-center shapes for checkout and account UIs |
SapAttachment interfaces | client | Attachment shapes used by B2B documents/quotes |
CommerceB2BUsersService | server | B2B user/org lookups against OCC |
CommerceB2BCostCentersService | server | Cost-center listing and resolution |
CommerceB2BCartsService | server | Org-scoped cart operations |
Configuration
Reads the hybris block of the environment config; B2B endpoints follow the configured OCC base.
Further documentation
- Quotes — the request-for-quote flow built on these services.
- Authentication — attaching B2B org data to the session.