/evaluate
On declined/failed transactions, you will have to invoke FlexCharge's Evaluate API.
This ACTIVATES the FlexCharge service.
Try it right now:
- Check out the /evaluate Reference.
- Check out our Postman Collection
Invoke /evaluate on declined transactions to process them through FlexCharge.
Prerequisites to invoke this API:
Request
Although similar to /transmit, invoking /evaluate requires additional data: idempotencyKey
, billingInformation
, paymentMethod.cardNumber
, and expiryDateUtc
in case of MIT.
Required fields
isDeclined | Boolean | Required | |
idempotencyKey | String | Required | You need to generate a unique GUID/UUID, so that we can identify repeated requests. |
orderId | String | Required | Your order ID |
transaction | Object | Required | Required fields for this object: |
transaction.id | String | Required | A string in the format of a GUID |
transaction.timestampUtc | Date | Required | The date and time of the transaction |
transaction.timezoneUtcOffset | Integer | Required | The UTC offset of the timezone |
transaction.amount | Integer | Required | The amount of the transaction in cents. $19.99 -> '1999' |
transaction.currency | String | Required | The currency of the transaction (e.g. USD) |
transaction.responseCode | String | Required | The response code of the transaction |
transaction.responseCodeSource | String | Required | The source of the response code (e.g. nmi) |
transaction.avsResultCode | String | Required | The AVS result code |
transaction.cvvResultCode | String | Required | The CVV result code |
transaction.cavvResultCode | String | Required | The CAVV result code If this value cannot be provided, use "NA" |
transaction.cardNotPresent | Boolean | Required | Indicates if the card was present during the transaction |
billingInformation | Object | Required | Required fields for this object: |
billingInformation.firstName | string | Required | |
billingInformation.lastName | string | Required | |
billingInformation.country | string | Required | |
billingInformation.countryCode | string | Required | ISO 3166-1 alpha-2 country code (2-letter) |
billingInformation.addressLine1 | string | Required | |
billingInformation.city | string | Required | |
billingInformation.zipcode | string | Required | 5 or 9 digits |
payer | Object | Required | |
payer.email | String | Required | If this value cannot be provided, write 'NA' and provide payer.phone instead. |
paymentMethod | Object | Required | Required fields for this object: |
paymentMethod.holderName | String | Required | |
paymentMethod.cardType | String | Required | |
paymentMethod.cardBrand | String | Required | |
paymentMethod.cardCountry | String | Required | |
paymentMethod.cardBinNumber | String | Required | First 6 digits of payment method. |
paymentMethod.cardLast4Digits | String | Required | Last 4 digits of payment method |
paymentMethod.ExpirationMonth | Number | Required | 2 digits |
paymentMethod.ExpirationYear | Number | Required | 4 digits |
paymentMethod.cardNumber | String | Required | PCI compliance: don't send cardNumber in clear.Send returned token by /tokenize. |
isMIT | Boolean | Required | Indicates if transaction is CIT or MIT |
isRecurring | Boolean | Required only if isMIT is true. | When true, requires Subscription fields. |
expiryDateUtc | Date-time | Required only if isMIT is true. | Indicates period during which FlexCharge will retry the transaction. |
threeDSecure | Object | Required only if isMIT is true. | 3DS informations on initial transaction. See threeDSecure fields. |
Additional optional fields
mid | String | Optional. Required only for partner integration. |
A string in the format of a GUID |
siteUrl | String | Optional. |
The url where the transaction is coming from. |
senseKey | String | Optional. |
Is a key that is received from SenseJs widget that was embedded on your checkout/payment page. |
orderSource | String | Optional | The source of the order (e.g. ecommerce, installment, etc.) |
transaction | Object | Required | Optional fields for this object: |
transaction.transactionType | String | Optional | The type of transaction |
transaction.responseDescription | String | Optional | The description of the response |
transaction.responseStatus | String | Optional | The status of the response |
transaction.responseSubStatus | String | Optional | The sub-status of the response |
transaction.processorName | String | Optional | The name of the processor |
billingInformation | Object | Required | Optional fields for this object: |
billingInformation.phone | String | Optional field. | |
billingInformation.addressLine2 | String | Optional field. | |
billingInformation.state | String | Optional field. | |
payer | Object | Required | Optional fields for this object: |
payer.id | String | Optional field. | A string in the format of a GUID |
payer.birthdate | Date | Optional field. | The birthdate of the payer |
payer.phone | String | Optional field. | The phone number of the payer |
paymentMethod | Object | Required | Optional fields for this object: |
paymentMethod.cardIssuer | String | Optional field. | |
paymentMethod.cardLevel | String | Optional field. | |
paymentMethod.cardFingerprint | String | Optional field. | |
merchant | Object | Optional | Optional fields for this object: |
merchant.name | String | Optional | The name of the merchant |
merchant.id | String | Optional | A string in the format of a GUID |
merchant.mcc | String | Optional | The merchant category code |
merchant.country | String | Optional | The country of the merchant |
orderItems | Array of objects | Optional | Optional fields for this object: |
orderItems.sku | String | Optional | The SKU of the item |
orderItems.name | String | Optional | The name of the item |
orderItems.description | String | Optional | The description of the item |
orderItems.amount | Integer | Optional | The amount of the item |
orderItems.discountAmount | Integer | Optional | The discount amount on the item |
orderItems.tax | Integer | Optional | The tax on the item |
orderItems.discountType | String | Optional | The discount type on the item |
orderItems.quantity | Integer | Optional | The quantity of this item |
shippingInformation | Object | Optional object | Fields for this object: |
shippingInformation.firstName | String | Required field when shippingInformation object is provided. | |
shippingInformation.lastName | String | Required field when shippingInformation object is provided. | |
shippingInformation.phone | String | Optional field. | |
shippingInformation.country | String | Required field when shippingInformation object is provided. | |
shippingInformation.countryCode | String | Required field when shippingInformation object is provided. | |
shippingInformation.addressLine1 | String | Required field when shippingInformation object is provided. | |
shippingInformation.addressLine2 | String | Optional field. | |
shippingInformation.state | String | Optional field. | |
shippingInformation.city | String | Required field when shippingInformation object is provided. | |
shippingInformation.zipcode | String | Required field when shippingInformation object is provided. | |
subscription | Object | Required only when isRecurring is true. | Fields for this object: |
subscription.subscriptionId | String | Required field when subscription object is provided. | |
subscription.schemeTransactionId | String | Required field when subscription object is provided. | Unique reference of the transaction returned by authorisation server of the issuer. |
subscription.schemeBrand | String | Required field when subscription object is provided. | Eg: 'Visa' |
subscription.interval | String | Required field when subscription object is provided. | Eg 'daily', 'weekly', 'monthly', 'quarterly', 'yearly'. |
subscription.price | String | Required field when subscription object is provided. | In cents. |
subscription.currency | String | Required field when subscription object is provided. | |
subscription.paymentNumber | String | Optional field. | |
subscription.totalPayments | String | Optional field. | threeDSecure | Object | Required only when isMIT is true. | Fields for this object: |
threeDSecure.threeDsVersion | String | Optional field. | Ex: "2.1.0" |
threeDSecure.ecommerceIndicator | String | Required field when threeDSecure object is provided. | |
threeDSecure.authenticationValue | String | Required field when threeDSecure object is provided. | |
threeDSecure.directoryServerTransactionId | String | Required field when threeDSecure object is provided. | |
threeDSecure.xid | String | Optional field. | |
threeDSecure.authenticationValueAlgorithm | String | Optional field. | |
threeDSecure.directoryResponseStatus | String | Optional field. | |
threeDSecure.authenticationResponseStatus | String | Optional field. | |
threeDSecure.enrolled | String | Optional field. | |
additionalFields | Array of objects | Optional | Information that you want to pass onto us: |
additionalFields.key | String | Optional field. | |
additionalFields.value | String | Optional field. |
Request example
POST /v1/evaluate HTTP/1.1
Authorization: bearer Replace with token retrieved by /oauth2/token
Content-Type: application/json
{
"idempotencyKey": "{{$guid}}",
"senseKey": "{{$guid}}",
"mid": "",
"isDeclined": true,
"orderId": "",
"orderSource": "",
"transaction": {
"id": "",
"timezoneUtcOffset": 0,
"transactionType": "",
"amount": 0,
"currency": "usd",
"responseCode": "100",
"responseDescription": "",
"responseStatus": "Approved",
"responseSubStatus": "",
"responseCodeSource": "nmi, etc.",
"processorName": "",
"avsResultCode": "",
"cvvResultCode": "",
"cavvResultCode": "",
"cardNotPresent": true
},
"payer": {
"id": "{{$guid}}",
"birthdate": "2002-03-12",
"email": "[email protected]",
"phone": "+16454534347"
},
"merchant": {
"name": "Merchant name",
"id": "{{$guid}}",
"mcc": 701,
"country": "US"
},
"orderItems": [
{
"sku": "Y43VFG",
"name": "nike air jordan",
"description": "new jordan model 2021",
"amount": 54000,
"discountAmount": 1000,
"discountType": "Fixed",
"quantity": 1,
"tax": 10
}
],
"paymentMethod": {
"holderName": "John Doe",
"cardType": "Debit",
"cardBrand": "VISA",
"cardCountry": "US",
"cardIssuer": "JPMorgan",
"cardLevel": "Classic",
"cardFingerprint": "",
"expirationMonth": 8,
"expirationYear": 2024,
"cardBinNumber": "40311628",
"cardLast4Digits": "4563",
"cardNumber": "4111111111111111"
},
"billingInformation": {
"firstName": "John",
"lastName": "Doe",
"phone": "+16454534347",
"country": "USA",
"countryCode": "US",
"addressLine1": "east 74st",
"addressLine2": "",
"state": "NY",
"city": "New York",
"zipcode": "20100"
},
"shippingInformation": {
"firstName": "John",
"lastName": "Doe",
"phone": "+16454534347",
"country": "USA",
"countryCode": "US",
"addressLine1": "east 74st",
"addressLine2": "",
"state": "NY",
"city": "New York",
"zipcode": "20100"
},
"isRecurring": false,
"additionalFields": [
{
"key": "deviceId",
"value": ""
}
]
}
Response
result | string | Success/Failed |
status | string | For CIT sync calls: APPROVED ; DECLINED For MIT sync calls: APPROVED; DECLINED; EXPIRED; PROCESSING; CANCELLED --- For asynchronous calls: SUBMITTED Use /outcome or webhook to retrieve status on async calls. |
orderSessionKey | guid/uuid | Unique FlexCharge transaction identifier |
senseKey | string | Optional. |
Example response
{
"Result":"Success/Failed",
"Status": "Eligible | NotEligible | Conditional",
"orderSessionKey": "{{$guid}}",
"SenseKey": "same value that was present in request"
}
Updated 5 months ago