SettleFlow API
API Reference

POST /v1/payment/direct

Create a card payment (E-PRO compatible)

Authorize and capture a card payment. Returns a 3DS redirect URL when a challenge is required. See the Payment guide for the narrative version.

Request

POST /v1/payment/direct HTTP/1.1
Host: api.sandbox.settleflow.io
Content-Type: application/json
epro-api-key: pk_test_...

E-PRO compatibility. A application/x-www-form-urlencoded body is accepted alongside JSON, and Amount may be a string ("1234") or a JSON number (1234). See Migration.

Body — required fields

FieldTypeDescription
AmountstringInteger in smallest currency unit (e.g. "1234" = €12.34).
UidstringYour stable customer identifier (max 64).
TidstringYour unique transaction / order reference (max 64).
EmailstringCustomer email.
CardNumberstring13–19 digits, Luhn-checked.
CardMonthstringExpiry month, 112 (1–2 digits).
CardYearstringExpiry year (2 or 4 digits).
CardCVVstring3 or 4 digits.

Body — optional fields

Some of these fields may be mandatory depending on your account configuration (commonly Address, ZipCode, City, Country, BirthDate, Phone, Firstname, Lastname). A missing required field is rejected with error 222.

FieldTypeDescription
FirstnamestringCustomer first name (max 64).
LastnamestringCustomer last name (max 64).
AddressstringStreet address (max 128).
ZipCodestringPostal code (max 16).
CitystringCity name (max 64).
CountrystringISO 3166-1 Alpha-3 (e.g. FRA).
PhonestringPhone number (max 32).
BirthDatestringYYYY-MM-DD.
BirthPlacestringBirth city / place (max 64).
ClientIpstringCustomer IP address (max 15).
DescriptionstringOrder description (max 256).
CardOwnerstringCardholder name (max 64).
ReturnUrlURLWhere the customer lands after redirect-based authentication (e.g. 3D Secure). Reached with a POST by default — see 3D Secure.

3D Secure is applied automatically by the provider when required — there is no 3DS request flag.

Success response

{
  "Code": 0,
  "Result": {
    "OperationType": "payment",
    "Status": "captured",
    "Tid": "order-2026-001",
    "Reference": "pr_abc123",
    "Amount": "49.99",
    "Currency": "EUR",
    "UserId": "customer-42",
    "Message": "Payment was successful",
    "Date": "2026-04-22 14:30:45",
    "3DSecure": "no"
  }
}

Result fields

FieldTypeDescription
OperationTypestringAlways "payment".
Statusenumauthorized, captured, failed, cancelled, pending, rejected_pw.
TidstringEchoed from the request.
ReferencestringThe payment request ID.
AmountnumberMajor currency units.
CurrencystringISO 4217 currency code.
UserIdstringEcho of Uid.
MessagestringHuman-readable outcome.
DatestringYYYY-MM-DD HH:mm:ss (UTC).
3DSecureyes/noWhether 3DS was applied.
3DSecureUrlstringRedirect URL on the API host — present only when a redirect is required.
AliasstringAlias of the card registered during the transaction — reusable for one-click.

Error response

{ "Code": 206, "Error": "Invalid parameter CardNumber, check format or Luhn algorithm" }

Common error codes: 3, 4, 5, 8, 22, 104, 106, 200222, 300. See Error codes for the full catalog.

Examples

cURL

curl -X POST https://api.sandbox.settleflow.io/v1/payment/direct \
  -H "epro-api-key: pk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "Amount": "4999",
    "Uid": "customer-42",
    "Tid": "order-2026-001",
    "Email": "jane@example.com",
    "CardNumber": "4111111111111111",
    "CardMonth": "12",
    "CardYear": "2028",
    "CardCVV": "123",
    "ReturnUrl": "https://your-shop.com/payment/return"
  }'

Node.js

const res = await fetch("https://api.sandbox.settleflow.io/v1/payment/direct", {
  method: "POST",
  headers: {
    "epro-api-key": process.env.SETTLEFLOW_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    Amount: "4999",
    Uid: "customer-42",
    Tid: "order-2026-001",
    Email: "jane@example.com",
    CardNumber: "4111111111111111",
    CardMonth: "12",
    CardYear: "2028",
    CardCVV: "123",
    ReturnUrl: "https://your-shop.com/payment/return",
  }),
});
const { Code, Result, Error: errMsg } = await res.json();
if (Code !== 0) throw new Error(`[${Code}] ${errMsg}`);

PHP

<?php
$ch = curl_init('https://api.sandbox.settleflow.io/v1/payment/direct');
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'epro-api-key: ' . getenv('SETTLEFLOW_API_KEY'),
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => json_encode([
    'Amount'     => '4999',
    'Uid'        => 'customer-42',
    'Tid'        => 'order-2026-001',
    'Email'      => 'jane@example.com',
    'CardNumber' => '4111111111111111',
    'CardMonth'  => '12',
    'CardYear'   => '2028',
    'CardCVV'    => '123',
    'ReturnUrl'  => 'https://your-shop.com/payment/return',
  ]),
]);
$body = json_decode(curl_exec($ch), true);
if ($body['Code'] !== 0) {
    throw new \RuntimeException("[{$body['Code']}] {$body['Error']}");
}

On this page