B2B Quotes, Purchase Orders & Net Terms
Wholesale accounts, quotes, purchase orders, credit limits and net-term invoices.
Endpoints
| Method | Endpoint | Description | Authentication Required |
|---|---|---|---|
| POST | /api/v1/b2b/account |
Apply for or update a B2B account | Yes |
| POST | /api/v1/b2b/quotes |
Request a B2B quote | Yes |
| PUT | /api/v1/seller/b2b/quotes/{id} |
Seller: price and send/reject a quote | Yes (Seller) |
| POST | /api/v1/b2b/quotes/{id}/accept |
Accept a quote and create a purchase order | Yes |
Endpoint Details
1. Accounts
POST
/api/v1/b2b/account
{
"companyName": "Acme Wholesale",
"taxId": "TAX-123",
"contactName": "Alice",
"phone": "+123456789"
}
- New accounts start
PENDING. - Re-submitting updates company/contact details without changing approval state.
GET /api/v1/b2b/accountreturns credit limit, terms and status.
Admin approval:
2. Quotes
POST
/api/v1/b2b/quotes
{
"items": [
{ "productId": "product-a", "quantity": 10 },
{ "productId": "product-b", "quantity": 5 }
],
"notes": "Please quote wholesale pricing",
"validDays": 14
}
- Requires an
APPROVEDB2B account. - All items must belong to one seller/shop.
- Initial prices use the product price/discount price.
Seller response:
PUT
/api/v1/seller/b2b/quotes/{id}
{
"status": "SENT",
"items": [
{ "productId": "product-a", "quantity": 10, "unitPrice": 8.50 },
{ "productId": "product-b", "quantity": 5, "unitPrice": 12.00 }
],
"validUntil": "2026-06-15T00:00:00"
}
status may be SENT or REJECTED. Only the quote's seller can respond.
Other endpoints:
GET /api/v1/b2b/quotesGET /api/v1/b2b/quotes/{id}GET /api/v1/seller/b2b/quotes
3. Purchase orders and net terms
POST
/api/v1/b2b/quotes/{id}/accept
- Available credit =
creditLimit - open purchase orders. - Creates an
OPENpurchase order with a unique PO number. - Sets
dueDate = now + paymentTermsDays. - Marks the quote
ACCEPTED.
Buyer:
GET /api/v1/b2b/purchase-ordersGET /api/v1/b2b/purchase-orders/{id}
Seller:
GET /api/v1/seller/b2b/purchase-ordersPOST /api/v1/seller/b2b/purchase-orders/{id}/fulfill— creates the buyer order, decrements stock, links the PO to the order and setsFULFILLED
Admin:
GET /api/v1/admin/b2b/accounts?status=APPROVEDPUT /api/v1/admin/b2b/accounts/{userId}GET /api/v1/admin/b2b/purchase-orders
PO statuses: OPEN → FULFILLED; CANCELED is reserved for future cancellation flows.
The PO response includes the generated orderId after fulfillment.
Invoices and dunning
Fulfilling a PO creates a net-terms invoice (PENDING) with a unique invoice number and the PO
due date.
Buyer / seller / admin:
GET /api/v1/b2b/invoicesGET /api/v1/seller/b2b/invoicesGET /api/v1/admin/b2b/invoices
Admin actions:
POST /api/v1/admin/b2b/invoices/run-dunning— marks due invoicesOVERDUE, increments the reminder count and schedules the next reminder in 7 days. Returns{ "reminded": N }.POST /api/v1/admin/b2b/invoices/{id}/pay?providerReference=wire-123— records settlement, marks the invoicePAID, and marks the linked order paymentCOMPLETED(andPAIDwhile it is stillPENDING/CONFIRMED).
Invoice statuses: PENDING → OVERDUE → PAID; VOID is reserved for cancellation/credit-note
flows.
Limits
- Quote items must be positive quantities.
- Unit prices must be positive.
- Credit limit cannot be negative; terms must be positive.
- The platform tracks net-terms invoices and reminders but does not auto-charge bank transfers; settlement remains an accounting/ERP integration.
Other operations:
POST /api/v1/admin/b2b/invoices/{id}/void— Admin: void an unpaid B2B invoicePOST /api/v1/seller/b2b/purchase-orders/{id}/cancel— Seller: cancel an open purchase order