Putiikkipalvelu Docs

Discount Codes

Apply and manage discount codes for cart discounts

Get current discount code

GET
/discount-code/apply

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

Response Body

application/json

application/json

curl -X GET "https://test.putiikkipalvelu.fi/api/storefront/v1/discount-code/apply" \  -H "x-cart-id: 550e8400-e29b-41d4-a716-446655440000"

{
  "discount": {
    "code": "SUMMER20",
    "discountType": "PERCENTAGE",
    "discountValue": 20
  }
}

{
  "error": "Error message"
}

Apply a discount code

POST
/discount-code/apply

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

Request Body

application/json

code*string

The discount code to apply

cartTotal*integer

Current cart subtotal in cents (used to validate minimum order)

Response Body

application/json

application/json

application/json

curl -X POST "https://test.putiikkipalvelu.fi/api/storefront/v1/discount-code/apply" \  -H "x-cart-id: 550e8400-e29b-41d4-a716-446655440000" \  -H "Content-Type: application/json" \  -d '{    "code": "SUMMER20",    "cartTotal": 15000  }'
{
  "success": true,
  "discount": {
    "code": "SUMMER20",
    "discountType": "PERCENTAGE",
    "discountValue": 20,
    "minOrderAmount": 5000
  }
}
{
  "error": "Alennuskoodia ei löytynyt",
  "code": "NOT_FOUND"
}
{
  "error": "Error message"
}

Remove discount code

DELETE
/discount-code/apply

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

Response Body

application/json

application/json

curl -X DELETE "https://test.putiikkipalvelu.fi/api/storefront/v1/discount-code/apply" \  -H "x-cart-id: 550e8400-e29b-41d4-a716-446655440000"
{
  "success": true
}
{
  "error": "Error message"
}