B2B Suite for Magento 2 Open Source
- Compatibility
- 2.4.9, 2.4.8, 2.4.7
- Hyvä theme
- Hyvä compatible
Description / B2B Suite for Magento 2 Open Source
MAGENTO 2 · MAGENTO OPEN SOURCE · COMPANIES · B2B COMMERCE
Combine B2B and B2C sales in one Magento installation.
Kowal B2B Suite extends Magento Open Source with companies, EU VAT number validation in VIES, individual commercial terms, shopping lists, RFQ offers, trade credit, approvals, documents and integrations.
Serve business customers through a self-service portal and manage sales staff workflows in Magento Admin.
17 modules and a base theme · REST and GraphQL · Hyvä account adapter
HOW IT WORKS IN PRACTICE
01 · Define your sales model
Set up companies, channels, prices and data sources.
02 · Configure the B2B process
Assign roles, catalog access, terms and approvals.
03 · Connect systems and deploy
Select adapters and verify complete scenarios.
The full feature set of Kowal B2B Suite
From registering a business customer and setting a price to offers, orders, documents and data exchange. Choose the areas to activate according to your company’s sales rules.
Companies and the customer lifecycle
Maintain company records with a name, tax ID, external identifier and sales representative.
- Company registration and approval, activation, blocking or rejection.
- Statuses: pending, active, inactive, blocked and rejected.
- Links to Magento customer accounts, customer groups and sales channels.
- A history of changes to companies, users, roles, addresses and contacts.
Users, roles, addresses and contacts
Each company can have multiple buyers and its own roles with defined permissions.
- Assign and deactivate users and change their roles.
- Separate permissions for placing orders, viewing company orders, RFQ, documents, users and addresses.
- Billing and shipping addresses, website-specific defaults and shared company addresses.
- Company contacts, including a primary contact; editing is subject to permissions.
- Company details and tax ID remain separate from the buyer’s personal address data.
Tax ID and EU VAT number validation in VIES
Check EU VAT numbers, including their country prefix, directly on the B2B company record in Magento Admin. The “Validate in VIES” button runs the check and displays the result next to the Tax ID field.
- EU VAT numbers with a country code, such as
PL1234567890; validation covers countries that Magento recognises as EU members. - Input normalisation: spaces, dots and hyphens are ignored, and letters are converted to uppercase before validation.
- Support for the Greek EL prefix by mapping it to the GR country code used by Magento.
- Format and country checks before sending a request to VIES, with a message when the input needs correcting.
- Distinct outcomes: valid in VIES, invalid in VIES, invalid input or validation unavailable.
An authorised administrator starts the check for a previously saved company and VAT number, in the context of an active B2B channel assigned to that company. A changed number must be saved first.
Saved VIES results and data freshness checks
The result is saved immediately against the company, together with the validation date and time and the VAT number checked. This makes it easier to identify data that needs checking again.
- A VIES status column in the company list with filters for not checked, valid, invalid, invalid format or VIES unavailable.
- A validation date column with date-range filtering.
- Reset after a VAT number change: saving a different number restores the “not checked” status and clears the previous date and the saved record of the checked number.
- The result is retained when only formatting changes, such as spaces, separators or letter case, and when other company details are edited.
- The result stays linked to the correct number: if the VAT number changes during validation, the module rejects saving the result for the previous number and asks for another attempt.
When the service cannot verify the number, the administrator receives a separate validation-unavailable message with a request to try again later. A connection error is distinguished from a negative VIES result.
B2B and B2C in one installation
Enable B2B for selected Magento websites. All store views within that website use B2B mode, while other websites can serve B2C customers.
- A company can be assigned to multiple active B2B websites.
- Relationship activity and the company’s customer group are configured separately for each website.
- Prices, catalogs, documents, limits, quotes and integrations operate in the correct company and channel context.
- Adding a website assignment does not move Magento customer accounts or automatically change their groups.
Access control and a private B2B portal
Choose from three models: a public store, a store requiring login or a public catalog with guest restrictions.
- Forced login with exceptions for selected actions or URL paths.
- Return to the originally requested page after login.
- Independent controls for hiding prices and disabling guest purchases.
- Custom messages and a login link in place of a price or purchase button.
- Hide standard Add to Cart controls and block cart additions on the server in the classic storefront.
- Keep customer registration open or disable it.
Protection for the standard storefront must be implemented separately in a custom public API or headless frontend.
Migrate existing customers to companies
The Assign or Create Company mass action helps organize your existing Magento customer database.
- Filter customers with or without a company assignment, including in exports and mass actions.
- Match a company by normalized tax ID or create a new one; accounts without a tax ID receive separate companies.
- Copy default addresses and the primary contact to a newly created company.
- Assign a buyer role with basic B2B permissions.
- Preserve existing customer groups, skip accounts already assigned and report migration results and errors.
Administration and mass operations
Manage companies and their related data from one B2B menu. Magento customer records include a company assignment field.
- Lists and forms for companies, users, roles, addresses, contacts and audit records.
- Bulk changes to status, sales representative, website assignment, relationship activity and the company’s customer group.
- Bulk creation or updating of roles, with an option to assign a role to all active users of selected companies.
- A separate transaction and audit entries for each company processed.
- Magento administrator permissions that restrict access to individual operations.
Price lists, contract prices and quantity tiers
Set prices by company, website, SKU, currency and quantity. Contract prices take priority, followed by an assigned B2B price list and then Magento catalog pricing.
- Multiple price lists and prioritized assignments to companies.
- Contract prices and price list items with quantity tiers and validity-period fields.
- Apply contract and price list prices in the cart.
- Price indexing, change auditing and Explain Price to identify the selected price source.
- CSV import and export of price list items and price access through the API.
RFQ price suggestions account for the store, customer, quantity, currency and taxes; when catalog pricing is used, they also include applicable Magento promotions.
A company-specific catalog
Control product visibility with rules for an individual company or an entire website.
- Rules covering selected products, categories or the whole catalog.
- Allow and deny actions; denial takes precedence over permission.
- A visibility index and filtering of storefront product listings.
- Access checks for hidden SKUs and revalidation in shopping lists, RFQ and checkout.
- Inspect product visibility for a company and rebuild the index through the API.
The absence of a matching rule does not itself hide a product. The offering remains based on Magento’s native catalog.
Quick orders and shopping lists
Customers create named shopping lists and add multiple items by SKU instead of searching for products individually.
- Paste up to 100 rows at a time: SKU, quantity and an optional note, for example
SKU-001;10;Deliver to warehouse. - Lists with a default flag, items, the last B2B price and currency.
- Validate SKU, product status, website assignment, company visibility, positive quantity and B2B price.
- Add a list to the cart after revalidation.
- Administrators can view lists, remove items and export items to CSV.
- Debug SKU plus screens for import logs and row errors from processes supplying this data.
RFQ: requests from the customer account
An authorized buyer can submit a request with a title, a note and between 1 and 200 items.
- Search by SKU, product name and existing EAN, EAN13, GTIN or barcode attributes.
- Suggestions limited to active, visible simple and virtual products.
- Quantity, an optional requested net unit price and an item comment.
- Net and gross price previews; quantity changes refresh suggestions while preserving manually entered prices.
- Prices handled in the store currency and according to its tax configuration.
- Validation of the entire request: an invalid item rolls back the save, while the form retains data for correction.
RFQ: preparing and negotiating offers
Sales staff can also create RFQs in Magento Admin by selecting the website, Store View, company, customer, currency and products.
- Save a draft or a submitted request; product search with net and gross price suggestions.
- Requested and offered prices, a negotiated total, expiry date, comments and sales notes.
- Workflow statuses, decision history and protection against accepting an expired offer.
- Email a prepared offer with links to its details and PDF that require login.
- Customer acceptance or rejection, an optional rejection reason and administrator decisions.
- Separate customer and administrator PDFs; internal notes and administrative history remain in the admin version.
From an accepted offer to an order
Transfer items and agreed prices from an accepted offer into Magento’s purchasing process.
- Convert to Cart creates a customer cart with the offer’s items and prices.
- A customer with ordering permission proceeds to standard checkout to choose an address, shipping and payment.
- Create Order in Admin creates an order automatically when the required addresses and unambiguous payment and shipping methods are available.
- When terms still need to be selected, the offer is loaded into Magento’s native backend order creation form.
- Preserve the offer’s Store View context and its link to the prepared cart or order.
Checkout, payments, shipping and PO numbers
Add B2B rules to Magento’s standard ordering process.
- Check the active company, website assignment and the user’s permission to place orders.
- Validate the catalog and B2B price availability when placing an order.
- Rules for allowed payment and shipping methods by company and website.
- Company billing and shipping addresses with channel-specific defaults.
- A customer purchase order number (PO) and order comment.
- Store the company, buyer, credit, approval and export statuses in the order’s B2B context.
Trade credit limits and payment terms
Track the credit limit, usage and available amount separately for each company, website and currency.
- Payment terms, limit activation or blocking and an option to allow over-limit spending.
- Select payment methods that use company credit; other methods work without a configured limit.
- Atomic reservation before order placement, linked to the saved order.
- Release the reservation after a failure without a created order, full payment, cancellation or closure.
- Manual usage adjustments, exposure details and event history.
- Cron reconciliation after an interrupted process or temporary error.
Partial payment keeps the full reservation in place until full settlement or cancellation.
Order approval and fulfillment control
Define approval rules by company, website, currency and order-value threshold. Priority and threshold determine the applicable rule when several match.
- Assign active company users as approvers.
- Automatically create a pending request for an order that matches a rule.
- Approve, reject or cancel with a comment and audit trail.
- Mark export as blocked and hold the order when its state permits it.
- Approval updates the B2B status and releases the hold; rejection or cancellation leaves export blocked.
The included workflow closes a pending request with one decision. Multistage approval requires an additional extension, and the integration must respect the export-blocking status.
Commercial documents in the customer portal
Provide the appropriate company with invoices, credit memos, delivery notes and order confirmations.
- Automatically create documents from Magento Sales orders, invoices, shipments and credit memos.
- Configure the document source, initial status and generation of individual document types; support a hybrid Magento + API model.
- Manual PDF upload in Admin, metadata, dates, amounts, currencies and links to Magento entities.
- Share original files from an external system without changing their contents.
- Downloads checked against the company, website, permissions and document status.
- Preview customer access, files and synchronization logs in Admin.
Editable PDFs and language versions
A shared PDF generator supports sales documents and RFQ offers.
- Edit HTML/CSS templates in Admin and preview them with sample data.
- Separate templates by document type, website and audience; a local template takes precedence over a global one.
- Custom titles for confirmations, invoices, credit memos, delivery notes and commercial offers.
- Logo, seller and buyer details, tax IDs, addresses, items, totals, and payment and shipping information and instructions in Sales documents.
- A customer RFQ version separated from internal administrator data.
- Translated labels according to the store language; dictionaries include Polish and many other European languages.
Template changes apply to newly generated PDFs. Previously saved files must be regenerated.
Company account and Hyvä Themes adapter
The company portal brings together company details, addresses, contacts, users, documents, credit, shopping lists and RFQ.
- Company addresses and the five most recent orders in the native account dashboard.
- View personal or company-wide orders according to permissions, use protected PDF links and reorder as the authorized original buyer.
- Six visibility switches for native links: addresses, orders, downloads, saved payments, reviews and newsletter.
- An included optional Hyvä Themes adapter with responsive account tables, forms and navigation.
- Enable the adapter per Store View; disabled by default and active only with Hyvä and B2B.
The adapter covers the customer account. Hyvä Checkout, cart and minicart require a separate integration scope. Menu switches control link visibility; permissions are checked independently.
CSV import and export of B2B data
Transfer and update data using profiles assigned to a specific website.
- Companies, user assignments and roles with permissions.
- Price list definitions, contract prices and catalog visibility rules.
- Document metadata, links to existing document files and trade credit limits.
- CSV upload, validation and dry-run mode to check an import before saving.
- Job history, row-level error logs and downloads of error reports and export files.
- Separate import and export of price list items in Pricing.
User-assignment imports use existing Magento accounts; document-file imports reference files already available in an allowed location.
REST API and GraphQL
Expose B2B processes to integrations or custom interfaces through the API.
- REST: website configuration, companies and users, products, MSI availability, prices, catalog, shopping lists, RFQ, documents, limits, approvals, order context, import/export and integrations.
- Batch company operations and an idempotency key for company creation.
- Product reports, including missing translations and inventory data.
- GraphQL queries for company data, prices, lists, offers, documents, credit, approvals and integration jobs.
- GraphQL mutations for shopping lists, RFQ workflows and publishing, processing and retrying integration jobs.
Access depends on permissions and the operation context. REST and GraphQL expose defined contracts; their sets of operations are not identical.
ERP, PIM, WMS and CRM integrations
The package provides infrastructure for connecting Magento to your business systems.
- Profiles by website, system type, exchange direction and adapter.
- Mappings between local and external identifiers.
- Create synchronization jobs with a scheduled time, input data and an idempotency key.
- Processing statuses, results, attempt counts, logs and errors.
- Manually retry the same job and review jobs requiring intervention in the Dead Letter Queue.
Connecting a specific ERP, PIM, WMS, CRM, EDI or procurement system requires an adapter and a running processing workflow. Implementation defines the sources of companies, prices, stock, orders and documents.
Dashboard, reports and diagnostics
The B2B dashboard shows company counts and statuses, active users, price lists, catalog rules, errors and recent changes.
- Reports on companies without an active website, users or a price list, and customers without a company.
- Reports on missing indexed prices, MSI source data and product-name translations.
- Documents without files, import and integration errors, and orders awaiting approval or blocked for export.
- Filter reports by website, preview records and export to CSV.
- System status, company and decision audits, credit and synchronization logs, plus Explain Price and Debug SKU tools.
- Configuration of B2B diagnostics and log retention.
One package, a modular architecture
The kowal/metapackage-b2b-suite package contains 17 Magento modules and the frontend/Kowal/b2b base theme. It includes Base, Access Control, Company, Admin UI, Pricing, Catalog Permissions, Quick Order, Quote, Checkout, Credit Limit, Approval, Document, Import/Export, Integration, REST API, GraphQL and the optional Hyvä adapter.
Install through a single Composer package. Once repository access is granted, deployment includes enabling the required modules, updating the Magento database, configuring websites and companies, and compiling, publishing assets and clearing caches according to the store’s deployment mode.
Requirements and implementation scope
The project targets Magento Open Source 2.4.9 and the package requires PHP ^8.3. It uses Magento’s native catalog, cart, checkout and MSI, plus the mPDF generator.
The classic Magento storefront and an optional Hyvä Themes account adapter are available. The base B2B theme is a starting point for customizing the portal’s appearance.
Implementation scope depends on the store version, theme, payments, shipping and external systems. Compatibility and the complete purchasing workflow must be verified in the target installation.
Plan a B2B implementation tailored to your company
Want to adapt the module to your store? Ask about implementing Kowal B2B Suite and discuss configuration or additional extensions.
Before planning the implementation, read how to reduce manual B2B sales operations in Magento 2 and the real cost of manually processing a B2B order (articles in Polish).
More Information
| Hyvä theme | Hyvä compatible |
|---|---|
| Theme compatibility | Hyvä, Luma / Blank, KOWAL |
Questions and Answers
Can each B2B customer have individual prices and product catalogs?
Can one company have multiple users with different permissions?
Can the B2B system integrate with ERP, PIM, WMS or CRM?
Can a B2B platform be deployed in stages?
Integration Configuration
Kowal B2B API — Complete REST Documentation
Contract version:
V1· Source of truth:Kowal_B2BApi/etc/webapi.xml· Audience: store administrators, implementation partners, and teams integrating ERP, PIM, WMS, or purchasing systems.
1. API purpose and boundaries
Kowal B2B API exposes B2B data and processes operating in Magento 2: companies, catalog and individual prices, quick purchasing, documents, trade credit limit, approvals, RFQ, and integration queues. It is a REST API for system integrations; it does not replace standard Magento endpoints for catalog, cart, checkout, and customer account.
The document describes only the endpoints currently exposed by the module. It does not promise operations not made available by the V1 contract, such as order creation via REST, price list CRUD, or website configuration editing.
2. Obtaining access and collaboration rules
2.1. Integration launch process
- The integrator provides the store administrator with the integration goal, environment (test/production), source system, data scope, and list of required API areas.
- The administrator creates or configures the Magento integration, assigns minimal ACL permissions, and securely provides:
baseUrl, token,websiteId,companyIdwhen applicable, currency, and test data. - The integrator runs the
GET /V1/kowal-b2b/websites/:websiteId/configtest, followed by functional tests in the test environment. - Before production, both parties agree on the synchronization schedule, maximum data size, retry, data owner, and error reporting method.
- Tokens are stored only in a secrets vault; the administrator rotates or revokes them when the vendor, user, or integration scope changes.
2.2. Responsibilities
| Party | Responsibility |
|---|---|
| Store administrator | Configuration of B2B website, company and company relationship with website, token, and ACL; provision of test data; decision on data access. |
| Integrator | Secure token storage, correct use of websiteId/companyId context, data validation, error and retry handling, and not disclosing data of other companies. |
| Business process owner | Agreement on the source of truth for prices, documents, RFQ, limits, and synchronization statuses. |
Do not use an administrator token in a client application or share one token across independent systems. Each integration should have its own token and only the required ACL.
2.3. Permissions
Magento verifies the Bearer token and ACL assigned to the administrative user or integration. B2B endpoints require one of the following permission groups:
| ACL | Scope |
|---|---|
config | Websites and feature flags |
companies, company_save, company_users, batch | Companies, their users, and batch company import |
products, prices, catalog_permissions | Catalog, availability, prices, and visibility |
import_export, quick_order, documents | Import/export profiles, shopping lists, and documents |
credit_limits, approvals, orders, quotes | Limit, approval workflow, order context, and RFQ |
system_integrations | Profiles, mappings, and integration jobs |
The scope should result from the purpose of the integration. Example: a purchasing system usually needs products, prices, catalog_permissions, quick_order, and quotes; an ERP handling documents — documents and, if it owns synchronization, system_integrations.
3. Technical conventions
Address, headers, and parameters
The base address has the form https://b2b.example.com/rest/V1. All paths later in this document are provided from /V1; the full endpoint address is BASE_URL + path.
Authorization: Bearer Accept: application/jsonContent-Type: application/json The API uses JSON. Names in URLs are camelCase (websiteId, companyId), and JSON fields correspond to Magento contract parameter names. :companyId, :quoteId, :sku, etc. are path parameters. In examples, ? indicates an optional parameter.
websiteId is required for sales channel-dependent operations. It must point to an existing website with B2B enabled. companyId points to a company that must have an active relationship with this website when the operation runs in its context. The API does not select a default website or company.
Request body and idempotency
Magento serializes the DTO object under the method parameter name: most write operations accept {'request': {...}}; company creation uses {'company': {...}}; company batch — {'companies': [...]}. Endpoints with simple arguments accept fields without a wrapper, e.g. {'websiteId': 1, 'currency': 'PLN', 'items': [...]}.
The Idempotency-Key header, max. 128 characters, is currently supported by POST /companies: retrying with the same key will return the previously created company. For an integration job, use the request.idempotencyKey field. Do not assume automatic idempotency of other write endpoints; retry them only after determining the operation status.
Responses and errors
Successful responses are Magento contract objects or arrays. Fields returned by objects may be extended in a compatible way; the integration should ignore unknown fields. A business error may contain:
{ 'code': 'b2b.company.not_assigned_to_website', 'message': 'B2B company is not assigned to website.', 'website_id': 1, 'trace_id': 'request-correlation-id', 'details': {'company_id': 10}, 'field_errors': []}| HTTP | Meaning | Integrator response |
|---|---|---|
400 / 422 | Invalid data or domain validation | Correct the data; do not retry without changing the payload. |
401 / 403 | Missing or insufficient token/ACL | Do not retry; report the token scope to the administrator. |
404 | The resource or relationship does not exist in the given context | Verify identifiers and website context. |
409 | Status conflict or duplicate | Read the current state before deciding to retry. |
5xx / timeout | Technical error | Use limited retry with backoff and keep the trace_id. |
Do not log tokens, full personal data, or configuration secrets. A report to the store team should include time, method, path without secrets, HTTP status, trace_id, and anonymized payload.
4. Input data schemas
The schemas below are common to the reference endpoints. A field without ? is required by the contract; ? means an optional value. The metadata, config, configuration, and payload fields are JSON objects.
| DTO / wrapper | Fields |
|---|---|
company | websiteId, name, taxId, externalId?, status?, salesRepresentativeId?, customerGroupId?, websiteActive? |
companyUser | websiteId, roleId, active |
request — RFQ | websiteId, companyId, customerId?, externalId?, title, currency, validUntil?, customerNote?, salesNote?, metadata? |
request — RFQ item | quoteId, sku, productId?, name?, qty, requestedPrice?, offeredPrice?, comment?, metadata? |
request — RFQ decision | customerId?, adminUserId?, message? |
request — RFQ comment | quoteId, customerId?, adminUserId?, authorType, message, visibleForCustomer |
request — document | websiteId, companyId, orderId?, orderIncrementId?, invoiceId?, invoiceIncrementId?, creditmemoId?, creditmemoIncrementId?, externalId?, documentNumber, documentType, status, issueDate?, dueDate?, grandTotal?, currency?, metadata? |
request — document file | documentId, fileName, filePath, mimeType, fileSize, checksum?, primary |
request — limit | websiteId, companyId, termsId?, creditLimit, currency, active, status, metadata? |
request — limit exposure | websiteId, companyId, sourceType, sourceId, sourceIncrementId?, amount, currency, dueDate?, metadata? |
request — payment terms | websiteId, code, name, daysDue, active, description? |
request — approval rule | websiteId, companyId, name, thresholdAmount, currency?, priority, active, metadata? |
request — approver | ruleId, customerId, sortOrder, active |
request — approval decision | approverCustomerId?, comment? |
request — approval request | websiteId, companyId, orderId?, orderIncrementId?, requesterCustomerId?, grandTotal, currency, comment?, metadata? |
request — import/export profile | websiteId, code, name, direction, entityType, format, behavior, active, configuration? |
request — integration profile | websiteId, code, name, systemType, adapterCode, direction, active, maxAttempts, config? |
request — mapping | websiteId, systemType, entityType, localId, externalId, metadata? |
request — integration job | profileId, direction?, entityType, operation, idempotencyKey?, maxAttempts?, payload?, scheduledAt? |
5. Endpoint reference
In the tables, ACL means the minimum Magento permission resource. Result defines the successful response type.
5.1. Websites and configuration
| Method and endpoint | ACL | Input | Result and use |
|---|---|---|---|
GET /V1/kowal-b2b/websites | config | — | Array of websites (websiteId, code, name, B2B flag). Retrieve before integration configuration. |
GET /V1/kowal-b2b/websites/:websiteId/config | config | path: websiteId | B2B website configuration, including enabled/debug/log retention. Run as an access test. |
GET /V1/kowal-b2b/websites/:websiteId/features | config | path: websiteId | Feature flags active for the website; use for conditional client feature enabling. |
5.2. Companies and company users
| Method and endpoint | ACL | Input | Result and use |
|---|---|---|---|
GET /companies?websiteId= | companies | query: websiteId | Array of companies assigned to the website. |
POST /companies | company_save | body: company | Creates a company and relationship with the website; use Idempotency-Key on retries. Returns the company. |
POST /companies/batch | batch | body: companies — array of company | Creates multiple companies and returns a result per item, including errors. |
GET /companies/:companyId?websiteId= | companies | path: companyId; query: websiteId | Company verified in website context. |
PUT /companies/:companyId | company_save | path: companyId; body: company | Updates company data and relationship for company.websiteId. |
POST /companies/:companyId/activate?websiteId= | company_save | path: companyId; query: websiteId | Activates the company in the indicated website and returns it. |
POST /companies/:companyId/block?websiteId= | company_save | path: companyId; query: websiteId | Blocks the company in the indicated website and returns it. |
GET /companies/:companyId/users?websiteId= | company_users | path: companyId; query: websiteId | Array of customer assignments to the company. |
PUT /companies/:companyId/users/:customerId | company_users | path: companyId, customerId; body: companyUser | Grants/updates the customer role and activity in the company; returns the assignment. |
5.3. Products, price, and catalog visibility
| Method and endpoint | ACL | Input | Result and use |
|---|---|---|---|
GET /products?websiteId= | products | query: websiteId | Array of basic Magento products for the website. |
GET /products/:sku?websiteId= | products | path: encoded sku; query: websiteId | Product (id, sku, name, type, status, websites). |
GET /products/:sku/availability?websiteId= | products | path: sku; query: websiteId | MSI availability and salable quantity for SKU. |
GET /products/:sku/b2b-status?websiteId= | products | path: sku; query: websiteId | B2B status: website assignment, translations, and stock data. |
GET /reports/products/missing-translations?websiteId= | products | query: websiteId | Report of SKUs without required translations, with reason/details. |
GET /reports/products/missing-stock?websiteId= | products | query: websiteId | Report of SKUs without required stock data. |
GET /companies/:companyId/products/:sku/price?websiteId=¤cy=&qty= | prices | path: companyId, sku; query: websiteId, currency, optional qty (default 1) | Explanation of the price applicable to the company, currency, and quantity; read before purchase. |
GET /companies/:companyId/products/:sku/visibility?websiteId= | catalog_permissions | path: companyId, sku; query: websiteId | SKU visibility/purchase result for the company. |
GET /companies/:companyId/catalog-visibility?websiteId= | catalog_permissions | path: companyId; query: websiteId | Array of company visible catalog index items. |
POST /companies/:companyId/catalog-visibility/reindex?websiteId= | catalog_permissions | path: companyId; query: websiteId | Rebuilds the index and returns the number of indexed items. Administrative operation. |
5.4. File import and export
| Method and endpoint | ACL | Input | Result and use |
|---|---|---|---|
GET /import-export/profiles?websiteId= | import_export | query: websiteId | Array of website import/export profiles. |
POST /import-export/profiles | import_export | body: request — import/export profile | Saves the profile and returns its data. |
POST /import-export/import/:profileId?sourceFile=&dryRun= | import_export | path: profileId; query: sourceFile, optional dryRun=false | Starts import of a file indicated on the Magento environment side; returns a job. Does not send multipart. |
POST /import-export/export/:profileId?resultFile= | import_export | path: profileId; optional query: resultFile | Creates an export job, optionally with a target file path. |
GET /import-export/jobs?websiteId= | import_export | query: websiteId | Array of import/export jobs for the website. |
GET /import-export/jobs/:jobId | import_export | path: jobId | Status, result, and data of a single job. |
GET /import-export/jobs/:jobId/logs | import_export | path: jobId | Diagnostic logs of the job. |
5.5. Quick order and shopping lists
| Method and endpoint | ACL | Input | Result and use |
|---|---|---|---|
POST /companies/:companyId/quick-order/validate | quick_order | path: companyId; body: websiteId, currency, items (sku, qty) | Validates multiple SKUs in company context: availability, visibility, and price; returns a summary result. |
GET /companies/:companyId/shopping-lists?websiteId= | quick_order | path: companyId; query: websiteId | Array of company shopping lists. |
POST /companies/:companyId/shopping-lists | quick_order | path: companyId; body: websiteId, name, optional customerId, isDefault=false | Creates and returns a shopping list. |
GET /shopping-lists/:listId/items | quick_order | path: listId | Array of items on the indicated list. |
POST /shopping-lists/:listId/items | quick_order | path: listId; body: currency, items (sku, qty) | Adds items to the list and returns the saved items. |
5.6. Documents and files
| Method and endpoint | ACL | Input | Result and use |
|---|---|---|---|
GET /companies/:companyId/documents?websiteId=&documentType= | documents | path: companyId; query: websiteId, optional documentType | Company documents, optionally filtered by type. |
GET /documents/:documentId?companyId=&websiteId= | documents | path: documentId; query: companyId, websiteId | Document details after company ownership verification. |
POST /documents | documents | body: request — document | Creates or saves document metadata and returns the document. |
POST /documents/files | documents | body: request — document file | Registers an existing file in Magento storage (name, path, MIME, size); does not upload binaries. |
GET /documents/:documentId/files?companyId=&websiteId= | documents | path: documentId; query: companyId, websiteId | Array of document file metadata. |
GET /documents/:documentId/sync-logs | documents | path: documentId | Document synchronization logs; intended for administrative integration. |
5.7. Trade credit limit and payment terms
| Method and endpoint | ACL | Input | Result and use |
|---|---|---|---|
GET /companies/:companyId/credit/status?websiteId=¤cy= | credit_limits | path: companyId; query: websiteId, currency | Limit status, utilization, and available company amount. |
POST /credit-limits | credit_limits | body: request — limit | Creates/updates the company limit and returns the limit. |
POST /credit/exposures | credit_limits | body: request — exposure | Reserves limit exposure for a source, such as an order, and returns it. |
POST /credit/exposures/:exposureId/release | credit_limits | path: exposureId; optional body: message | Releases exposure; returns its state. |
GET /payment-terms?websiteId= | credit_limits | query: websiteId | Array of active/known website payment terms. |
POST /payment-terms | credit_limits | body: request — payment terms | Saves payment terms and returns them. |
5.8. Approval workflow
| Method and endpoint | ACL | Input | Result and use |
|---|---|---|---|
GET /companies/:companyId/approval/rules?websiteId=¤cy= | approvals | path: companyId; query: websiteId, optional currency | Company approval rules for the channel/currency. |
POST /approval/rules | approvals | body: request — rule | Creates/updates a threshold rule and returns it. |
GET /approval/rules/:ruleId/approvers | approvals | path: ruleId | Array of assigned approvers, in sortOrder. |
POST /approval/approvers | approvals | body: request — approver | Saves the customer assignment as an approver. |
GET /companies/:companyId/approval/required?websiteId=&grandTotal=¤cy= | approvals | path: companyId; query: websiteId, grandTotal, currency | Boolean: whether the amount requires approval. |
POST /approval/requests | approvals | body: request — approval request | Creates a request for the order and returns it. |
GET /companies/:companyId/approval/requests?websiteId=&status= | approvals | path: companyId; query: websiteId, optional status | Array of company approval requests. |
POST /approval/requests/:requestId/approve | approvals | path: requestId; body: request — decision | Approves the request; returns its current state. |
POST /approval/requests/:requestId/reject | approvals | path: requestId; body: request — decision | Rejects the request; returns its current state. |
POST /approval/requests/:requestId/cancel | approvals | path: requestId; body: request — decision | Cancels the request; returns its current state. |
GET /approval/requests/:requestId/decisions | approvals | path: requestId | Decision history for the request. |
5.9. B2B order context
| Method and endpoint | ACL | Input | Result and use |
|---|---|---|---|
GET /orders/:orderId/b2b-context | orders | path: orderId | B2B context of a single native Magento order, e.g. company, approval status, limit, export. |
GET /companies/:companyId/orders/b2b-context?websiteId=&approvalStatus= | orders | path: companyId; query: websiteId, optional approvalStatus | Array of company order contexts, optionally filtered by approval status. |
5.10. RFQ and commercial offers
| Method and endpoint | ACL | Input | Result and use |
|---|---|---|---|
GET /companies/:companyId/quotes?websiteId=&status= | quotes | path: companyId; query: websiteId, optional status | Company RFQs and quotes, optionally by status. |
POST /quotes | quotes | body: request — RFQ | Creates a draft RFQ and returns it. Add items with a separate endpoint. |
GET /quotes/:quoteId | quotes | path: quoteId | RFQ/quote details. |
GET /quotes/:quoteId/items | quotes | path: quoteId | Array of RFQ items. |
POST /quotes/items | quotes | body: request — RFQ item | Adds SKU and quantity, optional requested/offered price, and comment. |
GET /quotes/:quoteId/comments | quotes | path: quoteId | RFQ comments. The customer sees only comments marked as visible. |
POST /quotes/comments | quotes | body: request — RFQ comment | Adds a message; authorType and visibleForCustomer define the author and visibility. |
GET /quotes/:quoteId/history | quotes | path: quoteId | RFQ status change and event history. |
POST /quotes/:quoteId/submit | quotes | path: quoteId; body: request — RFQ decision | Submits the draft RFQ for pricing. |
POST /quotes/:quoteId/make-offer | quotes | path: quoteId; body: request — RFQ decision | The salesperson creates/submits an offer; define item prices before calling. |
POST /quotes/:quoteId/accept | quotes | path: quoteId; body: request — RFQ decision | Accepts the current offer. This contract does not create a REST order. |
POST /quotes/:quoteId/reject | quotes | path: quoteId; body: request — RFQ decision | Rejects the offer/RFQ. |
POST /quotes/:quoteId/cancel | quotes | path: quoteId; body: request — RFQ decision | Cancels the RFQ if the current status allows it. |
5.11. Integration profiles and jobs
| Method and endpoint | ACL | Input | Result and use |
|---|---|---|---|
GET /integrations/profiles?websiteId=&systemType= | system_integrations | query: websiteId, optional systemType | Integration profiles for the website. |
POST /integrations/profiles | system_integrations | body: request — integration profile | Saves an ERP/PIM/WMS, etc. profile and returns it. |
POST /integrations/mappings | system_integrations | body: request — mapping | Saves a local ID ↔ external ID pair. |
GET /integrations/mappings/local?websiteId=&systemType=&entityType=&localId= | system_integrations | query: all parameters required | Finds a mapping by Magento identifier. |
GET /integrations/mappings/external?websiteId=&systemType=&entityType=&externalId= | system_integrations | query: all parameters required | Finds a mapping by external system identifier. |
POST /integrations/jobs | system_integrations | body: request — job | Publishes a job for execution; idempotencyKey identifies the business operation. |
GET /integrations/jobs?websiteId=&status= | system_integrations | query: websiteId, optional status | Array of integration jobs. |
GET /integrations/jobs/:jobId | system_integrations | path: jobId | Status and details of a single job. |
POST /integrations/jobs/:jobId/process | system_integrations | path: jobId | Processes the job and returns its current state. |
POST /integrations/jobs/:jobId/retry | system_integrations | path: jobId | Retries the job after an error, according to its attempt limit. |
GET /integrations/jobs/:jobId/logs | system_integrations | path: jobId | Job execution logs. |
GET /integrations/jobs/:jobId/errors | system_integrations | path: jobId | Domain/technical job errors. |
6. Example calls
export BASE_URL='https://b2b.example.com/rest/V1'export TOKEN='token-przekazany-przez-administratora'export WEBSITE_ID=1 COMPANY_ID=10 SKU='B2B-SKU-001' CURRENCY='PLN'# Test dostępu i konfiguracji kanałucurl -sS '$BASE_URL/kowal-b2b/websites/$WEBSITE_ID/config' \ -H 'Authorization: Bearer $TOKEN' -H 'Accept: application/json'# Cena kontraktowa firmy dla konkretnej ilościcurl -sS '$BASE_URL/kowal-b2b/companies/$COMPANY_ID/products/$SKU/price?websiteId=$WEBSITE_ID¤cy=$CURRENCY&qty=5' \ -H 'Authorization: Bearer $TOKEN' -H 'Accept: application/json'# Walidacja koszyka po SKUcurl -sS -X POST '$BASE_URL/kowal-b2b/companies/$COMPANY_ID/quick-order/validate' \ -H 'Authorization: Bearer $TOKEN' -H 'Content-Type: application/json' \ --data '{'websiteId':1,'currency':'PLN','items':[{'sku':'B2B-SKU-001','qty':5}]}'# Utworzenie RFQcurl -sS -X POST '$BASE_URL/kowal-b2b/quotes' \ -H 'Authorization: Bearer $TOKEN' -H 'Content-Type: application/json' \ --data '{'request':{'websiteId':1,'companyId':10,'customerId':25,'title':'Dostawa kwartalna','currency':'PLN','externalId':'ERP-RFQ-2026-001'}}'7. Recommended integration scenarios
Purchase by SKU
- Read the website configuration and save the provided
websiteId,companyId, and currency. - Use quick order for batch validation of SKU, quantity, visibility, and availability.
- For accepted items, retrieve the price from
pricewith the correctqty. - Create an RFQ, add items, and send them via
submitif the purchase requires a quote. - Track RFQ status and history; after acceptance, follow the agreed Magento order process because
V1does not expose an order creation endpoint.
Documents and billing
- Retrieve the company document list, optionally filtering by
documentType. - For the selected document, retrieve metadata and the file list; the file path is not automatically a public URL — agree on the binary download method with the store administrator.
- Read the limit status before the purchasing process; only an integration with
credit_limitsACL can manage it.
Asynchronous operations
- Save the integration profile and identifier mappings.
- Publish a job with a business
idempotencyKeyand keep thejobId. - Read the job and logs/errors; call
retryonly after analyzing the error and removing its cause.
8. Pre-production acceptance list
- The token has only the required ACL and is not an administrator token used by the UI.
- The integrator correctly handles
401,403,404,422validation,409conflict, and timeouts. - Each request in the B2B context provides the correct
websiteId, and company data uses the correctcompanyId. - Prices, visibility, and availability are checked before creating the purchasing process.
- Company creation uses
Idempotency-Key; integration jobs have a stableidempotencyKeyin the body. - Logs do not contain tokens or sensitive data, and the support procedure provides
trace_id. - Tests were performed in a test environment on a company that has an active relationship with the B2B website.
9. Compatibility
The contract is versioned by /V1. Extending responses with new fields is compatible; the integrator should tolerate unknown fields. A change that removes a field, field meaning, or endpoint requires a new API version. If there is a discrepancy between the document and the running installation, the active webapi.xml contract of the given module version is binding.
Module Installation Instructions
Kowal B2B Suite Installation and Configuration
This manual is intended for the person who purchased Kowal B2B Suite and needs to launch it in an existing Magento Open Source installation. It guides you through two stages:
- technical installation — performed by a developer or server administrator;
- business configuration — performed in the Magento panel by the store administrator.
Before you begin, create a backup of the Magento database and files. We recommend performing the first launch in a test environment and only then deploying to production.
1. What you receive and what you need
Kowal B2B Suite is delivered as the Composer package kowal/metapackage-b2b-suite. It includes B2B modules and the frontend/Kowal/b2b theme.
Requirements
| Element | Requirement |
|---|---|
| Magento | Magento Open Source 2.4.9 |
| PHP | 8.3 |
| Composer | Composer 2 |
| Server access | SSH and the ability to run bin/magento |
| Magento | working catalog, customers, checkout, Sales, MSI, and cron |
write access to var/ for the PHP process |
From Kowal, you will receive:
- private Composer repository address — referred to below as
REPOSITORY_URL; - user name or access identifier —
USERNAME; - access token —
ACCESS_TOKEN; - allowed package version range.
Do not store the token in the Git repository, tickets, or shell history shared with other people.
2. Technical installation
Run all commands in the root directory of the existing Magento installation, as a user with access to the files and to the bin/magento command.
2.1. Preparation
- Make sure Magento works correctly before the change.
- Save the deployment state and back up the database and the
app/etc,pub/media, andvardirectories. - In production, enable maintenance mode for the update:
bin/magento maintenance:enable2.2. Adding the private repository
Add the Kowal Composer repository and configure the access credentials you received.
You will receive Composer repository access credentials, the customer email address and license token, by email after purchase. They are also available in the customer panel after logging in at kowal.store. Replace TWOJ_EMAIL_KLIENTA with your account email address and TWOJ_TOKEN with the token you received. Run the commands in the Magento root directory.
composer config repositories.kowal composer https://repo.kowal.store
composer config http-basic.repo.kowal.store 'TWOJ_EMAIL_KLIENTA' 'TWOJ_TOKEN'Composer usually stores credentials in the local auth.json; do not add this file to Git.
2.3. Package installation
Install the version provided with the license. For the current package line, an example command is:
composer require kowal/metapackage-b2b-suite:^0.2 --with-all-dependenciesAfter downloading dependencies, update the Magento schema and configuration:
bin/magento setup:upgrade
bin/magento cache:cleanIn production mode, also run:
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f pl_PL en_US
bin/magento cache:flushUse only the locales that are active in the store. If the installation uses a different deployment process, add the above commands to its standard procedure.
2.4. Installation verification
bin/magento module:status | grep Kowal
bin/magento indexer:statusThe admin panel should show the B2B menu and the Stores > Configuration > Kowal > B2B tab. If they are missing, check the setup:upgrade result, cache, and the ACL roles of the administrator user.
2.5. PDF file permissions
PDFs generated by B2B use mPDF and directories under var/, including var/tmp/kowal_b2b_mpdf and var/kowal_b2b_documents. The PHP process must be able to create and write to them. Missing permissions result in document or PDF generation errors.
After completing the production deployment, disable maintenance mode:
bin/magento maintenance:disable3. Configuring the B2B store structure
3.1. Website and store view
The suite operates at the website scope, not globally. You can run B2C and B2B in the same Magento installation, but B2B should operate on a separate website or on a deliberately selected business sales website.
- In Stores > Settings > All Stores, create or select the B2B website, its store, and store view.
- Note the
website_id— it is used by companies, prices, documents, API, and integrations. - In Content > Design > Configuration, assign the
frontend/Kowal/b2btheme only to the B2B store view. - Verify that active currencies, taxes, shipping methods, and payment methods are configured for the same scope.
Do not assign the B2B theme to a B2C store view if you do not want to change its presentation layer. Installing the modules alone does not enable B2B logic for all websites.
3.2. Activating B2B
- Open Stores > Configuration > Kowal > B2B.
- In the scope switcher, select the correct Website.
- In the General section, set Enable B2B to
Yes. - During implementation, you can enable Debug Mode; disable it after testing.
- In the Default Config scope, set the log retention period.
- Save the configuration and clear cache.
After activation, all store views belonging to this website are treated as B2B. A company without an active relationship with this website will not gain access to it.
3.3. Seller data
Complete the selling company data in Stores > Configuration > General > Store Information: name, address, phone, and tax ID. They are used in documents and RFQ PDFs. Also complete the general sender email address in Sales Emails configuration and the email logo if it should appear in PDFs.
4. Configuring the first B2B customer
Use the following order for each company. It helps avoid a situation where the customer has an account but cannot see the offer or proceed through checkout.
4.1. Company, people, and addresses
- Open B2B > Companies and create a company.
- Enter the name, tax ID, external identifier if the company is synchronized with ERP,
Activestatus, and assignment to the B2B website. - Add a company user or assign an existing Magento customer. Assign the correct role and activate the assignment.
- In B2B > Company Addresses, add company addresses; mark the default billing and shipping address for the B2B website.
- In B2B > Company Contacts, add an active primary contact with email and phone.
The billing address and primary contact are also used in RFQ PDFs. Missing data does not block the PDF, but the document will be less complete.
4.2. Company roles
Grant users only the permissions they need. A typical division is:
| Role | Example tasks |
|---|---|
| Company administrator | users, roles, addresses, documents, and company history |
| Buyer | catalog, quick order, cart, RFQ, and orders |
| Approver | decisions in the approval workflow |
| Accounting | documents and billing information |
Test an account of each type, especially permission to place orders and approve them. Do not use one shared account for the entire company.
5. Offer, pricing, and checkout
5.1. Catalog and prices
- Make sure Magento products are assigned to the B2B website, active, and have correct MSI data.
- Configure price lists or contract prices for the company in B2B > Pricing (Price Lists, Price List Assignments, or Contract Prices).
- Configure catalog visibility rules for the company according to the implemented permission model, then verify visibility on the customer account.
- Test on the company account: SKU search, product visibility, and price for quantity
1and for the quantity tier.
The B2B price depends on company, website, currency, and quantity. A product visible in B2C does not have to be available to a B2B customer.
5.2. Shipping and payment
- Enable the required shipping and payment methods in the standard Magento configuration for the B2B store view.
- In B2B > Checkout, add rules for available methods for the company/website if you want to restrict selection.
- Run a cart test using the company default addresses.
If order creation from RFQ is expected to work automatically on the administrator side, the company must have unambiguous default addresses and active payment and shipping methods. Otherwise, the Suite will load the data into native Backend Order Create, where the administrator completes missing elements.
5.3. Limits and approvals
These features are optional, but they should be configured before enabling them for customers.
- In B2B > Credit > Payment Terms, add payment terms.
- In B2B > Credit > Credit Limits, assign a limit, currency, status, and payment term to the company.
- In B2B > Approvals > Rules, create an amount threshold rule for the company and website.
- In B2B > Approvals > Approvers, assign approvers.
- Test the cart below and above the threshold and verify whether the approver decision changes the next step of the process.
6. Documents, PDF, and RFQ
6.1. Magento documents
In Stores > Configuration > Kowal > B2B > Documents, select the document source and decide which documents should be generated automatically: order confirmations, invoices, delivery documents, and credit memos. Also set the target document status.
In B2B > Documents > PDF Templates:
- check the active template for each type and website;
- preview it;
- adjust HTML/CSS only if you have someone familiar with Magento templates and mPDF CSS;
- generate a test invoice or confirmation and verify download from the company account.
6.2. RFQ and quote PDF
- In B2B > Quotes > RFQ, create a test RFQ for an active company and user.
- Add SKUs visible to the company, quantity, and quoted price.
- Set the expiration date, send the quote to the customer, and generate the PDF.
- Check the customer variant: seller/buyer data, items, price, total, and expiration date.
- Check the administrator variant: additionally sales notes, comments, history, and internal item information.
The customer PDF must not contain salesperson notes or internal status history.
7. Quick orders, imports, and integrations
Quick orders
In B2B > Quick Order > Debug SKU, check the SKU,qty list for the company, website, and currency. Then create a shopping list and test its use by the customer on the storefront.
Import and export
In B2B > Import/Export, define a profile only after establishing the data source. Profile configuration is a JSON object and must contain file paths available on the Magento server. First run the import in test mode and analyze the job and logs.
API integrations
Before creating an integration token, define the data scope and synchronization owner. Use a separate Magento integration for each ERP, PIM, WMS, or middleware and grant only the required B2B ACL. The full list of endpoints, tokens, and security rules is available in the API documentation for integrators (request the current integration documentation from Kowal).
8. Acceptance checklist
Before production launch, confirm:
- ☐Kowal modules are active, cron works, and cache and indexes are correct.
- ☐B2B is enabled only for the correct website.
- ☐The B2B theme is assigned only to the B2B store view.
- ☐The test company has Active status, a user, role, contact, and default addresses.
- ☐The test product is active, assigned to the website, visible to the company, and has the correct B2B price.
- ☐The customer can log in, search for SKU, use quick order, and add a product to the cart.
- ☐Checkout shows only permitted shipping and payment methods.
- ☐The limit and approval rule work according to company policy if these features are used.
- ☐The document and RFQ PDF generate and are available only to the correct company.
- ☐RFQ can be sent, accepted, and passed to the order creation process.
- ☐Integrations have separate tokens and restricted ACL if they are used.
9. Most common issues
| Symptom | What to check |
|---|---|
| No B2B menu | setup:upgrade, module status, cache, and administrator ACL. |
| Company or customer does not see B2B | Whether B2B is active for the correct website and whether the company has an active relationship with that website. |
| Product is not visible or has no price | Product assignment to website, SKU activity, MSI data, catalog rules, company price, currency, and quantity. |
| No shipping or payment method | Standard Magento configuration, B2B store view scope, and B2B Checkout rules. |
| PDF is not created | Active PDF template, mPDF package, permissions for var/, seller data, and Magento logs. |
| RFQ does not create an order automatically | Default company addresses, unambiguous payment and shipping; in other cases, use Backend Order Create. |
API returns 403 | The integration token does not have the required ACL; do not use an administrator token in an external application. |
When contacting support, provide the Magento version, package version, reproduction steps, event time, safely anonymized logs, and any trace_id. Do not send tokens or passwords.
10. Package update
- Review the release information provided by Kowal.
- Perform the update first in a test environment.
- Create a backup, run
composer update kowal/metapackage-b2b-suite --with-all-dependencies,bin/magento setup:upgrade, and in production also DI compilation and static asset deployment. - Repeat the acceptance checklist, with special attention to prices, checkout, documents, and integrations.
Do not update the package by manually copying files to app/code; this causes Composer issues and makes future support more difficult.