Who this is for. Solution architects and leads scoping a store for business customers, and the developers who build it. After this page you can name the parts each common B2B requirement is built from, ask the questions that settle its scope, and put the work in the estimate from the start.
Plan these into the build
Business customers ask for the same handful of features from one project to the next. Each is built on the project from parts the platform has: order metadata fields, custom entities, person groups, discounts, quotes, invoices and jobs. Raise each one in discovery, and put its build in the estimate before work starts.
| Requirement | Built from |
|---|---|
| Purchase-order numbers | An order metadata field |
| Credit limits and paying on account | A custom entity for the account, invoices and a job |
| Company accounts and hierarchies | A custom entity for the company, person groups for roles, and the address's company name for print |
| Contract and per-customer prices | A price agreed on a quote, or a group discount |
| Quote notifications and reminders | Jobs on the quote's events and on a schedule |
The questions that settle the scope:
- Do buyers enter a purchase-order number, and where must it appear: on the order, the invoice, or both?
- Does any customer pay on account? With what limits and terms, and who records the payments?
- Does a company have several buyers, approvers or branches, and who may see whose orders?
- Are prices agreed per customer, per group of customers, or per order?
- Who needs to hear about a quote, and when?
Purchase-order numbers
Collect the buyer's purchase-order number at checkout in an order metadata field of the text type (Donations, metadata and gift options). The value is written on the checkout and kept with the order. When every order needs one, mark the input required on the page and check it before the purchase call. To show the number as a column in the admin's list of orders, add the field to Metadata Fields in the Orders settings (Orders.orders.metadataFieldListing).
An invoice has a purchase-order number field of its own (purchaseOrderNumber). Where the invoice must carry the number in that field, copy the order's value into it.
Credit limits and paying on account
Paying on account is billing by invoice instead of taking a payment at checkout. Build it from three parts:
- An account record. A custom entity for the customer's account holds its credit limit, its payment terms and the balance owed (Defining a custom entity).
- Invoices instead of a payment step. An account customer agrees an order with your team, for example as a quote, and is billed by an invoice raised through the API and kept open until they pay, with their purchase-order number on it. An open invoice moves on to paid (Invoice status).
- A job that keeps the balance. A job on the invoice's events, Create record when it is raised and Update record when it is paid, updates the account record's balance, and whatever raises an invoice checks the credit limit first (Entity events).
Company accounts and hierarchies
Model a company as a custom entity record: its name, its account terms, and the members who buy and approve for it, picked in a records layout area. A relationship links custom entity records to each other, and people are picked in a record or records layout area (Relationships between records). Branches or divisions are child records of the company, records of one type nesting among themselves (Parent and child records).
Roles are person groups, such as a buyers group and an approvers group, which the approval screens and jobs check and which a discount's person-group condition can price. On orders, invoices and deliveries, the company's name is the company name on the address (companyName).
Contract and per-customer prices
A price agreed with one customer for one order is set on a quote: staff enter the agreed unit prices, and the customer orders at them until the expiry date (The life of a quote). Standing prices for a customer, or for a group of customers, are a group discount: put the customer's people in a group and give the group a discount, a percentage or a fixed amount off, on every product or on chosen ones (Prices for a group of customers). Several ranges at different terms are several discounts, each with an action for its products.
Quote notifications and reminders
Emails about a quote are jobs on its Create record and Update record events (Telling people about a quote). A reminder before a quote expires is a scheduled job that looks up the quotes whose expiry date is near and emails their members (Event job or scheduled job). An approval chain with steps of its own is a custom entity for the request with a job on its events (Approval before ordering).