Use cases
B2B procurement and supplies: the typical path through the API
Scenario
This is repetitive replenishment under contract: the buyer executes a purchasing policy that already exists, with an agreed price, several delivery addresses and payment on terms. The channel's value lies in reducing the cost of each transaction.
The volume already exists in the relationship between the supplier and whoever buys from it. The integration digitizes the replenishment order that today is placed by phone and spreadsheet, without depending on winning new customers.
The buyer is usually a team, not a person. The channel has to serve the negotiation, not just display a storefront: contract, credit, quote and lead time are part of the same order.
The pains that lead to this integration
The customer gives up at checkout because there is no invoice on terms
How it shows up
"The customer puts everything in the cart and gives up at checkout because there is no invoice on terms."
Why it happens
B2B payment is a financial service: invoiced terms, a credit limit used as payment, barter and splitting the amount between sellers. A checkout designed for credit cards cannot hold that.
Each customer's negotiated price does not fit in the portal
How it shows up
"Every customer has their own price, and nobody can get that onto the site."
Why it happens
A B2B transaction moves five variables at once (price, delivery, payment, quantity and composition), and ecommerce platforms treat them as static form fields.
The portal shows inventory and prices that differ from the ERP
How it shows up
"The portal shows inventory that no longer exists."
Why it happens
The ERP works in processing windows, and the truth of the system of record does not reach the sales channel at the pace the customer buys.
What is usually integrated
| Entity | Direction | Typical frequency | Endpoints and events |
|---|---|---|---|
| Buying customers and delivery addresses | Both directions | Initial load and on every registration change |
|
| Price contracts The contract fixes the item price, regardless of the stock price, and can cover all customers or a subset by document, group or customer type. | Your system to CWS Platform | Per contract term | |
| Credit limit The limit is a customer current account, with balance and statement. The payment-on-terms type is linked to a credit limit. | Your system to CWS Platform | On every financial event that changes the limit | |
| Inventory and price | Your system to CWS Platform | Continuous, in small batches | |
| Replenishment carts Creation returns the cart link. Editing adds quantities to the items or replaces the whole list, without generating another link. | Your system to CWS Platform | On every replenishment cycle |
|
| Quotes | Both directions | On every buyer request | |
| Lead time for items on request Sending the lead times is what releases the order for payment. | Your system to CWS Platform | On every order with an item on request | |
| Orders | CWS Platform to your system | Per event (webhook) or by periodic polling |
|
| Status, invoice and item tracking Item tracking reports, item by item, what has shipped, what is being prepared and what is pending. It is what the buyer sees while the order is being fulfilled. | Your system to CWS Platform | On every order stage change | |
| Buyers and buying portfolios Each buyer has their own login and only buys for the customers in their portfolio. The invoice is issued to the customer's tax ID, and the order records who bought. It depends on activation and is configured in the panel, with no route in the public collection. | Configured in the panel | When the purchasing team changes | |
Typical flow
- 1
Authenticate
The integrator gets the access token with the store's integration user and sends it as Bearer on every other call. The token lasts 12 hours; when it expires the response is 401 and you simply authenticate again.
- POST Get Access Token
- 2
Load customers and addresses
The supplier's system creates the buying customers and each one's delivery addresses. The customer document is the key in the calls that follow.
- 3
Publish the agreed price
The contract is sent with the customers and the products it covers. For whoever is linked, the contract price applies; outside its conditions the store's standard price applies.
- 4
Report the credit limit
The supplier's system reports each customer's limit. An order with enough balance is approved automatically.
- 5
Keep inventory and price current
Inventory and the standard price are sent in batches of 1 to 50 items, and the response carries each item's result.
- 6
Build the replenishment cart
When replenishment is predictable, the supplier's system builds the customer's cart and receives the link. The buyer opens the link and completes the purchase with the items already in place, instead of searching again.
- POST Create Custom Cart
- PUT Edit Custom Cart
- 7
Receive the order and track item by item
The platform notifies the order by webhook. The supplier's system fetches the detail, reports the status and the invoice, and reports each item's situation while the order is being fulfilled.
Variations
Purchasing center with several buyers
Depends on activation
Each person in the purchasing center has their own login and buys for the customers in their portfolio, without sharing the company password. The invoice is issued to the customer's tax ID, and the order records who bought. It is configuration, with no route in the public collection.
Quote before the order
The buyer requests a quote, the supplier's system lists the pending requests and answers with price and lead time. When the quote becomes an order, the integration traces which quote it came from.
Item with lead time on request
An item can be sold without physical stock, with preparation time on request. The supplier's system lists the order items waiting for a lead time and reports each one's; that submission is what releases the order for payment.
Delivery to more than one address
Depends on activation
With split delivery, a warehouse's delivery is divided into several, each with its own products, address, date and shipping. Each fraction becomes an order with its own status, and arrives that way in the orders webhook.
- GET Get Order Details - Store
- Webhook Orders webhook
Several suppliers in the same portal
When the procurement portal brings several suppliers together, the buyer's order splits into one order per supplier. Each supplier integrates what is its own, and the store of origin queries the whole.
Order above the credit limit
When the customer has no balance, the store decides by configuration whether they can close the order and leave it pending approval. An order that exceeds the limit is created with its own initial status, generated by the platform.
Range of possibilities
This is a common path, not the only one.
CWS Platform reaches the same goal through configuration, through the API or through a combination of the two, and the best approach depends on your operation, your ERP and your rules. Talk to a CWS Platform architect to design the integration for your case.
Talk to an architectPlatform modules involved
- B2B Self-Service: the portal where the buyer replenishes alone
- Governed Marketplace: when the portal brings several suppliers together
- Pricing Engine: the price contract
- Checkout & Payments: credit limit and payment on terms
- Inventory Hub: physical and virtual stock and preparation time
- OMS: order status and tracking
- Sales Hub: buyers and buying portfolios
Generated from the public API collection, published on 2026-09-04: api-docs.cws.digital.