/evaluate



ℹ️ For details on how these APIs work together, please refer to the Workflows document.


Payload Optimization - Rank scale

The Optimization Rank column on each table below indicates that field's contribution to rescue performance once required fields are in place. Use it as a prioritization list when tuning an existing integration.

RankMeaning
CriticalDirectly drives rescue performance. Absence has a measurable negative impact.
HighSignificantly improves rescue performance when present.
MediumContributes a useful signal; recommended to include.
LowInformational or analytics value; minimal direct rescue impact.
RequiredInfrastructure or routing field; required for the request to be valid, with no separate performance signal beyond that.
Optional field. We recommend providing all data where available for a complete context.

Some rows carry a scoped qualifier (e.g. Required — CIT, Required — MIT, Required — Managed MIT, Required if parent object included) — these clarify when the field is required, not a different rank tier.


Request parameters

Property NameTypeRequired?Optimization RankNotes
isDeclinedboolrequiredRequiredRequired: Send this as true for all requests to evaluate.
transactionTypeenumoptionalConditional — required for Auth + CaptureAUTHORIZATION | PURCHASE

By default, accounts are configured for purchase only, and this parameter can be omitted. If you request to be able to use authorization you must provide a value.
midstringrequiredRequiredFlexFactor Merchant Identification Number. Get your merchants' Mid
orderIdstringrequiredRequired — must be the same for every retry of a Sync MIT attempt so the retry matches the original requestYour internal order ID. This will reference your system of record with FlexFactor.
siteIdstringoptionalConditional — either siteId or siteUrl for Site assignmentUnique FlexFactor ID of the website/campaign generating this transaction.

siteId is an explicit mapping to a FlexFactor site and Descriptor. siteUrl and dynamicDescriptor can be used to dynamically assign a FlexFactor site to an order if multiple descriptors are needed per FlexFactor MID.

Retrieve your merchant's siteId
customerIpstringoptionalCritical for CIT — directly drives rescue performanceThe customer's IP as captured on the checkout page. Must be the end-user / cardholder browser IP, not the merchant server IP.
siteUrlstringoptionalThe URL can be specified if multiple domains share the same siteId.
orderSourceenumoptionalLowSource of the order. If not sent, the default is ecommerce. Allowed values: ecommerce, terminal, vterminal.
attemptCountintegeroptionalHighThe authorization attempt number this request represents — tells FlexFactor which retry it is receiving from the merchant. 1 = the first/original authorization attempt, 2 = the first retry, and so on. Send the merchant's own attempt counter for the order.
idempotencyKeyguid/uuidrequiredRequiredYou need to generate a unique GUID/UUID so that we can identify repeated requests.
sequenceNumberstringrequired for batch via SFTPConditional — SFTP batch onlySFTP ONLY: Numerical position of that transaction within the batch.
isMITboolrequiredRequiredtrue for merchant-initiated transactions. When true, requires specific MIT fields.
transactionobjectrequiredRequiredSee transaction fields below.
payerobjectrequiredRequiredSee payer fields below.
billingInformationobjectrequiredRequired by default, can be relaxedSee billingInformation fields below.
paymentMethodobjectrequiredRequiredSee paymentMethod fields below.
shippingInformationobjectoptionalLowSee shippingInformation fields below.
deviceDetailsobjectoptionalHigh — significantly improves rescue performanceSee deviceDetails fields below.
merchantobjectoptionalHighSee merchant fields below.
orderItemsobject arrayoptionalMediumSee orderItems fields below.
additionalFieldsobject arrayoptionalLowSee additionalFields fields below.

Try it right now: check out the /evaluate Reference. or the Postman Collection

Additional parameters for MIT

A request for Merchant Initiated Transaction (e.g., subscriptions) requires the following additional fields:

Property NameTypeRequired?Optimization RankNotes
isRecurringboolrequiredRequiredtrue for subscriptions.
expiryDateUtcdatetimeoptionalConditional on the Merchant MIT configurationIndicates the period during which FlexFactor will retry the transaction.
- Required when your configuration is async MIT.
- Default rescue window: up to 21 days from the original decline. Set this value to the merchant retry window, not beyond.
subscriptionobjectrequired when isRecurring is trueRequired — MITRequired when both isMIT and isRecurring are true. See subscription fields below.
threeDSecureobjectoptionalHigh — significantly improves rescue performanceSee 3DSecure fields below.
❗️

Send only MIT that have just failed

The FlexFactor service is optimized to work with failed Merchant Initiated Transactions (MIT) that have just failed. These need to be passed to FlexFactor on that day (and not after a few days or weeks) and should not be retried by the Merchant up to the set expiry date.


Detailed object parameters:

transaction

Required object, contains context and details of the declined transaction being sent to FlexFactor.

Property NameTypeRequired?Optimization RankNotes
idstringrequiredRequiredExternal transaction identifier from the original decline.
amountintegerrequiredRequiredAmount of the transaction in cents
currencystringrequiredRequiredISO 4217 currency code. E.g.: 'USD', 'EUR'
dynamicDescriptorstringoptionalConditionalRequired only if enabled by FlexFactor for your configuration. Pass the descriptor from the MID that declined the transaction.
timestampUtcdatetimerequiredRequiredDate and time of the declined transaction.
timezoneUtcOffsetintegeroptionalLowUTC offset of the timezone.
transactionTypestringoptionalHighE.g.: 'Auth', 'Capture', 'Void'
responseCodestringoptionalHighResponse code received from the gateway.
responseDescriptionstringoptionalHighDescription of the response, usually the response message.
responseStatusstringoptionalHighE.g.: Approved, Declined, Voided, Refunded, Chargeback, etc.
responseSubStatusstringoptionalMediumSub-status of the response.
responseCodeSourcestringoptionalHighThis is the source of the code from the original transaction. E.g.: "nmi", "Paypal"
processorNamestringoptionalHighName of the processor.
avsResultCodestringoptionalHighAddress Verification Service result code.
cvvResultCodestringoptionalHighCard Verification Value result code.
cavvResultCodestringoptionalMediumCardholder Authentication Verification Value result code.
cardNotPresentbooloptionalHighIndicates if the card was present during the transaction.


paymentMethod

Property NameTypeRequired?Optimization RankNotes
cardNumberstringrequiredRequiredSend the token that was returned with /tokenize.
expirationYearintegerrequiredRequiredCard expiration year
expirationMonthintegerrequiredRequiredCard expiration Month
verificationValuestringoptionalCriticalCVV value directly drives CIT rescue performance
holderNamestringrequiredRequiredCard Holder Name
tokenbooleanoptionalRequired if sending PCI data — set value to falsetrue indicates cardnumber is a token. false indicates it is PAN data.
cardTypestringrequiredRequiredCREDIT, DEBIT, PREPAID
cardBrandstringrequiredRequiredVISA Mastercard
cardCountrystringrequiredRequiredISO 3166-1 alpha-2 country code (2-letter).
cardIssuerstringoptionalMediumE.g., MY BANK
cardLevelstringoptionalLow
cardFingerprintstringoptionalLow
cardBinNumberstringrequiredRequired6-character string.
cardLast4DigitsstringrequiredRequired4-character string.


billingInformation

Required object by default; can be relaxed by FlexFactor on request.

Property NameTypeRequired?Optimization RankNotes
firstNamestringrequiredRequiredCardholder First Name
lastNamestringrequiredRequiredCardholder Last Name
phonestringoptionalCardholder Contact Phone
countrystringrequiredRequiredCardholder Billing Country
countryCodestringrequiredRequiredISO 3166-1 alpha-2 country code (2-letter)
addressLine1stringrequiredRequiredCardholder Billing Address
addressLine2stringoptional
statestringrequired for US cardsRequired (US)2-letter and 2-digit codes from the ANSI standard INCITS 38:2009 (supersedes FIPS 5-2)
citystringrequiredRequiredCardholder Billing City
zipCodestringrequiredRequired5 or 9 digit Billing Zip Code

Payer

Required object

Property NameTypeRequired?Optimization RankNoted
emailstringrequiredRequiredCustomer's email
phonestringoptionalMediumCustomer's phone
idstringoptionalLowCustomer's ID in your system
birthdatedatetimeoptionalLowCustomer's birthdate
paymentMethodsarrayoptionalOnly applicable for Customer Wallet integrationsCustomer's additional payment methods information on file. See details below.

PaymentMethods

Optional array within the Payer object.

NOTE This is for integrations leveraging wallet-style decline recovery where a customer may have multiple stored payment methods. This allows the merchant to send all payment methods at once, allowing FlexFactor to optimize the recovery and manage which payment instruments can be rescued.

Contains an array of payment method information (ACH, credit cards). Each payment method follows a consistent structure with a type identifier, payment-specific data, and optional billing information.

Property NameTypeRequired?Optimization RankNotes
TypestringrequiredRequired if the parent object is includedCARD | ACH (case-insensitive)
ValueobjectrequiredRequired if the parent object is includedPayment method-specific properties:
ACH — bank transfer, see required values below
CARD — credit card, see required values below
BillingInformationobjectoptionalHighOptional billing details per payment method. Applicable if the Payment Method AVS Value differs. See values below.

ACH

Value object when 'type':'ACH' in PaymentMethods

PropertyTypeRequired?Optimization RankNotes
AccountTypestringrequiredRequired if the parent object is includedType of bank account. CHECKING | SAVINGS (case-insensitive)
AccountNumberstringrequiredRequired if the parent object is includedBank account number.
RoutingNumberstringrequiredRequired if the parent object is includedBank routing number.
AccountHolderTypestringoptionalType of account holder. Allowed values: "company", "individual" (case-insensitive)

Card

Value object when 'type':'card' in PaymentMethods

Same format as paymentMethod object. Optimization Ranks for each property carry over from the paymentMethod table above — most notably, verificationValue is Critical for rescue performance and schemeTransactionId on the parent subscription remains the single highest-leverage MIT field.


billingInformation

Optional

Same object as billingInformation


affiliate

optional object

Property NameTypeRequired?Optimization RankNotes
idstringoptionalLowThis is an internal identifier for the affiliate. It's typically used for backend or database purposes to uniquely identify affiliates within a system.
namestringoptionalLowThis is a friendly name or label associated with the affiliate.



deviceDetails

Optional object. The parent object is High rank — significantly improves rescue performance when present.

Property NameTypeRequired?Optimization RankNotes
deviceTypestringrequired if this object is providedRequired if the parent object is includedType of device used for that transaction (e.g., 'mobile', 'laptop', 'tablet')
deviceNamestringrequired if this object is providedRequired if the parent object is includedName of the device (e.g., 'iPhone 12', 'Samsung Galaxy S21')
deviceOSstringrequired if this object is providedRequired if the parent object is includedOperating system of the device (e.g., 'iOS 14', 'Android 11')
browserstringrequired if this object is providedRequired if the parent object is includedName of the browser (e.g., 'Chrome', 'Safari')
userAgentstringrequired if this object is providedRequired if the parent object is includedUser-agent string (a detailed string provided by the browser that identifies the browser, its version, and the operating system)

merchant

Optional object for partners only.

Property NameTypeRequired?Optimization RankNotes
idstringrequired if this object is providedRequired if the parent object is includedExternal ID
namestringrequired if this object is providedRequired if the parent object is includedName of the merchant
mccintegerrequired if this object is providedRequired if the parent object is includedMCC code that the merchant is enrolled with standard processing MID(s).
countrystringrequired if this object is providedRequired if the parent object is includedThe country in which the merchant operates

subscription

Required object when isMIT and isRecurring are true.

Property NameTypeRequired?Optimization RankNotes
subscriptionIdstringrequired if this object is providedRequired — MITShould be unique per subscriber within the merchant platform. Combined with other subscription elements to make acceptance decisions.
priceintrequired if this object is providedRequired — MITAmount in cents.
currencystringrequired if this object is providedRequired — MIT
intervalstringrequired if this object is providedRequired — MITE.g.: 'daily', 'weekly', 'monthly', 'quarterly', 'yearly'.
intervalCountintoptionalLowNumber of interval units between payments. Defaults to 1. E.g.: interval: 'monthly' with intervalCount: 3 = a charge every 3 months.
schemeTransactionIdstringoptionalCritical for MITNetwork Transaction Id.

Visa example Transaction ID: 987654321234567. Mastercard example Trace ID: MCCABC1XY0107.

Note: This is not MC TLID
schemeBrandstringoptionalLowCard/scheme brand associated with the subscription. Will generally be similar to the cardBrand value, but might differ in some edge cases. E.g.: Visa
paymentNumberstringoptionalLowThe sequential number indicates the specific payment within the subscription cycle.

E.g., Customer subscribed monthly on Jan 15: Jan 15 is paymentNumber: 1, Feb 15 is paymentNumber: 2, Mar 15 is paymentNumber: 3.
totalPaymentsstringoptionalLowTotal number of payments for that subscription. E.g., Customer subscribed monthly for 6 months: totalPayments: 6. Leave null if the subscription is indefinite.

threeDSecure

Optional passthrough object. Provide when the original transaction carried a 3DS authentication so FlexFactor can pass it on to the issuer. The parent object is High rank — significantly improves rescue performance when present.

Property NameTypeRequired?Optimization RankNotes
threeDsVersionstringoptionalProtocol version for the card payment authentication. E.g.: '1.0.2' '2.1.0' '2.2.0'
ecommerceIndicatorstringrequired if this object is providedRequired if the parent object is includedThe indication of an online commerce transaction.
authenticationValuestringrequired if this object is providedRequired if the parent object is includedThe encrypted code from the cardholder's bank.
directoryServerTransactionIdstringrequired if this object is providedRequired if the parent object is includedThe unique ID for the transaction with the bank.
xidstringoptionalTransaction identifier generated by the 3D Secure system.
authenticationValueAlgorithmstringoptionalThe encryption algorithm used to secure the payment. E.g.: SHA-256
directoryResponseStatusstringoptionalThe response status code from the bank's directory. E.g.: 'Y'
authenticationResponseStatusstringoptionalThe response status code for the payment authentication. E.g.: 'Y'
enrolledstringoptionalThe card's enrollment status in 3D Secure. E.g.: 'Y'

orderItems

Optional object.

Property NameTypeRequired?Optimization RankNotes
skustringoptionalLowThe SKU of the item.
namestringoptionalLowThe name of the item.
descriptionstringoptionalLowThe description of the item.
amountintegeroptionalLowThe amount of the item.
discountAmountintegeroptionalLowThe discount amount on the item.
taxintegeroptionalLowThe tax on the item.
discountTypestringoptionalLowThe discount type on the item.
quantitystringoptionalLowThe quantity of this item.

shippingInformation

Optional object.

Property NameTypeRequired?Optimization RankNotes
firstNamestringrequired if this object is providedLow
lastNamestringrequired if this object is providedLow
phonestringoptionalLow
countrystringrequired if this object is providedRequired if the parent object is included
countryCodestringrequired if this object is providedRequired if the parent object is includedISO 3166-1 alpha-2 country code (2-letter)
addressLine1stringrequired if this object is providedRequired if the parent object is included
addressLine2stringoptionalRequired if the parent object is included
statestringrequired if this object is providedRequired if the parent object is included2-letter and 2-digit codes from the ANSI standard INCITS 38:2009 (supersedes FIPS 5-2)
citystringrequired if this object is providedRequired if the parent object is included
zipCodestringrequired if this object is providedRequired if the parent object is included5 or 9 digits

additionalFields

Optional array of objects. Max 50 objects

Property NameTypeRequired?Optimization RankNotes
keystringoptionalLowMax 40 characters, Description of the additional information.
valuestringoptionalLowMax 500 characters, Content of the additional information.


Response status

Property NameTypeNotes
resultstringResult of the API request: SUCCESS | FAILED. ⚠️ This is not the result of the transaction — see status below.
statusstringFor sync calls: APPROVED, DECLINED, CHALLENGE, CAPTUREREQUIRED.
For async calls: SUBMITTED.
orderSessionKeyguid/uuidFlexFactor unique transaction identifier.
senseKeystringOptional.

Order status

A transaction moves through the statuses below. The /evaluate response reports the status synchronously (see Response status); the order lifecycle is then tracked with GET /orders, which returns a numeric status and a matching statusName.

/evaluate response statuses

StatusType of statusDescription
Challenge⚠️ ConditionalThe transaction rescue requires an action from the customer. This action can be performed via the UI Widget. If the UI Widget is not embedded, treat as a decline.
Capture required⚠️ ConditionalThe transaction rescue requires a /capture. For Authorize flows the capture must be called within 5 minutes of the authorize response by default.
Approved✅ SuccessThe transaction was rescued (synchronous CIT / Sync MIT).
Declined❌ FailThe transaction could not be rescued (synchronous).
Submitted⏳ PendingThe transaction was received for asynchronous processing. Track the outcome with GET /orders or webhooks.

GET /orders order statuses

GET /orders and GET /orders/{id} return a numeric status with a matching statusName:

statusstatusNameType of statusDescription
0Draft⏳ PendingThe MIT order was picked up by the system, but is not yet being processed.
1Onhold⏳ PendingThe order is temporarily on hold.
2Cancelled❌ FailThe order was cancelled (voided). An MIT order that passes its expiryDateUtc also resolves here — the order.expired webhook fires so you can distinguish expiry from a cancellation.
3Problem❌ FailA processing problem occurred.
4Processing⏳ PendingThe order is being processed.
5Capturerequired⚠️ ConditionalThe rescue requires a /capture.
6Returned↩️ ReturnedThe order was refunded/returned.
7Completed✅ SuccessThe transaction was rescued — funds captured.

Update the order status with GET /orders

Immediate response from /evaluate cannot cover all scenarios, please update the order status with


Payload examples

For minimum (required-fields-only) and optimal (all-fields) request payloads for both CIT and MIT, see the dedicated Payload examples page.

Request example

curl --request POST \
     --url https://api-sandbox.flexfactor.io/v1/evaluate \
     --header 'Authorization: Bearer {bearer_token_returned_by_oauth2}' \
     --header 'accept: application/json' \
     --header 'content-type: application/*+json' \
     --data '
{
  "mid": "a8a0a74d-2509-4cbc-9eb5-879c7a34eb45",
  "isDeclined": true,
  "isMIT": false,
  "orderId": "987-654-321",
  "idempotencyKey": "abcd1234",
  "customerIp": "203.0.113.42",
  "attemptCount": 2,
  "transaction": {
    "id": "3478613",
    "amount": 15000,
    "currency": "USD",
    "timestampUtc": "2026-06-01T12:30:00Z",
    "responseCode": "203",
    "responseCodeSource": "NMI",
    "responseDescription": "Activity limit exceeded",
    "responseStatus": "DECLINED",
    "processorName": "Acme Payments",
    "avsResultCode": "M",
    "cvvResultCode": "M",
    "transactionType": "Purchase"
  },
  "payer": {
    "id": "customer123",
    "email": "[email protected]"
  },
  "billingInformation": {
    "firstName": "John",
    "lastName": "Doe",
    "country": "United States",
    "countryCode": "US",
    "addressLine1": "123 Main St.",
    "state": "CA",
    "city": "San Francisco",
    "zipCode": "94111"
  },
  "paymentMethod": {
    "holderName": "John Doe",
    "cardType": "CREDIT",
    "cardBrand": "VISA",
    "cardCountry": "US",
    "expirationMonth": 12,
    "expirationYear": 2028,
    "verificationValue": "123",
    "cardBinNumber": "411111",
    "cardLast4Digits": "1111",
    "cardNumber": "zJb6YF7pL5gk8x9VhRnSwHd4q2t",
    "token": true
  },
  "deviceDetails": {
    "deviceType": "laptop",
    "deviceName": "MacBook Pro",
    "deviceOS": "macOS 14",
    "browser": "Chrome",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"
  }
}
'
curl --request POST \
     --url https://api-sandbox.flexfactor.io/v1/evaluate \
     --header 'Authorization: Bearer {bearer_token_returned_by_oauth2}' \ //replace with bearer returned by oauth2
     --header 'accept: application/json' \
     --header 'content-type: application/*+json' \
     --data '
{

	"isMIT": true,
	"isRecurring": true,
	"expiryDateUtc": "2023-05-24T12:30:20Z",
	"attemptCount": 3, //which retry this is for the order; 1 = first/original attempt
	"subscription": {
    //Required fields
		"subscriptionId": "sub_123456",
    "interval": "Monthly",
		"price": 2599,
		"currency": "USD",
    //Optional metadata to improve cure rate
		"schemeTransactionId": "txn_789012",
		"schemeBrand": "Visa",
		"paymentNumber": 2,
		"totalPayments": 12
	}, 
  
   "transaction": {
    //Required fields
    "amount": 15000,	//In cents. must be >10 and <20000 for test calls
    "currency": "USD",
    "id": "3478613",
    "dynamicDescriptor": "MyShoesStore",
    //Optional metadata to improve cure rate
    "timestampUtc": "0001-01-01T00:00:00Z",
    "timezoneUtcOffset": 0,
    "responseCode": "203",
    "avsResultCode": "M",
    "processorName": "Acme Payments",
    "cavvResultCode": "2",
    "responseCodeSource": "NMI",
    "responseDescription": "Activity limit exceeded",
    "responseStatus": "DECLINED",
    "transactionType": "AUTHORIZATION"
  },
  
	"threeDSecure": {
		"threeDsVersion": "2.1.0",
		"ecommerceIndicator": "02",
		"authenticationValue": "abcdefg12345",
		"directoryServerTransactionId": "ds_987654",
		"xid": "xid_246810",
		"authenticationValueAlgorithm": "SHA-256",
		"directoryResponseStatus": "Y",
		"authenticationResponseStatus": "Y",
		"enrolled": "Y"
	},
 
  "payer": {
    "id": "customer123",
    "email": "[email protected]", //must be this exact address mail if using the 4111111111111111 test card
    "phone": "+1 555-123-4567",
    "birthdate": "1990-01-01",
    "paymentMethods": [
    {
      "Type": "card",
      "Value": {
        "holderName": "Jane Doe",
    		"cardType": "CREDIT",
    		"cardBrand": "VISA",
        "cardCountry": "United States",
        "cardIssuer": "Acme Bank",
        "cardFingerprint": "abcd1234",
        "expirationMonth": 12,
        "expirationYear": 2028,
        "cardBinNumber": "411111",
        "cardLast4Digits": "1111",
        "cardNumber": "zJb6YF7pL5gk8x9VhRnSwHd4q2t" //Do not send credit card number in clear if you are not PCI complipant, send token returned by /tokenize	
      },
      "BillingInformation": {
        "firstName": "Jane",
        "lastName": "Doenowitz",
        "phone": "+1 555-123-4567",
        "country": "United States",
        "countryCode": "US",
        "addressLine1": "123 Main St.",
        "state": "CA",
        "city": "San Francisco",
        "zipcode": "94111"
      }
    }
  ]

  },
  "orderItems": [
    {
      "sku": "SKU123",
      "name": "Subscription 1",
      "description": "Description of Subscription 1",
      "amount": 20000,
      "discountAmount": 0,
      "tax": 100,
      "quantity": 1
    },
    {
      "sku": "SKU456",
      "name": "Subscription 2",
      "description": "Description of Subscription 2",
      "amount": 10000,
      "discountAmount": 0,
      "tax": 50,
      "quantity": 1
    }
  ],
  "shippingInformation": {
    "firstName": "John",
    "lastName": "Doenowitz",
    "phone": "+1 555-123-4567",
    "country": "United States",
    "countryCode": "US",
    "addressLine1": "123 Main St.",
    "city": "CA",
    "zipcode": "94111"
  },
  "merchant": {
    "country": "US",
    "mcc": 1234,
    "id": "merchant123",
    "name": "Acme Inc."
  },
  "affiliate": {
    "id": "123123123",
    "name": "Affiliate 1"
  },
  "paymentMethod": {
    "holderName": "John Doe",
    "cardType": "CREDIT",
    "cardBrand": "VISA",
    "cardCountry": "United States",
    "cardIssuer": "Acme Bank",
    "cardFingerprint": "abcd1234",
    "expirationMonth": 12,
    "expirationYear": 2028,
    "cardBinNumber": "411111",
    "cardLast4Digits": "1111",
    "cardNumber": "zJb6YF7pL5gk8x9VhRnSwHd4q2t" //Do not send credit card number in clear, send token returned by /tokenize
  },
  "billingInformation": {
    "firstName": "John",
    "lastName": "Doenowitz",
    "phone": "+1 555-123-4567",
    "country": "United States",
    "countryCode": "US",
    "addressLine1": "123 Main St.",
    "state": "CA",
    "city": "San Francisco",
    "zipcode": "94111"
  },
  "mid": "a8a0a74d-2509-4cbc-9eb5-879c7a34eb45", //replace with your mid
  "isDeclined": true,
  "orderId": "987-654-321", //must be unique even for test calls
  "idempotencyKey": "abcd1234",
}
'
curl --request POST \
     --url https://api-sandbox.flexfactor.io/v1/evaluate \
     --header 'Authorization: Bearer abc123def456' \ //replace with bearer returned by oauth2
     --header 'accept: application/json' \
     --header 'content-type: application/*+json' \
     --data '
{

	"isMIT": true,
	"isRecurring": true,
	"expiryDateUtc": "2023-05-24T12:30:20Z",
	"attemptCount": 3, //which retry this is for the order; 1 = first/original attempt
	"subscription": {
		"subscriptionId": "sub_123456",
		"schemeTransactionId": "txn_789012",
		"schemeBrand": "Visa",
		"interval": "Monthly",
		"price": 2599,
		"currency": "USD",
		"paymentNumber": 2,
		"totalPayments": 12
	}, 
	"threeDSecure": {
		"threeDsVersion": "2.1.0",
		"ecommerceIndicator": "02",
		"authenticationValue": "abcdefg12345",
		"directoryServerTransactionId": "ds_987654",
		"xid": "xid_246810",
		"authenticationValueAlgorithm": "SHA-256",
		"directoryResponseStatus": "Y",
		"authenticationResponseStatus": "Y",
		"enrolled": "Y"
	},
  "transaction": {
    "id": "3478613",
    "timestampUtc": "0001-01-01T00:00:00Z",
    "timezoneUtcOffset": 0,
    "amount": 19975, //In cents. must be >10 and <20000 for test calls
    "currency": "USD",
    "responseCode": "203",
    "avsResultCode": "M",
    "cvvResultCode": "NA",
    "processorName": "Acme Payments",
    "cavvResultCode": "2",
    "responseCodeSource": "NMI",
    "responseDescription": "Activity limit exceeded",
    "responseStatus": "DECLINED",
    "transactionType": "CAPTURE",
    "dynamicDescriptor": "MyShoesStore"
  },
  "payer": {
    "id": "customer123",
    "email": "[email protected]", //must be this exact address mail if using the 4111111111111111 test card
    "phone": "+1 555-123-4567",
    "birthdate": "1990-01-01"
  },
  "orderItems": [
    {
      "sku": "SKU123",
      "name": "Subscription 1",
      "description": "Description of Subscription 1",
      "amount": 20000,
      "discountAmount": 0,
      "tax": 100,
      "quantity": 1
    },
    {
      "sku": "SKU456",
      "name": "Subscription 2",
      "description": "Description of Subscription 2",
      "amount": 10000,
      "discountAmount": 0,
      "tax": 50,
      "quantity": 1
    }
  ],
  "shippingInformation": {
    "firstName": "John",
    "lastName": "Doenowitz",
    "phone": "+1 555-123-4567",
    "country": "United States",
    "countryCode": "US",
    "addressLine1": "123 Main St.",
    "city": "CA",
    "zipcode": "94111"
  },
  "merchant": {
    "country": "US",
    "mcc": 1234,
    "id": "merchant123",
    "name": "Acme Inc."
  },
  "affiliate": {
    "id": "123123123",
    "name": "Affiliate 1"
  },
  "paymentMethod": {
    "holderName": "John Doe",
    "cardType": "CREDIT",
    "cardBrand": "VISA",
    "cardCountry": "United States",
    "cardIssuer": "Acme Bank",
    "cardFingerprint": "abcd1234",
    "expirationMonth": 12,
    "expirationYear": 2028,
    "cardBinNumber": "411111",
    "cardLast4Digits": "1111",
    "cardNumber": "zJb6YF7pL5gk8x9VhRnSwHd4q2t" //Do not send credit card number in clear, send token returned by /tokenize
  },
  "billingInformation": {
    "firstName": "John",
    "lastName": "Doenowitz",
    "phone": "+1 555-123-4567",
    "country": "United States",
    "countryCode": "US",
    "addressLine1": "123 Main St.",
    "state": "CA",
    "city": "San Francisco",
    "zipcode": "94111"
  },
  "mid": "a8a0a74d-2509-4cbc-9eb5-879c7a34eb45", //replace with your mid
  "isDeclined": true,
  "orderId": "987-654-321", //must be unique even for test calls
  "idempotencyKey": "abcd1234",
}
'
//file name: 'evaluate_{yourfilename}'
//any file without the prefix will not be picked up

{
  "mid": "a8a0a74d-2509-4cbc-9eb5-879c7a34eb45", //replace with your mid
  "authorizationToken": "Bearer abc123def456", //replace with bearer returned by oauth2
  "expiryDateUtc": "2023-04-05T01:23:45.678Z", //default expiry date and time for the whole batch, you can specify individual expiryDate within each transaction
  "requests": [
    {
    
    "sequenceNumber": 1, // The numerical position of the transaction within the batch.
    "isDeclined": true,
    "isMIT": true,
    "isRecurring": true,
    "attemptCount": 2, //which retry this is for the order; 1 = first/original attempt
    "SiteUrl": "https://example.com", //Website linked to the descriptor of the subscription.
    "subscription": {
      "subscriptionId": "sub_123456",
      "schemeTransactionId": "txn_789012",
      "schemeBrand": "Visa",
      "interval": "Monthly",
      "price": 2599,
      "currency": "USD",
      "paymentNumber": 2,
      "totalPayments": 12
    }, 
    "threeDSecure": {
      "threeDsVersion": "2.1.0",
      "ecommerceIndicator": "02",
      "authenticationValue": "abcdefg12345",
      "directoryServerTransactionId": "ds_987654",
      "xid": "xid_246810",
      "authenticationValueAlgorithm": "SHA-256",
      "directoryResponseStatus": "Y",
      "authenticationResponseStatus": "Y",
      "enrolled": "Y"
    },
    "transaction": {
      "id": "3478613",
      "timestampUtc": "0001-01-01T00:00:00Z",
      "timezoneUtcOffset": 0,
      "amount": 19975, //in cents, >$10 and <$200 for tests
      "currency": "USD",
      "responseCode": "203",
      "avsResultCode": "M",
      "cvvResultCode": "NA",
      "processorName": "Acme Payments",
      "cavvResultCode": "2",
      "responseCodeSource": "NMI",
      "responseDescription": "Activity limit exceeded",
      "responseStatus": "DECLINED",
      "transactionType": "CAPTURE",
      "dynamicDescriptor": "MyShoesStore"
    },
    "payer": {
      "id": "customer123",
      "email": "[email protected]",
      "phone": "+1 555-123-4567",
      "birthdate": "1990-01-01"
    },
    "orderItems": [
      {
        "sku": "SKU123",
        "name": "Subscription 1",
        "description": "Description of Subscription 1",
        "amount": 20000,
        "discountAmount": 0,
        "tax": 100,
        "quantity": 1
      },
      {
        "sku": "SKU456",
        "name": "Subscription 2",
        "description": "Description of Subscription 2",
        "amount": 10000,
        "discountAmount": 0,
        "tax": 50,
        "quantity": 1
      }
    ],
    "shippingInformation": {
      "firstName": "John",
      "lastName": "Doe",
      "phone": "+1 555-123-4567",
      "country": "United States",
      "countryCode": "US",
      "addressLine1": "123 Main St.",
      "city": "CA",
      "zipcode": "94111"
    },
    "merchant": {
      "country": "US",
      "mcc": 1234,
      "id": "merchant123",
      "name": "Acme Inc."
    },
    "paymentMethod": {
      "holderName": "John Doe",
      "cardType": "CREDIT",
      "cardBrand": "VISA",
      "cardCountry": "United States",
      "cardIssuer": "Acme Bank",
      "cardFingerprint": "abcd1234",
      "expirationMonth": 12,
      "expirationYear": 2028,
      "cardBinNumber": "123456",
      "cardLast4Digits": "7890",
      "cardNumber": "zJb6YF7pL5gk8x9VhRnSwHd4q2t" //Do not send credit card number in clear, send token returned by /tokenize
    },
    "billingInformation": {
      "firstName": "John",
      "lastName": "Doe",
      "phone": "+1 555-123-4567",
      "country": "United States",
      "countryCode": "US",
      "addressLine1": "123 Main St.",
      "state": "CA",
      "city": "San Francisco",
      "zipcode": "94111"
    },

    "orderId": "ed44736a-b5fa-4bc2-bfb9-0e873bc09511", //must be unique even for test calls
    "idempotencyKey": "abcd1234",
    "senseKey": "1234567890"
},
{ 
    "sequenceNumber": 2, // The numerical position of the transaction within the batch.
    "isMIT": true,
    "isRecurring": true,
    "isDeclined": true,
    "attemptCount": 4, //which retry this is for the order; 1 = first/original attempt
    "SiteUrl": "https://example.com", //Website linked to the descriptor of the subscription
    "subscription": {
        "subscriptionId": "sub_654321",
        "schemeTransactionId": "txn_210987",
        "schemeBrand": "Mastercard",
        "interval": "Weekly",
        "price": 1599,
        "currency": "USD",
        "paymentNumber": 3,
        "totalPayments": 52
    },
      "threeDSecure": {
        "threeDsVersion": "2.2.0",
        "ecommerceIndicator": "01",
        "authenticationValue": "hijklm67890",
        "directoryServerTransactionId": "ds_456789",
        "xid": "xid_135790",
        "authenticationValueAlgorithm": "SHA-512",
        "directoryResponseStatus": "A",
        "authenticationResponseStatus": "C",
        "enrolled": "Y"
    },
      "transaction": {
        "id": "1234567",
        "timestampUtc": "0001-01-01T00:00:00Z",
        "timezoneUtcOffset": 0,
        "amount": 14999,
        "currency": "USD",
        "responseCode": "204",
        "avsResultCode": "N",
        "cvvResultCode": "M",
        "processorName": "XYZ Payments",
        "cavvResultCode": "1",
        "responseCodeSource": "Braintree",
        "responseDescription": "Insufficient funds",
        "responseStatus": "DECLINED",
        "transactionType": "AUTHORIZE"
    },
      "payer": {
        "id": "customer456",
        "email": "[email protected]",
        "phone": "+1 555-987-6543",
        "birthdate": "1985-05-05"
    },
      "orderItems": [
    {
        "sku": "SKU789",
        "name": "Product 3",
        "description": "Description of Product 3",
        "amount": 30000,
        "discountAmount": 0,
        "tax": 150,
        "quantity": 2
    },
    {
        "sku": "SKU012",
        "name": "Product 4",
        "description": "Description of Product 4",
        "amount": 25000,
        "discountAmount": 0,
        "tax": 125,
        "quantity": 1
    }
    ],
      "shippingInformation": {
        "firstName": "Jane",
        "lastName": "Doe",
        "phone": "+1 555-987-6543",
        "country": "United States",
        "countryCode": "US",
        "addressLine1": "456 Oak St.",
        "city": "NY",
        "zipcode": "10001"
    },
      "merchant": {
        "country": "US",
        "mcc": 5678,
        "id": "merchant456",
        "name": "XYZ Inc."
    },
    "affiliate": {
   		 "id": "123123123",
   		 "name": "Affiliate 1"
 		 },
      "paymentMethod": {
        "holderName": "Jane Doe",
        "cardType": "CREDIT",
        "cardBrand": "MASTERCARD",
        "cardCountry": "United States",
        "cardIssuer": "XYZ Bank",
        "cardFingerprint": "efgh5678",
        "expirationMonth": 12,
        "expirationYear": 2028,
        "cardBinNumber": "123456",
        "cardLast4Digits": "7890",
        "cardNumber": "zJb6YF7pL5gk8x9VhRnSwHd4q2t" //Do not send credit card number in clear, send token returned by /tokenize
    },

      "billingInformation": {
        "firstName": "Jane",
        "lastName": "Doe",
        "phone": "+1 555-987-6543",
        "country": "United States",
        "countryCode": "US",
        "addressLine1": "456 Oak St.",
        "city": "NY",
        "zipcode": "10001"
      },
      
      "orderId": "ed44736a-b5fa-4bc2-bfb9-0e873bc09512", //must be unique even for test calls
      "idempotencyKey": "abcd1234",
      "senseKey": "1234567890"
}
  ]
}

Response example

{
  "result":"Success/Failed",
  "status": "APPROVED | DECLINED | CHALLENGE | SUBMITTED | CAPTUREREQUIRED",
  "orderSessionKey": "{{$guid}}", //FlexFactor unique transaction identifier
  "senseKey": "value that was present in evaluate request", //optional
}


How to use the Optimization Rank column

  • Start with the Required rows. Every field marked Required (or Required — CIT / Required — MIT for your flow, or qualified variants like Required (cents) / Required (US) / Required (partners)) must be in the payload before optimization work begins. Fields marked Required if parent object included only apply when you include the parent object — but when the parent is sent, those children become required.
  • Then add the Critical fields. Two fields are formally Critical: paymentMethod.verificationValue (CVV) for CIT and subscription.schemeTransactionId for MIT. Populate these on every applicable request.
  • Then High, then Medium. The transaction decline context (responseCode, responseCodeSource, processorName), the full deviceDetails block, and the root attemptCount (which retry FlexFactor is receiving) are the largest non-Critical lifts. The Medium tier sharpens routing on harder declines.
  • Low fields are analytics-grade. Send when readily available.
  • Do not hard-code fields. paymentMethod.cardType, cardBrand, cardCountry, and holderName are required and should come from your BIN lookup and checkout data — not defaults. customerIp (CIT) must be the cardholder browser or device IP, not the merchant server IP.