Skip to content

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.

Where risk rules run in a card paymentResponse
Your appFlintCard processorconfirm the payment intent, or pay the orderpre-authorization rules: allow, block, or require 3D Secureauthorization request, with 3D Secure when a rule requires itapproved or declined, plus the risk level from its fraud screeningpost-authorization rules: allow or reviewthe payment result, then payment_review.opened if a review rule matched
  1. Your app sends confirm the payment intent, or pay the order to Flint
  2. Flint sends pre-authorization rules: allow, block, or require 3D Secure to Flint
  3. Flint sends authorization request, with 3D Secure when a rule requires it to Card processor
  4. Card processor returns approved or declined, plus the risk level from its fraud screening to Flint
  5. Flint sends post-authorization rules: allow or review to Flint
  6. 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:

ActionAttributes it can readWhat happens when it decides
allowAnyYour 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.
blockPre-authorization onlyThe attempt fails with payment_blocked before authorization. The buyer sees a generic decline and can try another payment method.
require_3dsPre-authorization onlyThe bank must authenticate the buyer with 3D Secure. Skipped for off-session payments.
reviewAnyThe 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:

  1. Every matching require_3ds rule adds a 3D Secure requirement. It never changes the allow, block, or review decision, and an allow does not remove it.
  2. Before authorization, a matching allow rule wins. The attempt is allowed, and post-authorization rules do not run.
  3. Otherwise a matching block rule blocks the attempt.
  4. Otherwise a matching review rule marks the attempt for review.
  5. After authorization, if nothing was allowed or blocked, a matching post-authorization allow rule clears any pending review. Otherwise a matching review rule, 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#

PaymentWhat applies
Card, Apple Pay, Google PayEvery action.
ACH debitallow 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.
AffirmNot checked.
Off-session payments: subscription payments and automatic invoice chargesEvery action except require_3ds, which is skipped because no buyer is present to authenticate.
Virtual terminalA 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 descriptionActionMatches
Block payments matching Flint default block listsblockThe 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 flowsreviewrisk_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.

  1. Read the attribute registry#

    The registry lists every attribute your environment can use, with its type, operators, and when it becomes available:

    cURL
    curl https://api.withflintpay.com/v1/risk-rules/attributes \
      -H "Authorization: Bearer YOUR_API_KEY"
    
    Response
    {
      "data": {
        "attributes": [
          {
            "name": "amount_money",
            "value_type": "money",
            "operators": ["eq", "neq", "gt", "gte", "lt", "lte"],
            "is_nullable": false,
            "missing_value_behavior": "not_applicable_except_is_missing",
            "available_from": "pre_authorization",
            "is_available": true
          },
          {
            "name": "risk_score",
            "value_type": "integer",
            "operators": ["eq", "neq", "gt", "gte", "lt", "lte", "in", "is_missing"],
            "is_nullable": true,
            "missing_value_behavior": "not_applicable_except_is_missing",
            "available_from": "post_authorization",
            "is_available": false,
            "unavailable_reason": "risk_scoring_not_enabled"
          }
        ]
      }
    }
    

    Each entry is a RiskAttribute. is_nullable says whether a payment can be missing the value, available_from is the first check that knows it, and operators lists the comparisons it accepts. unavailable_reason appears only when is_available is false: risk_scoring_not_enabled or ip_geolocation_not_enabled.

    A rule can only use attributes with is_available: true. Using an unavailable one is rejected with 400 INVALID_REQUEST and detail code NOT_ALLOWED. A preview reports it as attribute_unavailable. Attributes describes each one.

  2. Write the predicate#

    A predicate is a comparison, or a group of predicates:

    JSON
    {
      "all": [
        {"attribute": "amount_money", "operator": "gte", "amount_money": {"amount": 50000, "currency": "USD"}},
        {"attribute": "is_guest", "operator": "eq", "value": true},
        {"attribute": "payment_method_type", "operator": "eq", "value": "card"}
      ]
    }
    

    A comparison names an attribute, an operator, and the operand that operator takes, here amount_money or value. Groups combine predicates: all matches when every child matches, any when at least one does, and not inverts one child. Predicate grammar lists every operator and limit.

    Keep these rules in mind when writing comparisons:

    • A missing value never matches. When a payment has no value for an attribute, every comparison on it is skipped, including neq and a not around it. {"attribute": "card_country", "operator": "neq", "value": "US"} does not match an ACH debit, which has no card. To match missing values too, pair the comparison with is_missing, as in the example after this list.
    • Amounts compare in one currency. amount_money takes an integer in the currency's smallest unit and an uppercase currency code. A USD threshold never matches a CAD payment, in either direction. Write one comparison per currency you accept.
    • Literals are exact. Flint lowercases email and email_domain before comparing, so write those literals in lowercase. Countries and currencies are uppercase ISO codes, such as "US" and "USD". Booleans are JSON true and false, not strings.

    This predicate matches cards issued outside the US, and payments with no card country:

    JSON
    {
      "any": [
        {"attribute": "card_country", "operator": "neq", "value": "US"},
        {"attribute": "card_country", "operator": "is_missing"}
      ]
    }
    
  3. Validate it#

    POST /v1/risk-previews checks a predicate and action without saving anything:

    cURL
    curl -X POST https://api.withflintpay.com/v1/risk-previews \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d '{
        "mode": "inline",
        "action": "review",
        "predicate": {
          "all": [
            {"attribute": "amount_money", "operator": "gte", "amount_money": {"amount": 50000, "currency": "USD"}},
            {"attribute": "is_guest", "operator": "eq", "value": true},
            {"attribute": "payment_method_type", "operator": "eq", "value": "card"}
          ]
        }
      }'
    
    Response
    {
      "data": {
        "is_valid": true,
        "issues": [],
        "analysis": {
          "stage": "pre_authorization",
          "attributes_used": ["amount_money", "is_guest", "payment_method_type"],
          "list_aliases_used": [],
          "applicability": "all_payments"
        },
        "warnings": []
      }
    }
    

    stage is the check the rule runs in. list_aliases_used names the lists the predicate reads. applicability is on_session_only for require_3ds rules and all_payments for the rest.

    A rule with problems still returns 200, with is_valid: false, analysis: null, and every problem in issues. Each issue is a RiskRuleIssue: the public field path of the problem, such as predicate.all[1].operator, plus a code and a message. An attribute_unavailable issue also includes unavailable_reason, such as risk_scoring_not_enabled; message describes the problem in readable text. Saved rules report the same objects in their own issues array. Validation errors lists the codes. A malformed request returns 400, such as mode inline without both action and predicate, or mode stored_rule with either of them.

    A preview checks the lists a predicate names the same way activating a rule does: a missing, archived, or mismatched list comes back as a list_not_found, list_archived, or list_type_mismatch issue. To check an edit to a saved rule, send mode inline with its risk_rule_id and the rule's full action and predicate as they'd be after the edit. To check the saved rule as it is, send mode stored_rule and its risk_rule_id alone.

  4. Create the rule#

    Send the same action and predicate with a description of 1 to 512 characters. A new rule is active unless you send "status": "inactive", which saves it without running it.

    cURL
    curl -X POST https://api.withflintpay.com/v1/risk-rules \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Idempotency-Key: rule-large-guest-review-001" \
      -d '{
        "action": "review",
        "description": "Review guest card payments of $500 or more",
        "predicate": {
          "all": [
            {"attribute": "amount_money", "operator": "gte", "amount_money": {"amount": 50000, "currency": "USD"}},
            {"attribute": "is_guest", "operator": "eq", "value": true},
            {"attribute": "payment_method_type", "operator": "eq", "value": "card"}
          ]
        }
      }'
    
    Response
    {
      "data": {
        "risk_rule_id": "rule_1kmn0aExample",
        "action": "review",
        "predicate": {
          "all": [
            {"attribute": "amount_money", "operator": "gte", "amount_money": {"amount": 50000, "currency": "USD"}},
            {"attribute": "is_guest", "operator": "eq", "value": true},
            {"attribute": "payment_method_type", "operator": "eq", "value": "card"}
          ]
        },
        "attributes_used": ["amount_money", "is_guest", "payment_method_type"],
        "stage": "pre_authorization",
        "applicability": "all_payments",
        "origin": "merchant",
        "version": 1,
        "description": "Review guest card payments of $500 or more",
        "created_by": {"resource_type": "api_key", "resource_id": "key_1kmn0aExample"},
        "issues": [],
        "created_at": "2026-09-24T16:02:11Z",
        "updated_at": "2026-09-24T16:02:11Z",
        "status": "active",
        "archived_at": null
      }
    }
    

    The rule applies from the next payment attempt. issues is empty, so Flint can run it. created_by is the credential that made the request, in the same form as Who acted describes for reviews: an api_key, a user for the Dashboard or the Flint CLI, or a partner_app_install. It can name an API key from the other mode. It is null on Flint's default rules and lists. List items carry the same created_by.

    Creating or activating a rule that names a list fails with 404 RESOURCE_NOT_FOUND and details[0].resource_type risk_list if the alias does not exist, 409 ACTION_NOT_ALLOWED with the list's ID and reason archived if it was archived, or 400 INVALID_REQUEST with detail code NOT_ALLOWED if the list's item type does not fit the attribute. Each error names the alias field in param; a missing alias has no resource_id.

    An inactive rule skips that list check. Creating one with "status": "inactive" succeeds even when a list it names is missing, archived, or the wrong type, and its issues array reports the problem. Flint refuses to make it active until the predicate names a usable list. The rest of the predicate is validated either way: an unknown attribute or a malformed node fails the request whatever the status.

  5. See it match#

    When the rule decides a payment, the payment intent shows it:

    JSON
    {
      "data": {
        "payment_intent_id": "pi_1kmn0aExample",
        "status": "succeeded",
        "risk": {
          "level": "normal",
          "outcome": "manual_review",
          "outcome_reason": "risk_rule",
          "matched_risk_rule_id": "rule_1kmn0aExample",
          "payment_review_id": "rev_1kmn0aExample",
          "evaluated_at": "2026-09-24T16:10:42Z"
        }
      }
    }
    

    outcome is manual_review because a review opened, and your webhook endpoint receives payment_review.opened for rev_1kmn0aExample. Test your rules shows how to trigger a rule in a sandbox without affecting other test payments.

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.

OperatorOperandMatches when
eq, neqvalueThe attribute equals, or does not equal, one literal.
gt, gte, lt, ltevalueThe attribute is greater or less than the operand. Only amount_money and risk_score support ordering.
invalues, 1 to 100 literalsThe attribute equals any of them.
in_listlist_aliasThe attribute's value is on the list.
is_missingNoneThe 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.

AttributeTypeValue
amount_moneymoneyThe payment amount and currency.
currencycurrencyThe payment currency, such as USD.
card_brandenumamex, discover, diners, jcb, mastercard, unionpay, visa, or unknown.
card_fundingenumcredit, debit, prepaid, or unknown.
card_countrycountryThe country that issued the card.
card_binstringThe card's first 6 to 8 digits.
card_fingerprintstringThe 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.
emailemailThe receipt email, or the billing email when there is no receipt email.
email_domainstringThe part of email after the @.
ip_addressip_addressThe buyer's IP address.
ip_countrycountryListed in the registry but not available yet.
customer_idstringThe Flint customer the payment belongs to.
is_guestbooleantrue when no customer is attached.
payment_method_typeenumcard for cards, Apple Pay, and Google Pay.
digital_walletenumapple_pay or google_pay. Missing for a card entered by hand.
is_saved_payment_methodbooleantrue when the payment uses a saved card.
is_off_sessionbooleantrue for payments made without the buyer present.
payment_flowenumWhere the payment came from: checkout, payment_link, invoice, subscription_initial, subscription_renewal, virtual_terminal, or api.
risk_levelenumPost-authorization. The card processor's rating, with these meanings: normal, elevated, highest, or not_assessed.
risk_scoreintegerPost-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
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
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"]}'
Response
{
  "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:

JSON
{"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_typeAccepted valuesMatches
card_fingerprintThe 32-character hexadecimal value from PaymentMethod.fingerprint. Lowercased. Other values, including processor card fingerprints, are rejected with INVALID_REQUEST.card_fingerprint
card_bin6 to 8 digits. A BIN matches only a card with exactly that BIN, not a longer one that starts with it.card_bin
emailA bare address, without a display name. Lowercased.email
email_domainA domain such as example.com. Lowercased, with one final dot removed and internationalized domains converted to ASCII.email_domain
ip_addressAn IPv4 or IPv6 address, compared in canonical form. IPv4-mapped IPv6 addresses match their IPv4 form.ip_address
countryA two-letter ISO country code, in either case.card_country
customer_idA cus_ ID.customer_id
stringAny text. Lowercased, with accents preserved.Any other attribute that supports in_list, such as card_brand or currency
case_sensitive_stringAny 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 name can be edited, with PATCH /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 returns ACTION_NOT_ALLOWED with reason managed_externally. You can still add and remove their values. Your own lists show origin: "merchant".
  • Archive a list with DELETE /v1/risk-lists/{risk_list_id}. While an active rule still names the alias, this returns 409 RESOURCE_IN_USE, and details[0].blocking_resources lists those rules as risk_rule references. Change those rules, or set them inactive, first. Inactive rules don't block the archive, but each one then reports a list_archived issue and can't be activated until it names another list. An archived list reports status: archived and appears only in GET /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
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
curl --get https://api.withflintpay.com/v1/risk-lists/rl_1kmn0aExample/items \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "value=Grace@Example.com"
Response
{
  "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
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
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#

Risk rule status lifecycleFinal
  • 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 rule
Final values do not change again
  • active
    Runs on every payment attempt, unless its issues array is not empty. New rules start here unless you send status: inactive.
  • inactive
    Saved but not running. Set status to active to run it again. Doesn't count toward the active-rule limit.
  • archivedFinal
    Deleted with DELETE /v1/risk-rules/{risk_rule_id}. It never runs again, can't be changed or restored, and is still readable by ID. archived_at records when.
  • status accepts active or inactive on writes. Only a delete archives a rule. Flint's default rules can't be archived; set them inactive instead.
  • 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_REACHED with reason enabled_risk_rules; details[0].limit carries the limit. Inactive and archived rules don't count.
  • GET /v1/risk-rules returns active and inactive rules by default, newest first. Filter with status, for example ?status=active for only the rules that can run, or ?status=inactive,archived. Archived rules appear only when status includes archived. 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
curl "https://api.withflintpay.com/v1/risk-rules?status=active,inactive&page_size=100" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "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:

  1. Change the part path names. For a list issue, point list_alias at 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. For attribute_unavailable, remove the attribute or wait until it is available.
  2. Check the edit without saving it: POST /v1/risk-previews with mode inline, the rule's risk_rule_id, its current action, and the new predicate returns is_valid: true when the rule can run.
  3. Save it with PATCH /v1/risk-rules/{risk_rule_id}, sending the new predicate and the expected_version you read. Add "status": "active" to turn it on in the same request. The response's issues array 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
curl "https://api.withflintpay.com/v1/payment-reviews?status=open" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "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
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
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:

ResponseReviewWhat it means
200closedThe cancellation or refund finished within the request.
202 Acceptedresolving, with pending_action: "decline"The cancellation or refund is still running, usually because a refund is processing.
200open, with last_resolution_failure setThe 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.

Response
{
  "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.

JSON
{
  "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#

Review status lifecycleFinal
  • 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 review
Final values do not change again
  • open
    Waiting for a decision. Approve or decline it.
  • resolving
    A decision is being carried out, and the review can't take another. pending_action is decline while a decline cancels or refunds the payment, and expire while Flint cancels an authorization nobody resolved in time. Wait for payment_review.closed. After a failed refund, wait for payment_review.reopened instead.
  • closedFinal
    Resolved. closed_reason says how, and closed_by says who.

closed_reason records how a review closed. A review also closes without your action when something else settles the payment:

ReasonWhat happened
approvedYou approved it.
declinedYou 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.
refundedThe payment was refunded in full outside the review, or you declined a payment that was already fully refunded.
payment_canceledThe payment was canceled outside the review.
disputedThe buyer's bank opened a dispute on the payment.
expiredNobody 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 withReference
An API keyapi_key and the key's key_ ID. This is the key itself, not the person who created it.
The Dashboard, or the Flint CLIuser and the signed-in person's usr_ ID.
A partner app's tokenpartner_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:

JSON
{
  "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:

JSON
{
  "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
curl "https://api.withflintpay.com/v1/fraud-warnings?is_actionable=true" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "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
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.

FieldMeaning
levelWhat the card processor's fraud screening found. See the levels below.
scoreThe 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.
outcomeauthorized, manual_review, blocked, issuer_declined, or invalid.
outcome_reasonWhy, 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_idThe rule that decided the result.
payment_review_idThe review opened for this payment.
statementA sentence describing the result, for your staff.
evaluated_atWhen 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:

levelMeaning
normalThe screening found nothing unusual.
elevatedThe screening found signs of higher fraud risk.
highestThe screening found strong signs of fraud.
not_assessedThere 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#

  1. What happens: A block rule, or the card processor's screening, stops a payment
  2. Flint sends: payment_intent.payment_failed
    last_payment_error.code is payment_blocked.
  3. What happens: A review rule matches a payment the bank approved
  4. Flint sends: payment_review.opened
    The review, with the payment summary and risk level.
  5. What happens: You approve or decline it, or the payment is canceled, refunded in full, disputed, or expires
  6. Flint sends: payment_review.closed
    Fires once per review. closed_reason says how it closed.
  7. What happens: A decline's refund fails
  8. Flint sends: payment_review.reopened
    The review, open again, with refund_id cleared and last_resolution_failure naming the failed refund. It can fire more than once if later declines also fail.
  9. What happens: The card issuer reports fraud on a payment
  10. Flint sends: fraud_warning.created
    The warning, with is_actionable and the payment summary.
  11. What happens: The payment is refunded in full or disputed
  12. Flint sends: fraud_warning.updated
    Fires when is_actionable or dispute_id changes.

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
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
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 numberResult
4000 0000 0000 9235Elevated risk. The default review rule opens a review, except on invoice and subscription renewal payments.
4100 0000 0000 0019Highest risk, blocked by the card processor's screening. The attempt fails with payment_blocked.
4000 0000 0000 5423The 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.

  • GET/v1/risk-rules/attributesRequired API key scopes: risk.controls.write, risk.read or risk.reviews.writeReference for GET /v1/risk-rules/attributes

    Lists the attributes rules can use.

  • POST/v1/risk-previewsRequired API key scopes: risk.controls.write, risk.read or risk.reviews.writeReference for POST /v1/risk-previews

    Validates a rule without saving it. It changes nothing and needs only risk.read.

  • POST/v1/risk-rulesRequired API key scope: risk.controls.writeReference for POST /v1/risk-rules

    Creates a rule. Updating and deleting rules, and every list change, need the same scope.

  • POST/v1/risk-lists/{risk_list_id}/itemsRequired API key scope: risk.controls.writeReference for POST /v1/risk-lists/{risk_list_id}/items

    Adds values to a list.

  • GET/v1/payment-reviewsRequired API key scopes: risk.controls.write, risk.read or risk.reviews.writeReference for GET /v1/payment-reviews

    Lists reviews. Reading one review needs the same scope.

  • POST/v1/payment-reviews/{payment_review_id}/approveRequired API key scope: risk.reviews.writeReference for POST /v1/payment-reviews/{payment_review_id}/approve

    Approves a review. Declining needs the same scope.

  • GET/v1/fraud-warningsRequired API key scopes: risk.controls.write, risk.read or risk.reviews.writeReference for GET /v1/fraud-warnings

    Lists fraud warnings.

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#

  • HTTP 409
    Capture was requested while the payment's review is not approved. Approve the review, then capture again.
  • HTTP 409
    Reason risk_action_unsupported. A review or require_3ds rule matched an ACH debit. Limit the rule to cards with payment_method_type.
  • HTTP 409
    Reason configuration_required. A require_3ds rule matched a virtual terminal payment. Exclude virtual_terminal from the rule.
  • HTTP 503
    SERVICE_UNAVAILABLERetry the same request
    Flint could not finish the risk check. Retry the same request with the same Idempotency-Key after a short delay, so a payment the bank already approved is completed rather than charged twice.
  • HTTP 409
    OPERATION_IN_PROGRESSRetry the same request
    A capture, cancellation, refund, or payment update is already running on the payment. details[0].blocking_resources names the payment intent. Nothing was started; send the same request again once it finishes.
  • HTTP 409
    With reason managed_externally, Flint's default rules accept only status changes, and they cannot be deleted. A preview that proposes a new action or predicate for one returns this too.
  • HTTP 409
    With reason enabled_risk_rules, the environment already has 100 active rules. details[0].limit carries the limit. Set a rule inactive, or delete one, before creating or activating another.
  • HTTP 400
    The predicate exceeds 100 nodes or 10 nesting levels, or has an invalid shape. See Validation errors.
  • HTTP 409
    VERSION_CONFLICTRefresh, then retry
    The rule's or list's version no longer matches expected_version. details[0].current_version carries the current version, and resource_type says whether it's a risk_rule or a risk_list. Read it again, reapply your change, and resend with the new version and a new Idempotency-Key.
  • HTTP 409
    The state of a payment review, rule, or list refuses the action. Branch on details[0].reason; details[0].resource_type is payment_review, risk_rule, or risk_list. On a payment review, terminal_status with current_status closed means it already closed: read it for closed_reason. in_progress with current_status resolving means a different decision, or an expiry, is still finishing: read its pending_action, then wait for payment_review.closed, or payment_review.reopened after a failed refund. On a rule or list, archived means it can't be changed.
  • HTTP 409
    CONCURRENT_MODIFICATIONRetry the same request
    Another change to the environment's risk controls was applied at the same moment. Nothing changed. Send the same request again with the same Idempotency-Key.
  • HTTP 409
    Another list in the environment, possibly an archived one, has this alias. details[0].current_resource names it. Choose a new alias.
  • HTTP 409
    Active rules still reference the list. Change them or set them inactive, then archive it. details[0].blocking_resources lists them as risk_rule references.
  • HTTP 409
    With reason managed_externally, Flint's default lists can't be renamed or archived. You can still add and remove their values.

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 codeCause
unknown_attributeThe attribute is not in the registry.
attribute_unavailableThe attribute exists but is not available in this environment.
invalid_operatorThe operator is not supported for the attribute.
invalid_operandThe 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_moneyamount_money needs an integer amount and an uppercase currency, and nothing else.
invalid_list_aliaslist_alias is not a valid alias.
unknown_predicate_fieldA node has a field it does not accept.
invalid_predicate_node, invalid_predicate_groupA node is not a valid comparison or group, or a group has no children or more than 50.
invalid_rule_actionaction is not allow, block, review, or require_3ds.
rule_action_unavailable_at_stageA block or require_3ds rule reads risk_level or risk_score.
invalid_predicateThe predicate is invalid JSON, exceeds 100 nodes, or nests more than 10 levels.
list_not_foundThe list alias does not exist in this environment.
list_archivedThe list is archived.
list_type_mismatchThe 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.succeeded or order.paid ships before anyone reviews it. Use manual capture, or wait for payment_review.closed before shipping.
  • Treating approval as capture. Approving a manual-capture review only allows the capture. Call capture yourself before the authorization expires.
  • Writing neq and expecting it to match missing values. A payment without the attribute never matches. Add is_missing.
  • Adding an allow rule and expecting it to skip 3D Secure. require_3ds rules still apply.
  • Leaving a review rule open to ACH debits. A match fails the bank payment. Limit it with payment_method_type eq card.

Next steps#

Was this helpful?