Cart
Shopping cart management (Redis-backed)
Get cart contents
Authorization
ApiKeyAuth API key is automatically provided for demo requests in the playground
In: header
Header Parameters
Cart ID for guest users (from previous cart operation or cookie)
Session token for logged-in users (from auth cookie)
Response Body
application/json
application/json
curl -X GET "https://test.putiikkipalvelu.fi/api/storefront/v1/cart" \ -H "x-cart-id: 550e8400-e29b-41d4-a716-446655440000"{
"items": [
{
"product": {
"id": "clx123abc",
"name": "Gold Ring",
"slug": "gold-ring",
"description": "string",
"price": 15000,
"images": [
"http://example.com"
],
"quantity": 0,
"salePrice": 12000,
"salePercent": "20",
"saleStartDate": "2019-08-24T14:15:22Z",
"saleEndDate": "2019-08-24T14:15:22Z",
"variations": [
{
"id": "clx456def",
"price": 15000,
"salePrice": 12000,
"salePercent": "20",
"saleStartDate": "2019-08-24T14:15:22Z",
"saleEndDate": "2019-08-24T14:15:22Z",
"weight": 0.3,
"quantity": 0,
"sku": "string",
"images": [
"http://example.com"
],
"description": "string",
"showOnStore": true,
"options": [
{
"value": "Large",
"optionType": {
"name": "Size"
}
}
]
}
],
"weight": 0.5,
"sku": "string",
"metaTitle": "string",
"metaDescription": "string",
"categories": [
{
"id": "string",
"name": "string",
"slug": "string",
"parentId": "string"
}
]
},
"cartQuantity": 2,
"variation": {
"id": "clx456def",
"price": 15000,
"salePrice": 12000,
"salePercent": "20",
"saleStartDate": "2019-08-24T14:15:22Z",
"saleEndDate": "2019-08-24T14:15:22Z",
"weight": 0.3,
"quantity": 0,
"sku": "string",
"images": [
"http://example.com"
],
"description": "string",
"showOnStore": true,
"options": [
{
"value": "Large",
"optionType": {
"name": "Size"
}
}
]
}
}
],
"cartId": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": "Error message"
}Add item to cart
Authorization
ApiKeyAuth API key is automatically provided for demo requests in the playground
In: header
Header Parameters
Session token for logged-in users
Request Body
application/json
Cart ID for guest users (omit for new cart)
Product ID to add
Variation ID (required if product has variations)
Quantity to add
1 <= valueResponse Body
application/json
application/json
application/json
application/json
curl -X POST "https://test.putiikkipalvelu.fi/api/storefront/v1/cart" \ -H "Content-Type: application/json" \ -d '{ "productId": "clx123abc", "quantity": 1 }'{
"items": [
{
"product": {
"id": "clx123abc",
"name": "Gold Ring",
"slug": "gold-ring",
"description": "string",
"price": 15000,
"images": [
"http://example.com"
],
"quantity": 0,
"salePrice": 12000,
"salePercent": "20",
"saleStartDate": "2019-08-24T14:15:22Z",
"saleEndDate": "2019-08-24T14:15:22Z",
"variations": [
{
"id": "clx456def",
"price": 15000,
"salePrice": 12000,
"salePercent": "20",
"saleStartDate": "2019-08-24T14:15:22Z",
"saleEndDate": "2019-08-24T14:15:22Z",
"weight": 0.3,
"quantity": 0,
"sku": "string",
"images": [
"http://example.com"
],
"description": "string",
"showOnStore": true,
"options": [
{
"value": "Large",
"optionType": {
"name": "Size"
}
}
]
}
],
"weight": 0.5,
"sku": "string",
"metaTitle": "string",
"metaDescription": "string",
"categories": [
{
"id": "string",
"name": "string",
"slug": "string",
"parentId": "string"
}
]
},
"cartQuantity": 2,
"variation": {
"id": "clx456def",
"price": 15000,
"salePrice": 12000,
"salePercent": "20",
"saleStartDate": "2019-08-24T14:15:22Z",
"saleEndDate": "2019-08-24T14:15:22Z",
"weight": 0.3,
"quantity": 0,
"sku": "string",
"images": [
"http://example.com"
],
"description": "string",
"showOnStore": true,
"options": [
{
"value": "Large",
"optionType": {
"name": "Size"
}
}
]
}
}
],
"cartId": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": "Error message"
}{
"error": "Error message"
}{
"error": "Error message"
}Update item quantity
Authorization
ApiKeyAuth API key is automatically provided for demo requests in the playground
In: header
Header Parameters
Session token for logged-in users
Request Body
application/json
Cart ID for guest users
Product ID to update
Variation ID (if applicable)
Quantity change: positive to add, negative to subtract
-100 <= value <= 100Response Body
application/json
application/json
application/json
application/json
curl -X PATCH "https://test.putiikkipalvelu.fi/api/storefront/v1/cart" \ -H "Content-Type: application/json" \ -d '{ "productId": "clx123abc", "delta": 1 }'{
"items": [
{
"product": {
"id": "clx123abc",
"name": "Gold Ring",
"slug": "gold-ring",
"description": "string",
"price": 15000,
"images": [
"http://example.com"
],
"quantity": 0,
"salePrice": 12000,
"salePercent": "20",
"saleStartDate": "2019-08-24T14:15:22Z",
"saleEndDate": "2019-08-24T14:15:22Z",
"variations": [
{
"id": "clx456def",
"price": 15000,
"salePrice": 12000,
"salePercent": "20",
"saleStartDate": "2019-08-24T14:15:22Z",
"saleEndDate": "2019-08-24T14:15:22Z",
"weight": 0.3,
"quantity": 0,
"sku": "string",
"images": [
"http://example.com"
],
"description": "string",
"showOnStore": true,
"options": [
{
"value": "Large",
"optionType": {
"name": "Size"
}
}
]
}
],
"weight": 0.5,
"sku": "string",
"metaTitle": "string",
"metaDescription": "string",
"categories": [
{
"id": "string",
"name": "string",
"slug": "string",
"parentId": "string"
}
]
},
"cartQuantity": 2,
"variation": {
"id": "clx456def",
"price": 15000,
"salePrice": 12000,
"salePercent": "20",
"saleStartDate": "2019-08-24T14:15:22Z",
"saleEndDate": "2019-08-24T14:15:22Z",
"weight": 0.3,
"quantity": 0,
"sku": "string",
"images": [
"http://example.com"
],
"description": "string",
"showOnStore": true,
"options": [
{
"value": "Large",
"optionType": {
"name": "Size"
}
}
]
}
}
],
"cartId": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": "Error message"
}{
"error": "Error message"
}{
"error": "Error message"
}Remove item from cart
Authorization
ApiKeyAuth API key is automatically provided for demo requests in the playground
In: header
Header Parameters
Session token for logged-in users
Request Body
application/json
Cart ID for guest users
Product ID to remove
Variation ID (if applicable)
Response Body
application/json
application/json
curl -X DELETE "https://test.putiikkipalvelu.fi/api/storefront/v1/cart" \ -H "Content-Type: application/json" \ -d '{ "productId": "clx123abc" }'{
"items": [
{
"product": {
"id": "clx123abc",
"name": "Gold Ring",
"slug": "gold-ring",
"description": "string",
"price": 15000,
"images": [
"http://example.com"
],
"quantity": 0,
"salePrice": 12000,
"salePercent": "20",
"saleStartDate": "2019-08-24T14:15:22Z",
"saleEndDate": "2019-08-24T14:15:22Z",
"variations": [
{
"id": "clx456def",
"price": 15000,
"salePrice": 12000,
"salePercent": "20",
"saleStartDate": "2019-08-24T14:15:22Z",
"saleEndDate": "2019-08-24T14:15:22Z",
"weight": 0.3,
"quantity": 0,
"sku": "string",
"images": [
"http://example.com"
],
"description": "string",
"showOnStore": true,
"options": [
{
"value": "Large",
"optionType": {
"name": "Size"
}
}
]
}
],
"weight": 0.5,
"sku": "string",
"metaTitle": "string",
"metaDescription": "string",
"categories": [
{
"id": "string",
"name": "string",
"slug": "string",
"parentId": "string"
}
]
},
"cartQuantity": 2,
"variation": {
"id": "clx456def",
"price": 15000,
"salePrice": 12000,
"salePercent": "20",
"saleStartDate": "2019-08-24T14:15:22Z",
"saleEndDate": "2019-08-24T14:15:22Z",
"weight": 0.3,
"quantity": 0,
"sku": "string",
"images": [
"http://example.com"
],
"description": "string",
"showOnStore": true,
"options": [
{
"value": "Large",
"optionType": {
"name": "Size"
}
}
]
}
}
],
"cartId": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": "Error message"
}Validate cart before checkout
Authorization
ApiKeyAuth API key is automatically provided for demo requests in the playground
In: header
Header Parameters
Cart ID for guest users
Session token for logged-in users
Whether the cart qualifies for a campaign discount.
SDK calculates this using calculateCartWithCampaigns().
If "true" and a discount code is applied, the discount code will be removed.
"true" | "false"Response Body
application/json
application/json
curl -X GET "https://test.putiikkipalvelu.fi/api/storefront/v1/cart/validate" \ -H "x-cart-id: 550e8400-e29b-41d4-a716-446655440000" \ -H "x-campaigns-apply: false"{
"items": [
{
"product": {
"id": "clx123abc",
"name": "Gold Ring",
"slug": "gold-ring",
"price": 15000,
"images": [
"https://example.com/ring.jpg"
],
"quantity": 10
},
"cartQuantity": 2,
"variation": null
}
],
"hasChanges": true,
"changes": {
"removedItems": 0,
"quantityAdjusted": 1,
"priceChanged": 0,
"discountCouponRemoved": false
}
}{
"error": "Error message"
}