Skip to main content

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

ExportSideWhat it is
CommerceB2BUnit, CommerceB2BUnitSchemaclientOrg-unit shape (id, name, hierarchy)
CommerceB2BCostCenter, CommerceB2BCostCenterShallow, schemasclientCost-center shapes for checkout and account UIs
SapAttachment interfacesclientAttachment shapes used by B2B documents/quotes
CommerceB2BUsersServiceserverB2B user/org lookups against OCC
CommerceB2BCostCentersServiceserverCost-center listing and resolution
CommerceB2BCartsServiceserverOrg-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.