Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.k42.com/llms.txt

Use this file to discover all available pages before exploring further.

Set basket items on a customer session.

set_session_basket_items

Params

items
Basket Item Array
required
An array of session basket items

Response

success
boolean
required
Whether or not the session operation was successful.
message
string
A failure message in the event of failure.
id
string
required
The id of the session
total
number
required
The basket total
items
Basket Item Array
required
An array of session basket items
import * as sdk from "k42-sdk"

let session = sdk.createSession("ref");
if (!session.success) {
  return;
}

session = sdk.setSessionBasketItems([
  {
    sku: "abc",
    price: 10
  }
]);
if (!session.success) {
  return;
}

console.log("Session basket updated");