Quick Start Guide

Get up and running in 5 minutes

1 Get Your Credentials

Request your API credentials via email. You'll receive:

Request Credentials

2 Authenticate

Get your JWT token (do this server-side in production):

curl -X POST https://pay.t1k.se/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "username": "your_username",
    "password": "your_password"
  }'

# Response:
{
  "success": true,
  "token": "eyJ0eXAiOiJKV1Q...",
  "user": {
    "username": "your_username",
    "email": "you@example.com"
  }
}

3 Create a Payment

Send just 4 fields to create a payment:

curl -X POST https://pay.t1k.se/api/pay \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "what": "Coffee",
    "from_who": "Cafe Stockholm",
    "amount": 45.00,
    "currency": "SEK"
  }'

# Response:
{
  "success": true,
  "transaction_id": "trans_20240330_123456",
  "redirect_url": "https://checkout.swedbankpay.com/...",
  "status": "created"
}

4 Redirect Customer

Send the customer to the payment page:

// JavaScript
window.location.href = result.redirect_url;

// Or in HTML
<a href="">Complete Payment</a>

After payment, customers are automatically redirected back to your site.

Integration Examples

Node.js / JavaScript

const response = await fetch('https://pay.t1k.se/api/pay', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    what: 'Product',
    from_who: 'Your Store',
    amount: 99.00,
    currency: 'SEK'
  })
});

const result = await response.json();
if (result.success) {
  window.location.href = result.redirect_url;
}

Python

import requests

response = requests.post(
    'https://pay.t1k.se/api/pay',
    headers={
        'Authorization': f'Bearer {token}',
        'Content-Type': 'application/json'
    },
    json={
        'what': 'Product',
        'from_who': 'Your Store',
        'amount': 99.00,
        'currency': 'SEK'
    }
)

result = response.json()
if result['success']:
    # Redirect to result['redirect_url']

Optional Parameters

Custom Return URLs

Control where customers go after payment:

{
  "what": "Product",
  "from_who": "Your Store",
  "amount": 99.00,
  "currency": "SEK",
  "return_url": "https://yoursite.com/success",
  "cancel_url": "https://yoursite.com/cancelled"
}

Auto-Capture (Post-Purchase)

Automatically capture payments when authorized:

{
  "what": "Digital Product",
  "from_who": "Your Store",
  "amount": 99.00,
  "currency": "SEK",
  "post_purchase": true
}

Test Mode

Use these test card numbers with Swedbank Pay:

  • Successful payment: 4925000000000004
  • 3D Secure test: 4761739001010416
  • Insufficient funds: Use amount 900361
  • Card expired: Use amount 900354

All test cards use: Expiry: Any future date, CVV: Any 3 digits

Next Steps

๐Ÿ“– Full Documentation

Explore all API endpoints, webhooks, and advanced features.

View API Docs โ†’

๐Ÿงช Test Scenarios

Try different payment scenarios in our sandbox environment.

Login to Test โ†’