Create a session object with basket information
create_session
Params
A unique reference string for this session. Can be anything.
Response
Whether or not the session operation was successful.
A failure message in the event of failure.
items
Basket Item Array
required
An array of session basket items
The SKU of the basket item
An optional quantity of this item in the basket
import * as sdk from "k42-sdk"
const session = sdk.createSession("unique-session-ref");
if (!session.success) {
console.log(`Failed to create session - ${session.message}`)
return;
}
console.log(`Session created: ${session.id}`);