Create a Direct API payment
Creates a payment by charging a card directly. Submit card details under
payment_method_data.card and payer billing data under billing_details.
The response is returned immediately with the payment attempt status. If the
status is REQUIRES_ACTION, redirect the customer to
next_action.redirect_url, then use GET /v1/payments/{id} or webhooks
as the source of truth for the final result.
return_url is required for flows where 3D Secure authentication may be
requested.
Use the Idempotency-Key header to safely retry requests without
creating duplicate charges.
Authorizations
Use your secret API key as the Bearer token. Test mode keys start with
api_test_sk_ and live mode keys start with api_live_sk_. Both modes
use the same API host; the mode is determined by the key.
Authorization: Bearer api_test_sk_abc123def456Headers
A unique key to ensure the request is processed only once. If a request with the same idempotency key and the same body has already been processed successfully, the original response is returned. Non-2xx responses are not cached, so callers may retry after errors. Keys expire after 24 hours.
For one-shot requests, such as creating a payment from a checkout button, a random UUIDv4 is fine. For requests tied to a specific business operation, such as refunding an order, a deterministic key is preferred so retries collapse correctly across processes.
255Body
Payment amount in minor units.
x >= 14999
Three-letter ISO 4217 currency code. Currently supported for card
acquiring: EUR.
EUR "EUR"
URL where the customer returns after 3D Secure authentication.
"https://shop.example.com/3ds-return"
Merchant-side order or checkout reference for reconciliation. This field does not provide idempotency by itself.
255"ord_1234"
Merchant-provided payment description.
500"Order #1234"
Response
Payment accepted and a Payment object was created. Check status
before treating the payment as complete; REQUIRES_ACTION includes
next_action.redirect_url, while PROCESSING or PENDING should
be followed with GET /v1/payments/{id} or webhooks.
A Payment represents one attempt to collect funds from the customer.
Merchants can use merchant_reference to associate multiple
payment attempts with the same order or checkout in their own systems.
Unique opaque identifier for a payment (pay_ prefix + random alphanumeric suffix).
^pay_[A-Za-z0-9]{24}$"pay_q7Mk2Np8Vr4Xt6Yz9Ab3Cd5E"
Payment amount in minor units.
x >= 14999
Three-letter ISO 4217 currency code. Currently supported for card
acquiring: EUR.
EUR "EUR"
Current status of a payment attempt.
PENDING-- The payment was accepted by Flowlix and is waiting to be processed.REQUIRES_ACTION-- Customer action is required, usually 3D Secure authentication.PROCESSING-- The payment is being processed by downstream payment systems.SUCCEEDED-- The payment completed successfully.FAILED-- The payment was declined or failed permanently.CANCELED-- The payment was canceled before completion.EXPIRED-- The customer did not complete a required action before its expiry time.
PENDING, REQUIRES_ACTION, PROCESSING, SUCCEEDED, FAILED, CANCELED, EXPIRED "SUCCEEDED"
How the payment was collected. This is separate from the payment method
instrument, such as card or a future wallet.
DIRECT, HOSTED_PAYMENT_PAGE "DIRECT"
Total amount successfully refunded so far, in minor units.
x >= 00
Remaining amount that can be refunded, in minor units.
x >= 04999
Unix timestamp when the payment was created.
1719792000
Whether this payment was created using a live API key.
false
Merchant-side order or checkout reference for reconciliation, if provided. This field does not provide idempotency by itself.
255"ord_1234"
Merchant-provided payment description.
"Order #1234"
Masked card details, or null before card details are available.
Billing details captured for the payment, if available.
Merchant-provided metadata. Values may be any valid JSON value.
{ "order_id": "ord_1234" }Machine-readable decline code when the payment fails.
"insufficient_funds"
Human-readable decline explanation when available.
"The card has insufficient funds."
URL of the hosted payment page for HPP payments.
"https://pay.flowlix.dev/hpp/pay_q7Mk2Np8Vr4Xt6Yz9Ab3Cd5E"
Refunds created for this payment, oldest first.
Timestamps for important payment status transitions.
Customer action required to continue the payment.