Commerce Studio · B2B extensions for UCP

ai.commercestudio.b2b.approval

Draft, version 2026-10-19. Extends dev.ucp.shopping.checkout (UCP 2026-08-25). Schema: https://b2b.commercestudio.ai/ucp/schemas/approval.json.

In a company, the person who asks for an order isn't always allowed to place it. A junior buyer's orders, or orders over a limit, wait for a manager to approve them. That person may approve in their own agent, on a web page, or in the commerce platform's buyer portal.

This extension lets a checkout wait for that decision without leaving UCP's checkout model. The agent then knows the order is waiting, who must approve it, until when, and where they can review it.

Principles

When approval is needed

The business evaluates its rules at Create Checkout, and again at Complete Checkout. Before completion, a checkout that will need approval carries an approval_required info message, so the agent can tell the buyer before they commit.

Rule Applies when
Purchase permission The buyer can't purchase (b2b_account.buyer.can_purchase: false, e.g. a junior buyer), at any amount
Amount rules The total is strictly greater than a company rule's threshold, e.g. "orders over $5,000 need a purchasing manager"
Spend limit The total is over the buyer's own spend_limit (account extension)
Agent guardrails The order trips one of the company's limits on AI agents: per-agent order limit, monthly cap on agent orders, or an unusually large quantity. See below

Action: ai.commercestudio.b2b.approval

While an approval is pending, actions["ai.commercestudio.b2b.approval"] holds one entry. Its id is the approval id. Its config is:

Field Meaning
state pending (the Action is only present while pending)
rule { id, description }: why approval is needed, e.g. purchase_permission, order_over_5000, spend_limit, agent_guardrail
approver_role The role that approves
approver_roles All roles that may decide, when more than one can, e.g. ["admin", "senior_buyer"]
expires_at RFC 3339. After this the request expires and the checkout is cancelled
review_url A page where a person in an approver role signs in, reviews the order and decides. The agent may share it; it never needs to open it
reference What people call the request, e.g. a shopping list number in the platform

The checkout's own expires_at is extended to cover the approval window, so a platform polling Get Checkout doesn't give up early.

Lifecycle

ready_for_complete ──Complete Checkout──▶ complete_in_progress ──approved──▶ completed (order)
                                             │
                                             ├─ rejected ──────────▶ canceled
                                             └─ expired ───────────▶ canceled

Messages

Code Type When
approval_required info Before Complete Checkout: this order will need approval, and why
agent_guardrail info The order trips an agent guardrail; a person approves it after Complete Checkout
submitted_for_approval info Complete Checkout submitted it: an authoritative confirmation ("Submitted for approval. Not ordered yet…") for the agent to show the buyer
approval_pending info Still waiting: who approves, where, and until when
approved_placing info Approved; the order is being placed
order_placed info Placed: the authoritative confirmation with the order number
approval_rejected, approval_expired error (unrecoverable) The checkout was cancelled
not_ordered info The authoritative confirmation that nothing was ordered, with the reason

Agent guardrails

A company can limit what AI agents order without a person looking:

A trip shows as agent_guardrail on the cart and checkout, and becomes the approval rule (or part of it) at Complete Checkout. Unlike other rules, a guardrail always needs someone other than the requester, even if the requester holds an approver role. That's because it guards the agent, not the person.

Deciding (Commerce Studio operations, not UCP)

An approver is someone who holds one of approver_roles, can purchase, and isn't the requester. They can decide in any of these ways:

Every request, decision and placed order is recorded in the company's audit trail. Approvers see it through agent_activity.

Callisto on BigCommerce B2B Edition