ai.commercestudio.b2b.terms
Draft, version 2026-10-19. Extends dev.ucp.shopping.checkout (UCP 2026-08-25). Schema: https://b2b.commercestudio.ai/ucp/schemas/terms.json.
Most B2B orders aren't paid at checkout. They're invoiced on account under payment terms such as Net 30, against a credit limit, and quote the buyer's purchase order (PO) number.
UCP already models the terms themselves, in dev.ucp.common.payment.terms. This extension adds what that one doesn't carry: how much credit the account has left, and whether a PO number is required. With those, an agent can tell a buyer before they commit that an order won't go through, and why.
How it fits with standard UCP
| Concern | Carried by |
|---|---|
| The term itself (Net 30, due date, amount) | dev.ucp.common.payment.terms: one term, one deferred schedule for the checkout total, due_at N days after the order |
| Paying by purchase order | The ai.commercestudio.b2b.purchase_order payment handler (see purchase-order-handler) |
| Credit position and PO requirement | This extension: b2b_terms |
An agent can negotiate the terms extension without this one. It still pays on account, but it learns about a credit problem only as an error message.
Response field: b2b_terms
Present on every checkout when the extension is negotiated.
| Field | Meaning |
|---|---|
credit_limit |
The account's credit limit, in minor units |
credit_available |
Credit left: the limit minus orders already on account and not yet paid |
po_number_required |
true if Complete Checkout must carry a PO number |
po_number |
The PO number on this checkout, once submitted |
Rules
- The whole total counts: lines, shipping and tax. Credit, approval and the term's schedule all use the checkout's full
total. - Over the credit available. The checkout carries
insufficient_credit(error,requires_buyer_input) and its status isrequires_escalation. Complete Checkout is refused. The buyer can reduce the order or settle with the seller; the agent can't fix this itself. - Missing PO number. When
po_number_requiredis true, a Complete Checkout withoutcredential.po_numberis refused withmissing(error,recoverable, path$.payment.instruments[0].credential.po_number). - Credit is checked again at Complete Checkout, and before an approved order is placed, because other orders may have used credit in the meantime. Approval can take days. An approved order that no longer fits is cancelled with
insufficient_credit(error,unrecoverable), and nothing is ordered. - One term is offered. Selecting another
payment.selected_term_idkeeps the account's term, with apayment_term_changedwarning.
Messages
| Code | Type | When |
|---|---|---|
insufficient_credit |
error (requires_buyer_input) | The total is over credit_available |
missing |
error (recoverable) | No PO number, and one is required |
payment_term_changed |
warning | The agent selected a term the account doesn't have |
Callisto on BigCommerce
- Terms and credit limit are Callisto company policy (
BIGCOMMERCE_COMPANY_POLICIES; the default is Net 30, a $50,000 limit and PO required). B2B Edition's company credit is a per-order cap, not a running balance, so it can't give "credit available". - Credit available is the limit minus the company's orders in BigCommerce status Awaiting Payment.
- Orders on account are placed with status 7 (Awaiting Payment) and payment method "Purchase Order", and the PO number is set on B2B Edition's copy of the order.
- Verified on Wildleaf with order #111:
- Bushwood Country Club, Net 30, PO
BCC-PO-2026-117. - Credit available went from $33,550.64 to $25,681.29.
- Bushwood Country Club, Net 30, PO