add_to_cart
Add the current session configuration to the cart. Calls the add-to-cart endpoint which translates the session's selections into the format required by the external cart service.
On success, returns a clientKey (anonymous cart identifier) and a cartLink (shareable URL to view the cart). These are also persisted on the session and will appear in all subsequent session responses.
If neither clientKey nor userId is provided, a new anonymous cart is created. Repeat calls add the item again (no idempotency).
Files are attached automatically. If the session was linked to a file session (via create_file_session with productConfigSessionId, link_file_session, or create_config_session called with a fileSessionId), the backend resolves the file session from the configuration session — you do NOT need to pass fileSessionId. Only pass fileSessionId to override that durable link with a specific file session.
The cartLink opens the cart on the Smartpress website, where the customer reviews the order and checks out.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sessionId": "<sessionId>"
},
"name": "add_to_cart"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | No | Optional user identifier for authenticated carts | |
| jobName | No | Optional custom job name. Defaults to the product name if not provided. | |
| clientKey | No | Optional anonymous cart identifier. If omitted, uses the session's persisted clientKey or creates a new cart. | |
| sessionId | Yes | Configuration session ID (UUID) | |
| fileSessionId | No | Optional override. Normally omit this — the backend resolves the file session from the durable config<->file link. Only set it to force a specific file session. |