Putiikkipalvelu Docs

Cart

Shopping cart management (Redis-backed)

Get cart contents

GET
/cart

Authorization

ApiKeyAuth
x-api-key<token>

API key is automatically provided for demo requests in the playground

In: header

Header Parameters

x-cart-id?string

Cart ID for guest users (from previous cart operation or cookie)

x-session-id?string

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

POST
/cart

Authorization

ApiKeyAuth
x-api-key<token>

API key is automatically provided for demo requests in the playground

In: header

Header Parameters

x-session-id?string

Session token for logged-in users

Request Body

application/json

cartId?string

Cart ID for guest users (omit for new cart)

productId*string

Product ID to add

variationId?string

Variation ID (required if product has variations)

quantity*integer

Quantity to add

Range1 <= value

Response 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

PATCH
/cart

Authorization

ApiKeyAuth
x-api-key<token>

API key is automatically provided for demo requests in the playground

In: header

Header Parameters

x-session-id?string

Session token for logged-in users

Request Body

application/json

cartId?string

Cart ID for guest users

productId*string

Product ID to update

variationId?string

Variation ID (if applicable)

delta*integer

Quantity change: positive to add, negative to subtract

Range-100 <= value <= 100

Response 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

DELETE
/cart

Authorization

ApiKeyAuth
x-api-key<token>

API key is automatically provided for demo requests in the playground

In: header

Header Parameters

x-session-id?string

Session token for logged-in users

Request Body

application/json

cartId?string

Cart ID for guest users

productId*string

Product ID to remove

variationId?string

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

GET
/cart/validate

Authorization

ApiKeyAuth
x-api-key<token>

API key is automatically provided for demo requests in the playground

In: header

Header Parameters

x-cart-id?string

Cart ID for guest users

x-session-id?string

Session token for logged-in users

x-campaigns-apply?string

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.

Value in"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"
}