Putiikkipalvelu Docs

Customer

Customer authentication, profile management, orders, and wishlist

Register a new customer

POST
/customer/(auth)/register

Authorization

ApiKeyAuth
x-api-key<token>

API key is automatically provided for demo requests in the playground

In: header

Request Body

application/json

firstName*string
Length1 <= length
lastName*string
Length1 <= length
email*string
Formatemail
password*string

Password (minimum 8 characters)

Length8 <= length

Response Body

application/json

application/json

application/json

curl -X POST "https://test.putiikkipalvelu.fi/api/storefront/v1/customer/(auth)/register" \  -H "Content-Type: application/json" \  -d '{    "firstName": "John",    "lastName": "Doe",    "email": "john@example.com",    "password": "securePassword123"  }'
{
  "success": true,
  "customer": {
    "id": "clx123customer",
    "firstName": "John",
    "lastName": "Doe",
    "email": "john@example.com",
    "createdAt": "2024-01-15T10:00:00.000Z",
    "emailVerified": "2024-01-15T12:00:00.000Z"
  },
  "message": "Account created. Please check your email to verify."
}
{
  "error": "Error message"
}
Empty
{
  "error": "Email already registered in this store"
}

Log in a customer

POST
/customer/(auth)/login

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

Guest cart ID to merge into user's cart after login

Request Body

application/json

email*string
Formatemail
password*string

Response Body

application/json

application/json

application/json

curl -X POST "https://test.putiikkipalvelu.fi/api/storefront/v1/customer/(auth)/login" \  -H "Content-Type: application/json" \  -d '{    "email": "john@example.com",    "password": "securePassword123"  }'
{
  "success": true,
  "customer": {
    "id": "clx123customer",
    "firstName": "John",
    "lastName": "Doe",
    "email": "john@example.com",
    "createdAt": "2024-01-15T10:00:00.000Z",
    "emailVerified": "2024-01-15T12:00:00.000Z"
  },
  "message": "Login successful",
  "sessionId": "abc123def456session...",
  "expiresAt": "2024-01-22T10:00:00.000Z"
}
{
  "error": "Invalid email or password"
}
{
  "error": "Email not verified",
  "requiresVerification": true,
  "customerId": "clx123customer"
}

Log out a customer

POST
/customer/(auth)/logout

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

Customer's session token

Response Body

application/json

application/json

curl -X POST "https://test.putiikkipalvelu.fi/api/storefront/v1/customer/(auth)/logout" \  -H "x-session-id: string"
{
  "success": true,
  "message": "Logout successful",
  "cartId": "550e8400-e29b-41d4-a716-446655440000"
}
{
  "error": "No active session found"
}

Get current customer

GET
/customer/(auth)/get-user

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

Customer's session token

Response Body

application/json

application/json

curl -X GET "https://test.putiikkipalvelu.fi/api/storefront/v1/customer/(auth)/get-user" \  -H "x-session-id: string"
{
  "success": true,
  "customer": {
    "id": "clx123customer",
    "firstName": "John",
    "lastName": "Doe",
    "email": "john@example.com",
    "createdAt": "2024-01-15T10:00:00.000Z",
    "emailVerified": "2024-01-15T12:00:00.000Z"
  }
}
{
  "error": "Unauthorized: Invalid or expired session"
}

Verify customer email

GET
/customer/(auth)/verify-email

Authorization

ApiKeyAuth
x-api-key<token>

API key is automatically provided for demo requests in the playground

In: header

Query Parameters

token*string

Email verification token from registration email

Response Body

application/json

application/json

curl -X GET "https://test.putiikkipalvelu.fi/api/storefront/v1/customer/(auth)/verify-email?token=string"
{
  "success": true,
  "message": "Email verified successfully. You can now log in."
}
{
  "error": "Invalid or expired verification token"
}
Empty

Resend verification email

POST
/customer/(auth)/resend-verification

Authorization

ApiKeyAuth
x-api-key<token>

API key is automatically provided for demo requests in the playground

In: header

Request Body

application/json

customerId*string

Customer ID from failed login response

Formatuuid

Response Body

application/json

application/json

curl -X POST "https://test.putiikkipalvelu.fi/api/storefront/v1/customer/(auth)/resend-verification" \  -H "Content-Type: application/json" \  -d '{    "customerId": "clx123customer"  }'
{
  "success": true,
  "message": "Verification email sent."
}
{
  "error": "Customer not found or already verified"
}
Empty

Request password reset

POST
/customer/(auth)/forgot-password

Authorization

ApiKeyAuth
x-api-key<token>

API key is automatically provided for demo requests in the playground

In: header

Request Body

application/json

email*string

Customer's email address

Formatemail

Response Body

application/json

application/json

application/json

curl -X POST "https://test.putiikkipalvelu.fi/api/storefront/v1/customer/(auth)/forgot-password" \  -H "Content-Type: application/json" \  -d '{    "email": "john@example.com"  }'
{
  "success": true,
  "message": "If an account exists with that email, password reset instructions have been sent."
}
{
  "error": "Validation error",
  "details": {
    "email": {
      "_errors": [
        "Invalid email format"
      ]
    }
  }
}
Empty
{
  "error": "Too many password reset attempts. Please try again later."
}

Reset password with token

POST
/customer/(auth)/reset-password

Authorization

ApiKeyAuth
x-api-key<token>

API key is automatically provided for demo requests in the playground

In: header

Request Body

application/json

token*string

Password reset token from email link

password*string

New password (minimum 8 characters)

Formatpassword
Length8 <= length

Response Body

application/json

application/json

curl -X POST "https://test.putiikkipalvelu.fi/api/storefront/v1/customer/(auth)/reset-password" \  -H "Content-Type: application/json" \  -d '{    "token": "a1b2c3d4e5f6...",    "password": "newSecurePassword123"  }'
{
  "success": true,
  "message": "Password reset successful. You can now log in with your new password."
}
{
  "error": "Invalid or expired reset token"
}
Empty

Update customer profile

PATCH
/customer/edit-user

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

Customer's session token

Request Body

application/json

firstName?string
lastName?string
email?string
Formatemail

Response Body

application/json

application/json

application/json

curl -X PATCH "https://test.putiikkipalvelu.fi/api/storefront/v1/customer/edit-user" \  -H "x-session-id: string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "message": "Customer updated successfully",
  "customer": {
    "id": "string",
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "createdAt": "2019-08-24T14:15:22Z"
  }
}
{
  "error": "Email is already taken by another customer"
}
{
  "error": "Error message"
}

Delete customer account

DELETE
/customer/delete-user

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

Customer's session token

Response Body

application/json

application/json

curl -X DELETE "https://test.putiikkipalvelu.fi/api/storefront/v1/customer/delete-user" \  -H "x-session-id: string"
{
  "message": "Customer deleted successfully"
}
{
  "error": "Error message"
}

Get customer orders

GET
/customer/get-orders/{customerId}

Authorization

ApiKeyAuth
x-api-key<token>

API key is automatically provided for demo requests in the playground

In: header

Path Parameters

customerId*string

Customer ID

Header Parameters

x-session-id*string

Customer's session token

Response Body

application/json

application/json

curl -X GET "https://test.putiikkipalvelu.fi/api/storefront/v1/customer/get-orders/string" \  -H "x-session-id: string"
{
  "success": true,
  "orders": [
    {
      "id": "string",
      "orderNumber": "ORD-2024-001",
      "totalAmount": 5999,
      "status": "DELIVERED",
      "createdAt": "2019-08-24T14:15:22Z",
      "OrderLineItems": [
        {
          "id": "string",
          "itemType": "PRODUCT",
          "quantity": 0,
          "price": 0,
          "totalAmount": 0,
          "productCode": "string",
          "name": "string",
          "vatRate": 0,
          "product": {
            "id": "string",
            "name": "string",
            "images": [
              "http://example.com"
            ],
            "slug": "string",
            "variationId": "string",
            "optionName": "string",
            "optionValue": "string",
            "isShipping": true,
            "unavailable": true
          }
        }
      ],
      "orderShipmentMethod": {
        "name": "Posti - Paketti",
        "price": 590,
        "vatRate": 25.5,
        "logo": "http://example.com"
      }
    }
  ]
}
{
  "error": "Error message"
}
Empty

Get customer wishlist

GET
/customer/wishlist

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

Customer's session token

Response Body

application/json

application/json

curl -X GET "https://test.putiikkipalvelu.fi/api/storefront/v1/customer/wishlist" \  -H "x-session-id: string"
{
  "items": [
    {
      "id": "string",
      "customerId": "string",
      "productId": "string",
      "variationId": "string",
      "createdAt": "2019-08-24T14:15:22Z",
      "product": {
        "id": "string",
        "name": "string",
        "slug": "string",
        "description": "string",
        "images": [
          "http://example.com"
        ],
        "price": 0,
        "salePrice": 0,
        "salePercent": "string",
        "saleStartDate": "2019-08-24T14:15:22Z",
        "saleEndDate": "2019-08-24T14:15:22Z",
        "quantity": 0,
        "sku": "string",
        "status": "ACTIVE"
      },
      "variation": {
        "id": "string",
        "sku": "string",
        "price": 0,
        "salePrice": 0,
        "quantity": 0,
        "images": [
          "http://example.com"
        ],
        "options": [
          {
            "id": "string",
            "value": "Large",
            "optionType": {
              "id": "string",
              "name": "Size"
            }
          }
        ]
      }
    }
  ]
}
{
  "error": "Error message"
}

Add item to wishlist

POST
/customer/wishlist

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

Customer's session token

Request Body

application/json

productId*string

Product ID to add

variationId?string

Variation ID (optional, for products with variations)

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://test.putiikkipalvelu.fi/api/storefront/v1/customer/wishlist" \  -H "x-session-id: string" \  -H "Content-Type: application/json" \  -d '{    "productId": "clx123abc"  }'
{
  "message": "Product added to wishlist"
}
{
  "error": "Error message"
}
{
  "error": "Error message"
}
{
  "error": "Product already in wishlist"
}

Remove item from wishlist

DELETE
/customer/wishlist

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

Customer's session token

Request Body

application/json

productId*string

Product ID to remove

variationId?string

Variation ID (must match if item was added with variation)

Response Body

application/json

application/json

application/json

application/json

curl -X DELETE "https://test.putiikkipalvelu.fi/api/storefront/v1/customer/wishlist" \  -H "x-session-id: string" \  -H "Content-Type: application/json" \  -d '{    "productId": "clx123abc"  }'
{
  "message": "Item removed from wishlist"
}
{
  "error": "Error message"
}
{
  "error": "Error message"
}
{
  "error": "Item not found in wishlist"
}