Documentation
Feedback
Guides
API Reference

Guides
Guides
B2B
B2B Buyer Portal

Buying Policies

With Buying Policies, buyer organizations can configure dynamic rules and custom expressions for flexible order authorization processes in B2B organizations.

The Buying Policies feature is only available for B2B Buyer Portal. Authorization from the Commerce Engineer of the account is required for usage.

The Buying Policies system supports dynamic rules that buyer organizations can configure to suit their specific order authorization processes. It provides a mechanism for users to register custom rule expressions, offering greater flexibility and extensibility.

The approval process is hierarchical and uses a priority-based evaluation system.

Organization unit evaluation (dimension priority)

The following are the main characteristics of organization unit evaluation:

  • Each organization unit has one dimension, a container that groups its buying policies.
  • Dimensions are checked in ascending priority order (lower numbers first).
  • To enforce policies from lowest to highest hierarchy levels, assign descending priorities by hierarchy:
    • Top-level unit = 9999 (evaluated last)
    • Child units = 9998 (evaluated second)
    • Grandchild units = 9997 (evaluated first)
  • Sibling units share the same priority.

Policy type evaluation (rule priority)

Within each organization unit's dimension, rules are evaluated in ascending priority order with fixed behaviors according to the value assigned:

  • Priority 1 = bypass (effectType: 0) - checked first, approves and stops evaluation.
  • Priority 2 = deny (effectType: 1) - checked second, denies and stops evaluation.
  • Priority 3 = sequential workflow (effectType: 2) - checked last, requires approval.

If you wish to enable bypass, the dimension must have requireAllRulesAcceptance: false so the first matching rule executes and stops further evaluation.

Authorization dynamics and score fields

The following sections explain the flow of rule evaluation and the score system.

Rule evaluation flow

When an order is submitted, authorization rules are evaluated in two stages.

Stage 1: Rule triggering

  • Rules are evaluated in priority order (bypass → deny → sequential workflow).
  • The rule's expression is evaluated against the order data.
  • If the expression is true, the rule is triggered and executes immediately, stopping further evaluation.
  • The effectType determines what happens:
    • 0 (bypass) → Automatic approval, order proceeds.
    • 1 (deny) → Automatic denial, order is blocked.
    • 2 (sequential workflow) → Pending, requires manual authorization.
  • If no rules trigger, the system moves to the next org unit's dimension (if any).

Stage 2: Manual authorization for pending rules

Rules with effectType: 2 require manual approval/denial via the Accept or deny rule endpoint.

Score system

The scoreInterval object defines decision thresholds:


_10
{
_10
"scoreInterval": {
_10
"accept": 10,
_10
"deny": 5
_10
}
_10
}

When calling the approval and denial endpoints, you provide a score value that determines the outcome:

Score ValueConditionOutcome
score ≥ scoreInterval.acceptscore ≥ 10Accepted
score ≤ scoreInterval.denyscore ≤ 5Denied
Between thresholds5 < score < 10Bypassed

The score is not the result of the rule's expression. It's a separate value you send when manually authorizing or denying a pending rule.

Example: With accept: 10 and deny: 5:

  • Sending score: 100 → Rule accepted.
  • Sending score: 0 → Rule denied.
  • Sending score: 8 → Rule bypassed (authorization continues to the next rule or dimension).

Permissions

Any user or API key must have at least one of the appropriate License Manager resources to be able to successfully use the Buying Policies API, otherwise they will receive a 403 error.

Each endpoint will require a different resource, which will be one of the following:

ProductCategoryResource
Manage Buying PoliciesOMSManageBuyingPolicies
View Buying PoliciesOMSViewBuyingPolicies
Approve OrdersMy Account / OMSApproveOrders
Contributors
1
Photo of the contributor
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
1
Photo of the contributor
Was this helpful?
Suggest edits (GitHub)
On this page