klix-integration
Klix Payment Gateway Integration
Integrate Klix (by Citadele) payment gateway into any web application or website. Klix supports card payments, Apple Pay, Google Pay, bank transfers (PIS) across the Baltics, and Pay Later installments.
Official docs: https://developers.klix.app/ Full API reference (OpenAPI): https://portal.klix.app/api/schema/v1/
Quick Start Checklist
Before integrating, confirm these with the user:
- Credentials — Brand ID and Secret Key (from Klix merchant portal or test env)
- Integration type — eCommerce plugin, widget library, or direct API?
- Payment methods needed — cards, Apple Pay, Google Pay, bank PIS, Pay Later?
- Payment scenarios — one-time, recurring, reservation/capture?
If unsure, start with the test environment to prototype.
Test Environment
Use these credentials for development and testing:
| Field | Value |
|---|---|
| Brand ID | 702314b8-dd86-41fa-9a22-510fdd71fa92 |
| Secret Key (full features) | IB-bzOdJLgJjbsaA34Qpxkg1TTIrW-iDuni6JuzbP--KgtsREHzvIvLLTH8E5T0CZcSbYM3qNmfeogpWW_RZaA== |
| Secret Key (simple) | No51P_Dq4jQGeha6_eQpfjAFe67u3QYHEO95jrcCux0zPfByd8x9poSa6xINQPz1hyUGKNYoxa16rnUkSUI_MA== |
Test cards:
| Type | PAN | CVV | Expiry | 3DS Password |
|---|---|---|---|---|
| VISA | 4505 1312 3400 0029 | 123 | 06/28 | hint |
| Mastercard | 5191 6312 3400 0024 | 583 | 06/28 | hint |
Any cardholder name is accepted. On the test payment page, choose "successful" or "failed" scenario.
Integration Approaches
Choose based on the project:
1. eCommerce Plugin (no code)
For WooCommerce (3.5+), Shopify, Magento (2.0+), OpenCart (3.0+), PrestaShop (1.7+), Mozello.
See references/ecommerce-plugins.md for platform-specific setup.
2. Frontend Widget (Pay Later only)
For showing monthly payment calculators on product/cart pages.
See references/pay-later-widget.md.
3. Direct API Integration (recommended for custom apps)
Full control over payment flow. Works with any stack. This is the main integration method — details below.
API Reference
Base URL: https://portal.klix.app/api/v1/
Authentication: Bearer token in the Authorization header:
Authorization: Bearer <Secret Key>
Required headers for all requests:
Accept: application/json
Content-Type: application/json
Authorization: Bearer <SECRET_KEY>
Amounts are always in cents (e.g., 3000 = 30.00 EUR).
Core Endpoints
List Available Payment Methods
GET /payment_methods/?currency=EUR&brand_id=<BRAND_ID>
Returns available methods with names, logos, country availability. Cache this response — rate-limited to max 1 request/minute.
Create a Purchase
POST /purchases/
Minimal request body:
{
"brand_id": "<BRAND_ID>",
"success_callback": "https://yoursite.com/api/klix/callback",
"success_redirect": "https://yoursite.com/order/success",
"failure_redirect": "https://yoursite.com/order/failure",
"cancel_redirect": "https://yoursite.com/order/cancel",
"purchase": {
"language": "en",
"products": [
{
"name": "Product name",
"price": 2999
}
]
},
"client": {
"email": "customer@example.com"
},
"reference": "ORDER-123"
}
Response includes id (purchase ID) and checkout_url — redirect the customer there.
Get Purchase Status
GET /purchases/<PURCHASE_ID>/
Capture Reserved Funds
POST /purchases/<PURCHASE_ID>/capture/
Optional body for partial capture: {"amount": 1500}
Release Reserved Funds
POST /purchases/<PURCHASE_ID>/release/
Charge Recurring Payment
POST /purchases/<PURCHASE_ID>/charge
Body: {"recurring_token": "<TOKEN>"}
Payment Flow
1. Server: POST /purchases/ → get checkout_url
2. Client: Redirect customer to checkout_url
3. Customer: Completes payment on Klix page
4. Klix: POST to success_callback (server-to-server)
5. Klix: Redirect customer to success_redirect or failure_redirect
6. Server: Verify payment via GET /purchases/<ID>/
Always verify payment status server-side via the callback. Do not rely solely on the redirect.
Payment Scenarios
One-Time Payment
Standard flow as shown above. No extra parameters needed.
Recurring Payments
- Create initial purchase with
"force_recurring": true - On success callback, store the purchase
idas the recurring token - For subsequent charges: create a new purchase, then call
/chargewith the token
{
"brand_id": "<BRAND_ID>",
"force_recurring": true,
"success_callback": "https://yoursite.com/api/klix/callback",
"success_redirect": "https://yoursite.com/success",
"failure_redirect": "https://yoursite.com/failure",
"purchase": {
"products": [{"name": "Subscription", "price": 999}]
},
"client": {"email": "user@example.com"}
}
Reservation (Authorization Hold)
- Create purchase with
"skip_capture": true - Funds are held (status: "hold")
- Later: capture full/partial amount or release
- Auto-releases after 6 days if not captured
Restrict Payment Methods
Use payment_method_whitelist to show only specific methods:
{
"payment_method_whitelist": ["klix", "klix_apple_pay", "klix_google_pay"]
}
Native Apple Pay / Google Pay
- Create purchase with
payment_method_whitelist: ["klix_apple_pay"](orklix_google_pay) - Get encrypted token from Apple/Google Pay JS API
- POST to
https://portal.klix.app/api/v1/p/<PURCHASE_ID>/- Form data:
pm=klix_apple_pay,s2s=true,token=<Base64_token>
- Form data:
- If response contains
threeDsRedirectUrl, redirect customer for 3DS verification
Apple Pay detection: window.ApplePaySession && ApplePaySession.canMakePayments()
Bulk Payments (PIS)
Supported on: citadele_*_pis, seb_*_pis, swedbank_*_pis
Include payment_method_details.pis_bulk_purchase[] with creditor IBAN, name, amount, reference.
All IBANs must be pre-whitelisted with Klix.
Supported Payment Methods
See references/payment-methods.md for the full list of 24 methods across Latvia, Lithuania, and Estonia.
Key method IDs:
klix— Card payments (Visa, Mastercard)klix_apple_pay— Apple Payklix_google_pay— Google Payklix_pay_later— Installments*_pis— Bank transfers (e.g.,swedbank_lv_pis,seb_ee_pis)*_digilink— Citadele bank links
Callback Handling
Klix sends a server-to-server POST to success_callback when payment completes.
Implement a POST endpoint that:
- Receives the callback
- Verifies payment by calling
GET /purchases/<ID>/ - Updates order status in your database
- Returns HTTP 200
Example (Node.js/Express):
app.post('/api/klix/callback', async (req, res) => {
const purchaseId = req.body.id;
const response = await fetch(
`https://portal.klix.app/api/v1/purchases/${purchaseId}/`,
{ headers: { 'Authorization': `Bearer ${process.env.KLIX_SECRET_KEY}` } }
);
const purchase = await response.json();
if (purchase.status === 'paid') {
await updateOrderStatus(purchase.reference, 'paid');
}
res.sendStatus(200);
});
Branding Guidelines
- Show Klix logo alongside other payment methods in footer and checkout
- Use official button assets from https://developers.klix.app/static-assets/
- Checkout button labels by language (LV/EN/LT/RU) — see
references/branding.md - Apple Pay: follow Apple's representation guidelines
- Contact marketing@klix.app for custom landing page text changes
Reference Files
Read these for deeper details on specific topics:
references/payment-methods.md— Full list of 24 payment methods with country/validation detailsreferences/pay-later-widget.md— Frontend widget for installment calculator displayreferences/ecommerce-plugins.md— Platform-specific plugin setup (WooCommerce, Shopify, etc.)references/branding.md— Logo assets, button labels, landing page requirements
Common Integration Patterns
Next.js / React
- Create API route for purchase creation (
POST /api/checkout) - Create API route for callback (
POST /api/klix/callback) - Redirect to
checkout_urlfrom client or userouter.push() - Create success/failure/cancel pages
Express / Node.js
POST /checkout— creates Klix purchase, returnscheckout_urlPOST /webhook/klix— handles callbackGET /order/:id/status— checks order status
PHP / Laravel
- Use
klix/klix-sdk-phpfrom Packagist (official SDK) - Create checkout controller
- Add webhook route for callback
Any Other Stack
- Make HTTP requests to the API directly
- Or generate a client from the OpenAPI schema:
https://portal.klix.app/api/schema/v1/
More from biggora/claude-plugins-registry
captcha
>
32test-web-ui
>
19tailwindcss-best-practices
Tailwind CSS v4.x utility-first CSS framework best practices. Use when styling web applications with utility classes, building responsive layouts, customizing design systems with @theme variables, migrating from v3 to v4, configuring dark mode, creating custom utilities with @utility, or working with any Tailwind CSS v4 features. This skill covers the full v4.x line through v4.2 including text shadows, masks, logical properties, and source detection. Use this skill even for simple Tailwind questions — v4 changed many class names and configuration patterns that trip people up.
18gemini-cli
>
12vite-best-practices
Vite build tool configuration, plugin API, SSR, library mode, and Vite 8 Rolldown/Oxc migration. Use when working with Vite projects, vite.config.ts, Vite plugins, building libraries or SSR apps with Vite, migrating from older Vite versions, or configuring Rolldown/Oxc options. Also use when the user mentions HMR, import.meta.glob, virtual modules, or Vite environment variables.
12test-mobile-app
>
11