Risk controls
Flint checks every card and ACH debit payment against your risk rules. A rule looks at facts about the payment, such as the amount, the buyer's email, or the card's country, and takes one of four actions: let the payment through, block it, require 3D Secure, or open a review for someone to approve or decline.
Every account starts with two rules already on: one blocks cards, emails, and IP addresses on Flint's default block lists, and one opens a review for payments the card processor rates as high risk. You add your own rules and lists on top of them through the API or the dashboard.
How Flint decides#
Flint checks rules twice for each payment attempt: once before the card is sent for authorization, and once after the result comes back.
- Your app sends confirm the payment intent, or pay the order to Flint
- Flint sends pre-authorization rules: allow, block, or require 3D Secure to Flint
- Flint sends authorization request, with 3D Secure when a rule requires it to Card processor
- Card processor returns approved or declined, plus the risk level from its fraud screening to Flint
- Flint sends post-authorization rules: allow or review to Flint
- Flint returns the payment result, then payment_review.opened if a review rule matched to Your app
A blocked payment stops at the first check and never reaches the bank. Everything else is authorized as usual, and a review opens only on a payment the bank approved.
Which check a rule belongs to depends on the attributes it reads. Most attributes are known before authorization. risk_level and risk_score come from the card processor's fraud screening, so a rule that reads either one runs after authorization. That limits which actions it can take:
| Action | Attributes it can read | What happens when it decides |
|---|---|---|
allow | Any | Your block and review rules, and Flint's, no longer apply to this attempt. The bank can still decline it, and require_3ds rules still apply. |
block | Pre-authorization only | The attempt fails with payment_blocked before authorization. The buyer sees a generic decline and can try another payment method. |
require_3ds | Pre-authorization only | The bank must authenticate the buyer with 3D Secure. Skipped for off-session payments. |
review | Any | The payment proceeds, and Flint opens a review after the bank approves it. |
How rules combine#
Rules have no priority, and the order you create them in does not change the outcome. Flint resolves matches by action:
- Every matching
require_3dsrule adds a 3D Secure requirement. It never changes the allow, block, or review decision, and anallowdoes not remove it. - Before authorization, a matching
allowrule wins. The attempt is allowed, and post-authorization rules do not run. - Otherwise a matching
blockrule blocks the attempt. - Otherwise a matching
reviewrule marks the attempt for review. - After authorization, if nothing was allowed or blocked, a matching post-authorization
allowrule clears any pending review. Otherwise a matchingreviewrule, from either check, opens a review.
For example, an allow rule for customers on your trusted_customers list lets those customers pay even when their email is on default_block_emails, and skips the default review for high-risk payments. It would not skip a require_3ds rule that also matched.
When a rule matches, the payment intent's risk.matched_risk_rule_id names the rule that decided the result.
Each attempt keeps its own snapshot#
When an attempt starts, Flint records the rules in force, the payment details they read, and whether each value was on each list. The post-authorization check uses that same record. Editing a rule or a list afterward does not change an attempt already in progress. A retry is a new attempt and uses the rules and lists as they are then.
Which payments are checked#
| Payment | What applies |
|---|---|
| Card, Apple Pay, Google Pay | Every action. |
| ACH debit | allow and block. A review or require_3ds rule that matches an ACH debit fails the payment with PAYMENT_OPTION_UNAVAILABLE with reason risk_action_unsupported. Add payment_method_type eq card to those rules. |
| Affirm | Not checked. |
| Off-session payments: subscription payments and automatic invoice charges | Every action except require_3ds, which is skipped because no buyer is present to authenticate. |
| Virtual terminal | A matching require_3ds rule fails the payment with ACTION_NOT_ALLOWED with reason configuration_required, because the cardholder is not there to verify. Exclude virtual_terminal with payment_flow neq. |
Rules, lists, and reviews belong to one environment. Live and each sandbox have their own set.
Flint's default controls#
Every environment starts with these two rules:
Rule description | Action | Matches |
|---|---|---|
| Block payments matching Flint default block lists | block | The card fingerprint is on default_block_card_fingerprints, the email is on default_block_emails, or the IP address is on default_block_ip_addresses. |
| Review highest-risk payments and elevated-risk payments outside trusted recurring flows | review | risk_level is highest, or risk_level is elevated and payment_flow is not invoice or subscription_renewal. |
Both show up in GET /v1/risk-rules with origin: "system_default" and created_by: null. They accept only status changes: turn either one off with PATCH /v1/risk-rules/{risk_rule_id} and {"status": "inactive"}, and back on with {"status": "active"}. A change to action, predicate, or description, or a delete, returns 409 ACTION_NOT_ALLOWED with reason managed_externally.
The three default lists start empty and also have origin: "system_default". Add and remove items on them like any other list. Declining a review with add_to_block_lists adds that payment's card fingerprint, email, and IP address to them. The card fingerprint is the same value as PaymentMethod.fingerprint. They cannot be renamed or archived.
Write a rule#
This example holds large guest card payments for review: $500 or more, with no customer attached.
Predicate grammar#
Each operator takes one operand field. Comparisons on amount_money use an amount_money operand in place of value. These nine operators are the whole vocabulary, the same values the registry's operators arrays use, and each attribute's entry lists the ones it supports.
| Operator | Operand | Matches when |
|---|---|---|
eq, neq | value | The attribute equals, or does not equal, one literal. |
gt, gte, lt, lte | value | The attribute is greater or less than the operand. Only amount_money and risk_score support ordering. |
in | values, 1 to 100 literals | The attribute equals any of them. |
in_list | list_alias | The attribute's value is on the list. |
is_missing | None | The payment has no value for the attribute. |
all and any take 1 to 50 children, and not takes one. A predicate can have up to 100 nodes and nest 10 levels deep. Each node accepts only its own fields, so a typo such as "valeu" is rejected instead of ignored.
Attributes#
The registry is the authority for what your environment supports. The card attributes, email, email_domain, ip_address, and customer_id can be missing on any payment; see the note on missing values in step 2.
| Attribute | Type | Value |
|---|---|---|
amount_money | money | The payment amount and currency. |
currency | currency | The payment currency, such as USD. |
card_brand | enum | amex, discover, diners, jcb, mastercard, unionpay, visa, or unknown. |
card_funding | enum | credit, debit, prepaid, or unknown. |
card_country | country | The country that issued the card. |
card_bin | string | The card's first 6 to 8 digits. |
card_fingerprint | string | The card's PaymentMethod.fingerprint: 32 lowercase hexadecimal characters that stay the same for one card number across payments and customers in this merchant and environment. The same card has a different value at another merchant or in another environment, and a card added through Apple Pay or Google Pay can have a different value from the same card typed in. A predicate value must match the lowercase PaymentMethod.fingerprint exactly. |
email | The receipt email, or the billing email when there is no receipt email. | |
email_domain | string | The part of email after the @. |
ip_address | ip_address | The buyer's IP address. |
ip_country | country | Listed in the registry but not available yet. |
customer_id | string | The Flint customer the payment belongs to. |
is_guest | boolean | true when no customer is attached. |
payment_method_type | enum | card for cards, Apple Pay, and Google Pay. |
digital_wallet | enum | apple_pay or google_pay. Missing for a card entered by hand. |
is_saved_payment_method | boolean | true when the payment uses a saved card. |
is_off_session | boolean | true for payments made without the buyer present. |
payment_flow | enum | Where the payment came from: checkout, payment_link, invoice, subscription_initial, subscription_renewal, virtual_terminal, or api. |
risk_level | enum | Post-authorization. The card processor's rating, with these meanings: normal, elevated, highest, or not_assessed. |
risk_score | integer | Post-authorization. The fraud score, from 0 to 99, with higher meaning riskier. Available only where the registry reports is_available: true. |
A risk_score operand must be an integer from 0 to 99, in value and in each entry of values. A score outside that range, such as 100 or -1, is an invalid_operand issue in a preview and a 400 INVALID_REQUEST on a write, so a rule can't compare against a score no payment has.
A payment intent's metadata is available too, as payment_intent_metadata. followed by the key, for example payment_intent_metadata.fulfillment_region. These are strings that support eq, neq, in, and is_missing. They are not listed in the registry, which returns only named attributes; any other attribute name is an unknown_attribute issue.
Lists#
A list holds values a rule matches against, so you can change who is blocked or trusted without editing rules. A rule refers to a list by its alias.
Create the list:
curl -X POST https://api.withflintpay.com/v1/risk-lists \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: list-flagged-emails-001" \
-d '{
"name": "Flagged emails",
"alias": "flagged_emails",
"item_type": "email"
}'
Add values with values, an array of 1 to 500 strings of 1 to 512 characters each. To add one value, send an array of one. A request that sends value returns 400 INVALID_REQUEST with an UNKNOWN_FIELD detail naming value.
curl -X POST https://api.withflintpay.com/v1/risk-lists/rl_1kmn0aExample/items \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: list-flagged-emails-batch-001" \
-d '{"values": ["ada@example.com", "Grace@Example.com"]}'
{
"data": {
"additions": [
{
"outcome": "created",
"risk_list_item": {
"risk_list_item_id": "rli_1kmn0aExample",
"risk_list_id": "rl_1kmn0aExample",
"value": "ada@example.com",
"created_by": {"resource_type": "api_key", "resource_id": "key_1kmn0aExample"},
"created_at": "2026-09-24T16:20:03Z"
}
},
{
"outcome": "existing",
"risk_list_item": {
"risk_list_item_id": "rli_2kmn0aExample",
"risk_list_id": "rl_1kmn0aExample",
"value": "grace@example.com",
"created_by": {"resource_type": "api_key", "resource_id": "key_1kmn0aExample"},
"created_at": "2026-09-20T09:12:44Z"
}
}
]
}
}
additions has one entry per requested value, in request order. Each entry reports an outcome, created or existing, with the full risk_list_item. Values already on the list come back as existing, so a batch is safe to resend. A value repeated within a request reports existing after its first entry. The response is 201 when at least one value was added and 200 when every value already existed. A batch is all or nothing: one invalid value fails the request with 400 INVALID_REQUEST and detail code INVALID_VALUE, and param names it, for example values[3].
Then reference the list from a rule:
{"attribute": "email", "operator": "in_list", "list_alias": "flagged_emails"}
Flint trims leading and trailing whitespace from list values and payment signals, then compares them exactly after the item type's normalization. Accents remain significant. Strings and email addresses preserve Unicode composition, so precomposed and decomposed accented text remain distinct.
For example, Grace@Example.com on a list matches a payment from grace@example.com, while café@example.com and cafe@example.com remain different. The item type sets the normalization and which attributes the list can match:
item_type | Accepted values | Matches |
|---|---|---|
card_fingerprint | The 32-character hexadecimal value from PaymentMethod.fingerprint. Lowercased. Other values, including processor card fingerprints, are rejected with INVALID_REQUEST. | card_fingerprint |
card_bin | 6 to 8 digits. A BIN matches only a card with exactly that BIN, not a longer one that starts with it. | card_bin |
email | A bare address, without a display name. Lowercased. | email |
email_domain | A domain such as example.com. Lowercased, with one final dot removed and internationalized domains converted to ASCII. | email_domain |
ip_address | An IPv4 or IPv6 address, compared in canonical form. IPv4-mapped IPv6 addresses match their IPv4 form. | ip_address |
country | A two-letter ISO country code, in either case. | card_country |
customer_id | A cus_ ID. | customer_id |
string | Any text. Lowercased, with accents preserved. | Any other attribute that supports in_list, such as card_brand or currency |
case_sensitive_string | Any text, with case, accents, and Unicode composition preserved. | Same as string |
Payment intent responses don't include card fingerprints. Read one from fingerprint on a saved payment method, such as from GET /v1/payment-methods/{payment_method_id}, to add it to your own fingerprint lists. Declining a review with add_to_block_lists adds the payment's fingerprint to default_block_card_fingerprints.
Some list behavior to plan for:
- Aliases are permanent. An alias starts with a lowercase letter, then uses lowercase letters, digits, and underscores, up to 128 characters. It cannot be changed, and it stays reserved after the list is archived, so no new list in the environment can take it. Only
namecan be edited, withPATCH /v1/risk-lists/{risk_list_id}. - Remove a value with
DELETE /v1/risk-lists/{risk_list_id}/items/{risk_list_item_id}. Find its ID by value, as Find a list or a value shows. - Flint's default lists can't be renamed or archived. They show
origin: "system_default", and a rename or archive returnsACTION_NOT_ALLOWEDwith reasonmanaged_externally. You can still add and remove their values. Your own lists showorigin: "merchant". - Archive a list with
DELETE /v1/risk-lists/{risk_list_id}. While an active rule still names the alias, this returns409 RESOURCE_IN_USE, anddetails[0].blocking_resourceslists those rules asrisk_rulereferences. Change those rules, or set theminactive, first. Inactive rules don't block the archive, but each one then reports alist_archivedissue and can't be activated until it names another list. An archived list reportsstatus: archivedand appears only inGET /v1/risk-lists?status=archived.
Change a list without overwriting a teammate#
Every list has a version. It increases when the list is renamed or archived, and whenever its item_count changes: a request that adds at least one new value, or an item removal. Adding only values already on the list doesn't change it, and neither do payments that match the list. Item requests don't take expected_version, since adding is safe to repeat and a removal names one item.
To rename a list only if it hasn't changed since you read it, send its version as expected_version:
curl -X PATCH https://api.withflintpay.com/v1/risk-lists/rl_1kmn0aExample \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: list-flagged-emails-rename-v3" \
-d '{"name": "Flagged emails (chargebacks)", "expected_version": 3}'
If the list changed, the request returns 409 VERSION_CONFLICT with details[0].current_version, and the name stays as it was. Keep the name you chose, read the list again, and check whether someone else renamed it. If only its items changed, send your rename again with the new version and a new Idempotency-Key. Archiving takes the same check as a query parameter: DELETE /v1/risk-lists/rl_1kmn0aExample?expected_version=4 archives the list only while it's still at version 4, so you don't retire a list someone just added values to.
Find a list or a value#
GET /v1/risk-lists?alias=flagged_emails returns the list with that alias, so you can get its risk_list_id from the alias your rules use. Flint doesn't normalize alias: it must be a valid lowercase alias, and Flagged_Emails or flagged_emails returns 400 INVALID_REQUEST with detail code INVALID_VALUE. An archived list matches only when you also send status=archived.
GET /v1/risk-lists/{risk_list_id}/items?value=... returns the item holding a value. Flint normalizes your value with the list's item_type, exactly as it does when you add items, then matches the whole normalized value. On an email list, Grace@Example.com finds the item stored as grace@example.com; on a case_sensitive_string list, case still counts. A comma is part of the value. A value the item type rejects, such as not-an-email on an email list, returns 400 INVALID_REQUEST with detail code INVALID_VALUE and param: value. The response shows each item's value as stored, not your search input. Encode a + in the value as %2B, or let your HTTP client encode it.
Send alias and value once each. An empty or repeated filter returns 400 INVALID_REQUEST with detail code INVALID_VALUE, and a valid value that isn't on the list returns an empty data array.
To take an address off the list, find its item by value:
curl --get https://api.withflintpay.com/v1/risk-lists/rl_1kmn0aExample/items \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "value=Grace@Example.com"
{
"data": [
{
"risk_list_item_id": "rli_2kmn0aExample",
"risk_list_id": "rl_1kmn0aExample",
"value": "grace@example.com",
"created_by": {"resource_type": "api_key", "resource_id": "key_1kmn0aExample"},
"created_at": "2026-09-20T09:12:44Z"
}
]
}
Then delete that item by its ID:
curl -X DELETE https://api.withflintpay.com/v1/risk-lists/rl_1kmn0aExample/items/rli_2kmn0aExample \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: list-flagged-emails-remove-grace-001"
The delete returns 200 with the removed item. Payment attempts that start afterward no longer match the value.
Change or turn off a rule#
PATCH /v1/risk-rules/{risk_rule_id} takes any of action, predicate, description, and status. Flint validates the rule as a whole and increases its version. To avoid overwriting a teammate's edit, send the version you last read as expected_version. If the rule changed since, the request fails with 409 VERSION_CONFLICT and details[0].current_version carries its current version. An archived rule fails with 409 ACTION_NOT_ALLOWED, reason archived, and current_status archived.
To turn a rule off, set its status to inactive:
curl -X PATCH https://api.withflintpay.com/v1/risk-rules/rule_1kmn0aExample \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: rule-large-guest-review-inactive-001" \
-d '{"status": "inactive", "expected_version": 1}'
Send {"status": "active"} to run it again. The rule keeps its ID, predicate, and history either way.
If an edit moves the rule to the other check, for example by adding risk_level to its predicate, the response includes a rule_evaluation_stage_changed warning in meta.warnings. Read previous_stage and stage on the warning for the old and new stage. The warning identifies the rule with resource_type: "risk_rule" and resource_id. Previews of an existing rule return the same warning fields in data.warnings when the proposed edit changes its stage.
Rule status#
- active moves to inactive on PATCH status inactive
- inactive moves to active on PATCH status active
- active moves to archived on DELETE
- inactive moves to archived on DELETE
status on risk rulestatusacceptsactiveorinactiveon writes. Only a delete archives a rule. Flint's default rules can't be archived; set theminactiveinstead.- Turning a rule on checks it again. Flint validates the predicate against the current registry, checks every list it names, and counts active rules. Turning a rule off always works, even when the rule has issues.
- An environment can have 100 active rules, counting Flint's defaults. Creating an active rule or activating an inactive one past that returns
409 LIMIT_REACHEDwith reasonenabled_risk_rules;details[0].limitcarries the limit. Inactive and archived rules don't count. GET /v1/risk-rulesreturns active and inactive rules by default, newest first. Filter withstatus, for example?status=activefor only the rules that can run, or?status=inactive,archived. Archived rules appear only whenstatusincludesarchived. The order has no effect on which rule decides a payment.
Fix a rule that stopped running#
Every rule response includes issues, the problems that stop Flint from evaluating the rule right now. Flint works them out on each read and write, against the current attribute registry and your current lists, so a rule that was valid when you saved it can gain issues later. For example, a rule that reads risk_score reports attribute_unavailable if risk scoring is no longer enabled in the environment, and an inactive rule reports list_archived after you archive a list it names. Archived rules always return an empty issues array.
An active rule with issues is skipped on every payment, so it protects nothing until you fix it. An inactive rule with issues can't be activated. To find rules that need attention, list them and check each issues array:
curl "https://api.withflintpay.com/v1/risk-rules?status=active,inactive&page_size=100" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"data": [
{
"risk_rule_id": "rule_2kmn0aExample",
"action": "block",
"predicate": {
"all": [
{"attribute": "payment_method_type", "operator": "eq", "value": "card"},
{"attribute": "email", "operator": "in_list", "list_alias": "flagged_emails"}
]
},
"description": "Block flagged emails",
"status": "inactive",
"version": 3,
"issues": [
{
"code": "list_archived",
"message": "risk list alias \"flagged_emails\" is archived",
"path": "predicate.all[1].list_alias"
}
]
}
]
}
Each issue uses the same code, message, and path as a preview, and path points at the part of the rule to change. To fix the rule:
- Change the part
pathnames. For a list issue, pointlist_aliasat an active list with a matching item type. An archived list can't be restored, and its alias stays reserved, so create a new list with a new alias if you need one. Forattribute_unavailable, remove the attribute or wait until it is available. - Check the edit without saving it:
POST /v1/risk-previewswithmodeinline, the rule'srisk_rule_id, its currentaction, and the newpredicatereturnsis_valid: truewhen the rule can run. - Save it with
PATCH /v1/risk-rules/{risk_rule_id}, sending the newpredicateand theexpected_versionyou read. Add"status": "active"to turn it on in the same request. The response'sissuesarray is empty once the rule can run.
If you would rather stop the rule than fix it now, set it inactive or delete it. Neither option checks the payments the rule was written to catch, so make sure another rule covers them.
Resolve reviews#
A review opens when a review rule decides a payment and the bank approves it. What the review controls depends on whether the payment was already captured:
Manual capture
The review holds the capture
The payment is authorized and waiting for capture. Capture returns PAYMENT_REVIEW_OPEN until the review is approved. Approving does not capture: call capture afterward. Declining cancels the authorization. If nobody resolves the review, Flint cancels the authorization about 5 minutes before authorization_expires_at and closes the review as expired.
Automatic capture
The payment already succeeded
The buyer saw a successful payment, and the order is paid. Approving closes the review. Declining refunds the part of the payment that has not been refunded yet, with reason fraudulent. If nobody resolves the review within 14 days, it closes as expired and the payment stands.
To hold funds until someone decides, create the payments your review rules are likely to match with capture_method: "manual". Manual capture covers authorizing now and capturing later.
Find open reviews#
Handle payment_review.opened, or list the queue:
curl "https://api.withflintpay.com/v1/payment-reviews?status=open" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"data": [
{
"payment_review_id": "rev_1kmn0aExample",
"status": "open",
"pending_action": null,
"resolution_started_at": null,
"resolution_started_by": null,
"opened_reason": "rule",
"matched_risk_rule_id": "rule_1kmn0aExample",
"payment_intent_id": "pi_1kmn0aExample",
"order_id": "ord_1kmn0aExample",
"customer_id": null,
"payment_flow": "checkout",
"risk": {"level": "normal"},
"ip_address": "203.0.113.24",
"payment_summary": {
"amount_money": {"amount": 64900, "currency": "USD"},
"capture_method": "manual",
"authorization_expires_at": "2026-10-01T16:10:41Z",
"payment_method_brand": "visa",
"last4": "4242",
"email": "buyer@example.com"
},
"refund_id": null,
"refunded_money": null,
"opened_at": "2026-09-24T16:10:42Z",
"closed_at": null,
"closed_by": null,
"closed_reason": null,
"updated_at": "2026-09-24T16:10:42Z",
"last_resolution_failure": null
}
]
}
risk.level and risk.score come from the card processor's fraud screening; Read the risk result on a payment explains both. risk.score is left out when no score is available, which is not the same as 0. last_resolution_failure is null until a decline's refund fails. resolution_started_by and closed_by are null until someone acts. Who acted says what they hold.
Filter with status, risk_level, payment_flow, payment_intent_id, order_id, customer_id, opened_after, and opened_before. The RFC 3339 bounds filter opened_at, including the lower instant and excluding the upper instant. Reviews list newest first. GET /v1/payment-reviews/{payment_review_id} can also expand payment_intent, order, and customer.
Approve#
curl -X POST https://api.withflintpay.com/v1/payment-reviews/rev_1kmn0aExample/approve \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: review-approve-001"
The response is the review with status: "closed" and closed_reason: "approved". For a manual-capture payment, capture it next, before authorization_expires_at. Approving a review that is already approved returns it unchanged.
Decline#
curl -X POST https://api.withflintpay.com/v1/payment-reviews/rev_1kmn0aExample/decline \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: review-decline-001" \
-d '{"add_to_block_lists": true}'
Declining cancels an uncaptured authorization, or refunds a captured payment. The refund goes to the original payment method with reason fraudulent and covers what was captured minus earlier refunds. The request has no amount. Either way the review closes as declined; refund_id and refunded_money are set when Flint refunded and null when it only canceled. If earlier refunds already returned the full amount, nothing is left to refund and the review closes as refunded. The status code tells you where the decline stands:
| Response | Review | What it means |
|---|---|---|
200 | closed | The cancellation or refund finished within the request. |
202 Accepted | resolving, with pending_action: "decline" | The cancellation or refund is still running, usually because a refund is processing. |
200 | open, with last_resolution_failure set | The refund had already failed. Nothing was declined. |
A 202 has no Retry-After header, because Flint can't tell how long a refund takes to settle. Wait for payment_review.closed or payment_review.reopened, or read the review with GET /v1/payment-reviews/{payment_review_id} on a growing delay, such as 2, 4, 8, and then 30 seconds, until status is no longer resolving. Declining a review that is already declining returns the same 202.
{
"data": {
"payment_review_id": "rev_1kmn0aExample",
"status": "resolving",
"pending_action": "decline",
"resolution_started_at": "2026-09-24T16:20:05Z",
"closed_reason": null,
"refund_id": null,
"last_resolution_failure": null
}
}
If the refund fails#
The review goes back to open, refund_id is cleared, and last_resolution_failure names the refund that failed. Flint sends payment_review.reopened with the review. The same state can be the response to the decline itself, as a 200, when the refund had already failed by then.
{
"data": {
"payment_review_id": "rev_1kmn0aExample",
"status": "open",
"pending_action": null,
"resolution_started_at": null,
"closed_reason": null,
"refund_id": null,
"refunded_money": null,
"updated_at": "2026-09-24T16:20:09Z",
"last_resolution_failure": {
"refund_id": "ref_1kmn0aExample",
"failed_at": "2026-09-24T16:20:09Z"
}
}
}
Read the refund with GET /v1/refunds/{refund_id} to see why it failed. Then decline again with a new Idempotency-Key, which starts a new refund, or handle the refund yourself. Repeating the same Idempotency-Key replays the stored response and doesn't start another refund. last_resolution_failure stays on the review after a later decision closes it. refund_id is set only once a refund has closed the review.
add_to_block_lists defaults to false. When true, Flint adds the payment's card fingerprint, email, and IP address to the default block lists, so the same card, email, or address is blocked from the next attempt on. Values the payment did not have are skipped. Attempts made before risk controls used PaymentMethod.fingerprint have no card fingerprint to add, so declining their reviews adds only the email and IP address.
Review statuses#
- open moves to closed on approve, or payment event
- open moves to resolving on decline
- resolving moves to closed on cancel or refund done
- resolving moves to open on refund failed
- open moves to resolving on expiry
- resolving moves to closed on expired
status on payment reviewclosed_reason records how a review closed. A review also closes without your action when something else settles the payment:
| Reason | What happened |
|---|---|
approved | You approved it. |
declined | You declined the payment. Flint canceled the authorization, or refunded it when refund_id is set. refunded_money describes that refund. A decline always closes as declined, never as a separate refunded reason. |
refunded | The payment was refunded in full outside the review, or you declined a payment that was already fully refunded. |
payment_canceled | The payment was canceled outside the review. |
disputed | The buyer's bank opened a dispute on the payment. |
expired | Nobody decided in time. On a manual-capture payment, Flint canceled the authorization once it reached its expiry. On an automatic-capture payment, the review stayed open for 14 days and the payment stands. |
Who acted#
closed_by and resolution_started_by are null, or a reference to the credential that made the request, in the same resource_type and resource_id form as other resource references:
| Request made with | Reference |
|---|---|
| An API key | api_key and the key's key_ ID. This is the key itself, not the person who created it. |
| The Dashboard, or the Flint CLI | user and the signed-in person's usr_ ID. |
| A partner app's token | partner_app_install and the install's pinst_ ID. |
Both are null when Flint acted without a request: closed_by for a review closed by expiry, a cancellation, a full refund, or a dispute, and resolution_started_by for an expiry. closed_by on a closed review is the credential that approved or declined it. A review approved with an API key reports it like this, with the other fields unchanged:
{
"data": {
"payment_review_id": "rev_1kmn0aExample",
"status": "closed",
"closed_reason": "approved",
"closed_at": "2026-09-24T16:31:20Z",
"closed_by": {"resource_type": "api_key", "resource_id": "key_1kmn0aExample"}
}
}
While a review is resolving, approving or declining it returns 409 ACTION_NOT_ALLOWED with reason in_progress, unless the request repeats the decline already in flight. That includes a review that is expiring. Read the review to see pending_action and resolution_started_at. Once it closes, the next request returns 409 ACTION_NOT_ALLOWED with reason terminal_status and current_status closed; read the review for its closed_reason, because the error doesn't carry it. In both cases details[0].resource_type is payment_review.
An expiring review looks like this, with the other fields unchanged from the open review:
{
"data": {
"payment_review_id": "rev_1kmn0aExample",
"status": "resolving",
"pending_action": "expire",
"resolution_started_at": "2026-10-01T16:05:41Z",
"resolution_started_by": null,
"closed_at": null,
"closed_reason": null
}
}
If a capture, cancellation, refund, or payment update is already running on the payment, approve and decline return 409 OPERATION_IN_PROGRESS. details[0].blocking_resources names the payment intent. Nothing was started, so send the same request again once that operation finishes.
Respond to fraud warnings#
A fraud warning is the card issuer reporting that a payment was fraudulent, typically because the cardholder said they did not make it. It is separate from Flint's own risk decision: it can arrive days later, on any card payment, including one you approved in review. A dispute often follows.
GET /v1/fraud-warnings accepts created_after and created_before to filter when Flint created the warning, independently of the issuer's reported_at. Send RFC 3339 timestamps; the lower bound is inclusive and the upper bound is exclusive.
List the warnings you can still act on:
curl "https://api.withflintpay.com/v1/fraud-warnings?is_actionable=true" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"data": [
{
"fraud_warning_id": "frw_01KX0R9R00Q6E3W6TZDAHTF8K2",
"payment_intent_id": "pi_1kmn0aExample",
"fraud_type": "unauthorized_use_of_card",
"is_actionable": true,
"dispute_id": null,
"payment_summary": {
"amount_money": {"amount": 12900, "currency": "USD"},
"payment_method_brand": "visa",
"last4": "4242",
"email": "buyer@example.com"
},
"reported_at": "2026-09-24T08:31:07Z",
"created_at": "2026-09-24T08:31:09Z"
}
]
}
A warning has is_actionable: true until the payment is refunded in full, a dispute opens on it, or the card network marks it resolved. After that it stays unactionable. A partial refund does not change it. When a dispute opens, dispute_id links it.
For an actionable warning, stop fulfillment if the order has not shipped, then decide whether to refund. To refund the full payment, send refund_type: "full" and its payment_intent_id with reason fraudulent:
curl -X POST https://api.withflintpay.com/v1/refunds \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: refund-fw-1kmn0a" \
-d '{
"refund_type": "full",
"payment_intent_id": "pi_1kmn0aExample",
"reason": "fraudulent"
}'
A full refund makes the warning unactionable and sends fraud_warning.updated. Read the payment first so you do not refund money another process already refunded. Refunds covers the request, and Handle disputes covers what happens if the dispute arrives anyway.
Read the risk result on a payment#
Every checked card payment intent has a risk object once Flint finishes checking it. It is null while the payment waits for 3D Secure or for a bank payment to settle, and for payment methods Flint does not check.
| Field | Meaning |
|---|---|
level | What the card processor's fraud screening found. See the levels below. |
score | The screening's fraud score, from 0 to 99. Higher means riskier. Present only where risk scoring is available, and omitted otherwise, which is not the same as 0. |
outcome | authorized, manual_review, blocked, issuer_declined, or invalid. |
outcome_reason | Why, when there is a reason: risk_rule for one of your rules or Flint's defaults, risk_policy for the card processor's screening, or highest_risk, elevated_risk, or low_authorization_probability. |
matched_risk_rule_id | The rule that decided the result. |
payment_review_id | The review opened for this payment. |
statement | A sentence describing the result, for your staff. |
evaluated_at | When the check finished. |
level is one of these. The same values appear on a payment review's risk.level, in the risk_level rule attribute, and in the risk_level filter on reviews:
level | Meaning |
|---|---|
normal | The screening found nothing unusual. |
elevated | The screening found signs of higher fraud risk. |
highest | The screening found strong signs of fraud. |
not_assessed | There is no screening result, for example because Flint blocked the payment before authorization or the payment method isn't screened. |
A blocked payment returns to requires_payment_method with last_payment_error.code set to payment_blocked. The card processor's own fraud screening can block a payment too, and that looks the same to the buyer and to your code. Tell the buyer the payment did not go through and offer another payment method. Do not tell them a fraud rule matched.
Webhooks#
Payloads are snapshots from when the event fired. Read the review or warning again before acting on it, and deduplicate deliveries by webhook_event_id. A review moving to resolving sends no event. The data.object of every payment_review.* and fraud_warning.* event has the same shape as the matching GET response. Partner apps need the risk.read scope to receive these events.
Test your rules#
In a sandbox, scope a test rule to a metadata key so it affects only the payments you tag:
curl -X POST https://api.withflintpay.com/v1/risk-rules \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_SANDBOX_KEY" \
-H "Idempotency-Key: rule-test-block-001" \
-d '{
"action": "block",
"description": "Test: block payments tagged risk_test=block",
"predicate": {"attribute": "payment_intent_metadata.risk_test", "operator": "eq", "value": "block"}
}'
Create an order with "tax": {"enabled": false}, add a card leg with "metadata": {"risk_test": "block"}, then confirm the leg with the test token pm_card_visa:
curl -X POST https://api.withflintpay.com/v1/orders/ord_1kmn0aExample/payment-intents \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_SANDBOX_KEY" \
-H "Idempotency-Key: risk-test-leg-001" \
-d '{
"amount_money": {"amount": 2500, "currency": "USD"},
"payment_options": ["card"],
"metadata": {"risk_test": "block"}
}'
curl -X POST https://api.withflintpay.com/v1/orders/ord_1kmn0aExample/pay \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_SANDBOX_KEY" \
-H "Idempotency-Key: risk-test-pay-001" \
-d '{
"action": "confirm_payment_intents",
"payment_intents": [{
"credential_type": "token",
"payment_intent_id": "pi_1kmn0aExample",
"token": "pm_card_visa"
}],
"expected_outstanding_money": {"amount": 2500, "currency": "USD"}
}'
The pay request returns 200 with order_payment_attempt.status of failed. The payment intent is back at requires_payment_method, with last_payment_error.code of payment_blocked and risk.matched_risk_rule_id naming your rule. If risk is null, no rule ran and something else blocked the payment. Change the action to review to open a review instead: with "capture_method": "manual" on the leg, capture returns PAYMENT_REVIEW_OPEN until you approve. Delete test rules when you finish, or set them inactive, so they don't pile up toward the limit of 100 active rules.
These Stripe test cards exercise Flint's default controls in checkout:
| Card number | Result |
|---|---|
4000 0000 0000 9235 | Elevated risk. The default review rule opens a review, except on invoice and subscription renewal payments. |
4100 0000 0000 0019 | Highest risk, blocked by the card processor's screening. The attempt fails with payment_blocked. |
4000 0000 0000 5423 | The payment succeeds, then a fraud warning arrives. |
Testing covers sandbox setup and the other test cards.
Access#
API keys need these scopes. risk.controls.write and risk.reviews.write each include risk.read.
Every POST, PATCH, and DELETE on rules, lists, and reviews accepts an Idempotency-Key. Send one so a retried request does not create a second rule or resolve a review twice. See Idempotency.
Errors#
Validation errors#
Rule and list requests return 400 INVALID_REQUEST with type: "validation_error" and a param that points at the problem, such as predicate.all[0].attribute for a predicate or values[2] for a list item. The detail code is UNKNOWN_FIELD for a node field the rule doesn't accept, NOT_ALLOWED for an unavailable attribute, an action that is unavailable at the rule's stage, or a list whose item type doesn't fit the attribute, and INVALID_VALUE for everything else, including an empty or over-long description, an invalid list alias or item type, a value that doesn't fit the list's item type, and a values array that is empty or has more than 500 entries.
A preview returns typed issue codes in issues with a 200, and each issue's path points at the problem. Saved rules use the same codes in their own issues array. Use a preview to see which check failed. Accept codes you don't recognize, because Flint can add more:
| Issue code | Cause |
|---|---|
unknown_attribute | The attribute is not in the registry. |
attribute_unavailable | The attribute exists but is not available in this environment. |
invalid_operator | The operator is not supported for the attribute. |
invalid_operand | The value has the wrong type, is not one of the attribute's enum values, is a risk_score outside 0 to 99, or values is empty or longer than 100. |
invalid_money | amount_money needs an integer amount and an uppercase currency, and nothing else. |
invalid_list_alias | list_alias is not a valid alias. |
unknown_predicate_field | A node has a field it does not accept. |
invalid_predicate_node, invalid_predicate_group | A node is not a valid comparison or group, or a group has no children or more than 50. |
invalid_rule_action | action is not allow, block, review, or require_3ds. |
rule_action_unavailable_at_stage | A block or require_3ds rule reads risk_level or risk_score. |
invalid_predicate | The predicate is invalid JSON, exceeds 100 nodes, or nests more than 10 levels. |
list_not_found | The list alias does not exist in this environment. |
list_archived | The list is archived. |
list_type_mismatch | The list's item type does not support the attribute. |
Preview paths use public field names: predicate for the root, predicate.all[0].attribute for a nested field, and action for the rule action. Previews check the same list references as creating or activating a rule. Proposing a new action or predicate for a system rule returns 409 ACTION_NOT_ALLOWED with reason managed_externally. A preview without risk_rule_id at the active-rule limit returns a risk_rule_limit_reached warning; creating the rule active fails until another rule is inactive or deleted.
Creating or activating a rule that references an archived list returns 409 ACTION_NOT_ALLOWED, with reason and current_status set to archived, the list's ID, and param set to the alias field path. A missing alias returns 404 RESOURCE_NOT_FOUND with details[0].resource_type risk_list and param set to that path. The alias is not an ID, so resource_id is omitted. An inactive rule saves with those list problems and reports them in issues instead, as Fix a rule that stopped running shows. Typed issue codes appear in previews and in rule issues, never in write errors. For rule writes, branch on INVALID_REQUEST and read details[].param and details[].code.
Error handling covers the error envelope.
Common mistakes#
- Expecting a review to hold an automatic-capture payment. The payment has already succeeded, so fulfillment that runs on
payment_intent.succeededororder.paidships before anyone reviews it. Use manual capture, or wait forpayment_review.closedbefore shipping. - Treating approval as capture. Approving a manual-capture review only allows the capture. Call capture yourself before the authorization expires.
- Writing
neqand expecting it to match missing values. A payment without the attribute never matches. Addis_missing. - Adding an
allowrule and expecting it to skip 3D Secure.require_3dsrules still apply. - Leaving a review rule open to ACH debits. A match fails the bank payment. Limit it with
payment_method_typeeqcard.
Next steps#
- Manual capture: hold funds while a review is open.
- Handle disputes: what to do when a fraud warning becomes a dispute.
- Testing: sandbox setup and test cards.
- Webhooks: verify and process
payment_review.*andfraud_warning.*events. - Risk Controls API reference: every field on every route.
