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 (contact developers@flowlix.eu to get started)
  • Your test mode API key (starts with fl_test_sk_)
  • curl or any HTTP client

Step 1: Get your API key

Your Flowlix account includes test mode API keys. Contact your account manager or developers@flowlix.eu to receive your credentials. Your test mode secret key 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.dev/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": "4111111111111111",
      "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 4111111111111111 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": "pending",
  "description": "My first Flowlix payment",
  "card": {
    "brand": "visa",
    "last4": "1111",
    "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": null,
  "failed_at": null,
  "created": 1719792000,
  "livemode": false
}
Key fields to note:
  • id — Save this. You need it to retrieve or refund the payment later.
  • statuspending means the payment is being processed. Poll GET /v1/payments/{id} until it becomes succeeded or failed.
  • 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.dev/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.