b2c-hooks

Implement and coordinate OCAPI/SCAPI and system hooks in B2C Commerce.

51|16|Updated Oct 31, 2025
One-click install
npx skills add https://github.com/SalesforceCommerceCloud/b2c-developer-tooling --skill b2c-hooks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: b2c-hooks
Source: https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/tree/main/skills/b2c/skills/b2c-hooks
Command: npx skills add https://github.com/SalesforceCommerceCloud/b2c-developer-tooling --skill b2c-hooks

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill helps teams implement and manage B2C Hooks across OCAPI/SCAPI, system hooks, and custom extension points, reducing integration friction and ensuring consistent behavior.

Core Features & Use Cases

  • Hook registration and discovery via hooks.json
  • Hook implementations under scripts/ using standard patterns (dw/system/Status, HookMgr)
  • Reference material in references/ for OCAPI/SCAPI and System Hooks documentation to guide developers across use cases like basket calculation, order processing, and custom extensions

Quick Start

Begin by defining hooks in hooks.json, implement the corresponding hook in scripts/, and consult references/ for API contracts and examples

Frequently Asked Questions about b2c-hooks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I register and manage B2C Commerce hooks across OCAPI and SCAPI?

B2C Commerce hooks are registered and managed by defining extension points in hooks.json and implementing the corresponding scripts using standard HookMgr patterns. This ensures consistent coordination across OCAPI, SCAPI, and system hooks.

What is the best way to safely pass data between custom extension points in SFCC?

To safely pass data between custom extension points in SFCC, use the request.custom mechanism. This ensures data persists securely across HookMgr interactions without causing integration friction.

How does HookMgr coordinate system hooks for basket calculation and order processing?

HookMgr coordinates system hooks for basket calculation and order processing by enforcing built-in Status patterns and relying on the SFCC environment. Developers implement these hooks under the scripts/ directory.

Do I need a specific environment to implement custom extension points in B2C Commerce?

Yes, implementing custom extension points in B2C Commerce requires an SFCC environment. The skill enforces reliance on the SFCC environment and uses built-in HookMgr and Status patterns for safe hook behavior.

Why should I use built-in Status patterns when implementing OCAPI hooks?

Built-in Status patterns should be used when implementing OCAPI hooks to ensure consistent behavior and safe hook execution. They provide standardized error handling and coordination across HookMgr interactions within the SFCC environment.

What are the limitations of using request.custom for data passing in B2C hooks?

When using request.custom for data passing in B2C hooks, data is scoped to the individual request lifecycle. It does not persist across separate transactions, requiring careful coordination of HookMgr interactions for complex workflows.