Putiikkipalvelu Docs

Payments

Payment checkout (Stripe and Paytrail)

Create Stripe checkout session

POST
/payments/stripe/checkout

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

orderId*string

Unique order ID (generated by client)

chosenShipmentMethod?

Selected shipment method for checkout

customerData*

Customer information for checkout

successUrl*string

URL to redirect on successful payment

Formaturi
cancelUrl*string

URL to redirect on cancelled payment

Formaturi

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://test.putiikkipalvelu.fi/api/storefront/v1/payments/stripe/checkout" \  -H "x-cart-id: 550e8400-e29b-41d4-a716-446655440000" \  -H "Content-Type: application/json" \  -d '{    "orderId": "550e8400-e29b-41d4-a716-446655440000",    "chosenShipmentMethod": {      "shipmentMethodId": "clx123ship",      "pickupId": null    },    "customerData": {      "first_name": "Matti",      "last_name": "Meikäläinen",      "email": "matti@example.fi",      "address": "Mannerheimintie 1",      "postal_code": "00100",      "city": "Helsinki",      "phone": "+358401234567"    },    "successUrl": "https://mystore.com/payment/success/order-123",    "cancelUrl": "https://mystore.com/payment/cancel/order-123"  }'
{
  "url": "https://checkout.stripe.com/c/pay/cs_test_abc123..."
}
{
  "error": "Product not available",
  "code": "INSUFFICIENT_INVENTORY",
  "details": {
    "productId": "clx123abc",
    "availableQuantity": 2,
    "requestedQuantity": 5
  }
}
{
  "error": "Error message"
}
{
  "error": "Cart is empty",
  "code": "EMPTY_CART",
  "details": {
    "productId": "string",
    "variationId": "string",
    "availableQuantity": 0,
    "requestedQuantity": 0
  }
}

Create Paytrail checkout session

POST
/payments/paytrail/checkout

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

orderId*string

Unique order ID (generated by client)

chosenShipmentMethod?

Selected shipment method for checkout

customerData*

Customer information for checkout

successUrl*string

URL to redirect on successful payment

Formaturi
cancelUrl*string

URL to redirect on cancelled payment

Formaturi

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://test.putiikkipalvelu.fi/api/storefront/v1/payments/paytrail/checkout" \  -H "x-cart-id: 550e8400-e29b-41d4-a716-446655440000" \  -H "Content-Type: application/json" \  -d '{    "orderId": "550e8400-e29b-41d4-a716-446655440000",    "chosenShipmentMethod": {      "shipmentMethodId": "clx123ship",      "pickupId": "loc_456"    },    "customerData": {      "first_name": "Matti",      "last_name": "Meikäläinen",      "email": "matti@example.fi",      "address": "Mannerheimintie 1",      "postal_code": "00100",      "city": "Helsinki",      "phone": "+358401234567"    },    "successUrl": "https://mystore.com/payment/success/order-123",    "cancelUrl": "https://mystore.com/payment/cancel/order-123"  }'
{
  "transactionId": "pt-txn-abc123",
  "href": "https://pay.paytrail.com/pay/pt-txn-abc123",
  "reference": "store-456",
  "terms": "https://www.paytrail.com/terms",
  "groups": [
    {
      "id": "bank",
      "name": "Pankkimaksut",
      "icon": "https://resources.paytrail.com/images/bank.png",
      "svg": "<svg>...</svg>"
    },
    {
      "id": "mobile",
      "name": "Mobiilimaksut",
      "icon": "https://resources.paytrail.com/images/mobile.png",
      "svg": "<svg>...</svg>"
    }
  ],
  "providers": [
    {
      "id": "nordea",
      "name": "Nordea",
      "group": "bank",
      "icon": "https://resources.paytrail.com/images/nordea.png",
      "svg": "<svg>...</svg>",
      "url": "https://payment.nordea.fi/...",
      "parameters": [
        {
          "name": "MERCHANT_ID",
          "value": "123456"
        },
        {
          "name": "AMOUNT",
          "value": "4999"
        }
      ]
    },
    {
      "id": "mobilepay",
      "name": "MobilePay",
      "group": "mobile",
      "icon": "https://resources.paytrail.com/images/mobilepay.png",
      "svg": "<svg>...</svg>",
      "url": "https://mobilepay.paytrail.com/...",
      "parameters": [
        {
          "name": "MERCHANT_ID",
          "value": "123456"
        },
        {
          "name": "AMOUNT",
          "value": "4999"
        }
      ]
    }
  ],
  "customProviders": {}
}
{
  "error": "Cart is empty",
  "code": "EMPTY_CART"
}
{
  "error": "Error message"
}
{
  "error": "Cart is empty",
  "code": "EMPTY_CART",
  "details": {
    "productId": "string",
    "variationId": "string",
    "availableQuantity": 0,
    "requestedQuantity": 0
  }
}