How it works
1. Create the payment
payment_method_data.card— the raw card details collected on your checkout.billing_details— required; at minimumemailandaddresswithline1,city,postal_code, andcountry.merchant_referenceis an optional reconciliation reference represented as an integer with exactly 10 digits (from1000000000to9999999999).return_url— required. If the issuer requests 3D Secure, this is where the customer lands after authentication.
2. Handle the response
The API responds201 Created with the payment attempt’s current status.
Branch on status:
A declined card is not an HTTP error. The request itself succeeded, so
you receive
201 with status: "FAILED" and a machine-readable
failure_code (for example insufficient_funds). HTTP 4xx codes are
reserved for problems with the request itself — bad fields, invalid keys,
idempotency conflicts. See Errors and
Operation failure codes.3. 3D Secure flow
Whenstatus is REQUIRES_ACTION:
- Redirect the customer to
next_action.redirect_urlwhennext_action.reasonisthree_d_secure. Treat the URL as opaque: it may be a 3D Secure fingerprint collection step or a later authentication challenge. - Keep polling
GET /v1/payments/{id}while the customer is in the browser flow. If the payment staysREQUIRES_ACTIONand Flowlix returns a differentnext_action.redirect_url, redirect the customer to the new URL. If the URL is unchanged for the same browser session, do not redirect in a loop — show a pending state and keep polling. - After authentication — success or failure — the customer is redirected to
your
return_url. - Confirm the result with
GET /v1/payments/{id}:SUCCEEDED,FAILED(for examplefailure_code: "three_d_secure_failed"), orEXPIREDif the customer never completed the challenge.
return_url proves
nothing — the API status is the source of truth.
Retries and duplicates
Always send anIdempotency-Key header. If your request times out or your
process crashes mid-call, retry with the same key and the same body — you
will get the original result back instead of charging the customer twice.
Details and edge cases: Idempotency.
Going live checklist
- PCI DSS attestation submitted and approved.
- Card data never logged, stored, or sent to any system outside your PCI scope.
-
Idempotency-Keysent on every create request, with retry-safe keys. - 3D Secure redirect flow tested, including abandoned challenges.
- Failure handling covers the operation failure codes relevant to your business.
- Webhooks configured for asynchronous outcomes.