This cartridge implements the UCP specification for Salesforce Commerce Cloud (SFCC), enabling standardized checkout sessions and order management through a REST API.
The UCP integration provides the following capabilities:
- Discovery endpoint (
.well-known/ucp) - Checkout session management
- Discount handling
- Fulfillment options
- Order completion
The implementation consists of:
-
Controller (
cartridges/int_ucp/cartridge/controllers/RedirectURL.js)- Extends the base RedirectURL controller
- Routes UCP requests to the appropriate middleware handlers
- Handles HTTP methods: GET, POST, PUT
-
Middleware (
cartridges/int_ucp/cartridge/scripts/middleware/ucp.js)handleUCPDiscoveryRequest()- Returns UCP capabilities and payment handlershandleCreateCheckoutSessionRequest()- Creates a new checkout sessionhandleModifyBasketRequest()- Updates an existing checkout sessionhandleCompleteOrderRequest()- Completes the checkout and creates an order
-
Helpers (
cartridges/int_ucp/cartridge/scripts/helpers/ucpHelpers.js)- Configuration management
- Capability mapping
-
Custom Objects
UCPCheckoutSession- Stores checkout session dataUCPTokenizer- Stores tokenized payment data- Defined in
metadata/meta/custom.UCPCheckoutSession.ucp.xml - Defined in
metadata/meta/custom.UCPTokenizer.ucp.xml
Returns the UCP discovery document with supported capabilities and payment handlers.
Response: 200 OK
{
"ucp": {
"version": "2026-01-11",
"services": { ... },
"capabilities": [ ... ]
},
"payment": {
"handlers": [ ... ]
}
}Creates a new checkout session.
Request Body:
{
"line_items": [
{
"item": {
"id": "product_id",
"title": "Product Title"
},
"quantity": 1
}
],
"buyer": {
"full_name": "John Doe",
"email": "john@example.com"
},
"currency": "USD",
"payment": { ... }
}Response: 201 Created
Updates an existing checkout session (add items, apply discounts, select fulfillment).
Request Body: Similar to POST, with updates
Response: 200 OK
Completes the checkout and creates an order.
Request Body:
{
"payment_data": {
"handler_id": "mock_payment_handler",
"credential": {
"type": "token",
"token": "success_token"
}
},
"risk_signals": {
"ip": "127.0.0.1",
"browser": "user-agent"
}
}Response: 200 OK with order details
- Automatic line item ID generation
- Product title and price lookup
- Quantity management
- Per-item and total calculations
- Discount code support
- Automatic discount calculation (e.g., "10OFF" = 10% off)
- Discount allocations
- Shipping destination management
- Shipping method selection
- Dynamic shipping options based on destination
- Free and express shipping options
- Order ID generation
- Permalink creation
- Status management
- Credit Card (CREDIT_CARD)
Shipping destinations are taken from the store's addresses.
- Upload the cartridge to your SFCC instance
- Add
int_ucpto your cartridge path - Import the site preference metadata:
metadata/meta/system.SitePreferences.ucp.xml - Import the custom object metadata:
metadata/meta/custom.UCPCheckoutSession.ucp.xml - Import the custom type metadata:
metadata/meta/custom.UCPTokenizer.ucp.xml - Upload the code
For issues or questions, refer to the UCP specification at https://ucp.dev/ or contact us at ucp@forkpoint.com