Skip to main content

Quickstart

This guide walks you through creating your first Flowlix payment using the Direct API. By the end, you will have a working test payment.

Prerequisites

  • A Flowlix account (sign up here)
  • Your test mode API key (starts with fl_test_sk_)
  • curl or any HTTP client

Step 1: Get your API key

Log in to the Flowlix Dashboard and navigate to Settings > API Keys. Copy your test mode secret key. It looks like:
fl_test_sk_abc123def456ghi789
Never expose your secret key in client-side code or public repositories.

Step 2: Create a payment

Run this command in your terminal (replace fl_test_sk_... with your actual key):
curl -X POST https://api.flowlix.eu/v1/payments \
  -H "Authorization: Bearer fl_test_sk_abc123def456" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: my-first-payment-001" \
  -d '{
    "amount": 4999,
    "currency": "eur",
    "card": {
      "number": "4242424242424242",
      "exp_month": 12,
      "exp_year": 2027,
      "cvc": "314",
      "holder_name": "Jenny Rosen"
    },
    "customer": {
      "email": "jenny@example.com",
      "first_name": "Jenny",
      "last_name": "Rosen",
      "country": "DE",
      "phone": "+491234567890",
      "address": "100 Main St",
      "city": "Berlin",
      "zip": "10115"
    },
    "description": "My first Flowlix payment"
  }'
The card number 4242424242424242 is a test card that always succeeds in test mode. See Test Cards for more numbers.

Step 3: Check the response

A successful payment returns HTTP 201 with a Payment object:
{
  "id": "pay_1N3fKx2eZvKYlo2C0XjMr8pV",
  "object": "payment",
  "amount": 4999,
  "currency": "eur",
  "status": "succeeded",
  "description": "My first Flowlix payment",
  "card": {
    "brand": "visa",
    "last4": "4242",
    "exp_month": 12,
    "exp_year": 2027,
    "country": "US"
  },
  "customer": {
    "email": "jenny@example.com",
    "name": "Jenny Rosen"
  },
  "metadata": {},
  "decline_code": null,
  "decline_message": null,
  "redirect_url": null,
  "refunded_at": null,
  "succeeded_at": 1719792000,
  "failed_at": null,
  "created": 1719792000,
  "livemode": false
}
Key fields to note:
  • id — Save this. You need it to retrieve or refund the payment later.
  • statussucceeded means the payment went through.
  • livemodefalse confirms this is a test payment.

Step 4: Retrieve the payment

You can fetch the payment details at any time:
curl https://api.flowlix.eu/v1/payments/pay_1N3fKx2eZvKYlo2C0XjMr8pV \
  -H "Authorization: Bearer fl_test_sk_abc123def456"

What’s next?

Direct API Guide

Deep dive into the Direct API payment flow.

Hosted Payment Page

Let Flowlix handle card collection for you.

Error Handling

Learn how to handle declined cards and API errors.

Test Cards

Simulate different payment scenarios in test mode.