Risk Assessment
Risk Check
The Risk Check feature allows you to integrate external fraud-prevention providers directly into the checkout process.
This enables automatic evaluation of an order’s risk level and the execution of predefined actions such as blocking confirmation, disabling payment methods, or displaying customer notifications.
SCAYLE will activate this feature for you on request. Please contact your SCAYLE Account Manager for further information.
Once API credentials are configured and the feature is activated, the checkout will send requests to your configured endpoint.
The provider’s response is stored in the order.customData.score property and can be referenced in the Rule Engine.
How it works
- The customer has provided billing and shipping addresses, selected delivery and shipping options, and chosen a payment method.
- When the customer proceeds to complete the order (by clicking Buy now):
- A HTTP call is sent to your custom middleware containing the order data
- The middleware returns a response, which is stored in
order.custom_data - The Rule Engine applies rules from the
automated_risk_assessmentgroup - Rules can reference values returned in the risk check response
- If no rule applies, the order will be confirmed successfully.
- The checkout also stores the last risk check result within the customer object for use in future interactions.
- Based on the configured rule actions, the checkout can:
- Reject the order
- Disable one or more payment methods
- Show a notification to the customer
How to implement the HTTP service
You must provide an HTTP service that can handle the expected traffic of your shop and accept incoming requests from the SCAYLE network.
If you intend to restrict access by IP address, please contact your SCAYLE Account Manager to obtain the list of SCAYLE network ranges.
The service must expose a POST endpoint that conforms to the following schema:
Request
Your endpoint needs to be able to serve the following request.
Authentication
Basic auth according to SCAYLE Panel configuration.
Headers
| Parameter | Details |
|---|---|
| X-Shop-Id | Integer The current shop-country id |
Body
Request example
Request schema
idintegeraddressobject (optional)billingobjectidintegeradditionalstring ([!-ɏ0-9 ]) (optional)citystring ([!-ɏ0-9 ])collectionPointobject (optional)countryCodestring (minimum length: ) (maximum length: 3)houseNumberstring ([!-ɏ0-9 ])isDefaultobjectrecipientobjectreferenceKeystring (^[0-9a-zA-Z\-\\_\.\@]*$) (optional) (minimum length: ) (maximum length: 100)streetstring ([!-ɏ0-9 ])titlestring ([!-ɏ0-9 ]) (optional)zipCodestring ([A-z0-9\- ]{1,12})
forwardobject (optional)additionalstring ([!-ɏ0-9 ]) (optional)citystring ([!-ɏ0-9 ]) (optional)collectionPointobject (optional)countryCodestring (optional) (minimum length: ) (maximum length: 3)houseNumberstring ([!-ɏ0-9 ]) (optional)recipientobject (optional)streetstring ([!-ɏ0-9 ]) (optional)zipCodestring ([A-z0-9\- ]{1,12}) (optional)createdAtstring (date-timevalidation) (optional)updatedAtstring (date-timevalidation) (optional)
shippingobjectidintegeradditionalstring ([!-ɏ0-9 ]) (optional)citystring ([!-ɏ0-9 ])collectionPointobject (optional)countryCodestring (minimum length: ) (maximum length: 3)houseNumberstring ([!-ɏ0-9 ])isDefaultobjectrecipientobjectreferenceKeystring (^[0-9a-zA-Z\-\\_\.\@]*$) (optional) (minimum length: ) (maximum length: 100)streetstring ([!-ɏ0-9 ])titlestring ([!-ɏ0-9 ]) (optional)zipCodestring ([A-z0-9\- ]{1,12})
basketKeystring
campaignKeystring (optional)
client**** (optional)
confirmedAtstring (date-timevalidation) (optional)
costobjectwithoutTaxintegerwithTaxinteger
currencyCodestring (^([A-Z]{3})$)
customDataobject (optional) (object is extensible as desired)
customerobject (optional)idintegerauthenticationobject (optional)dataobject (optional)typeenum (facebookpassword)
birthDatestring (^((19|20)[0-9]{2}\-[0-9]{2}\-[0-9]{2})$) (optional)customDataobject (optional) (object is extensible as desired)emailstring (emailvalidation) (optional) (maximum length: 50)firstNamestring ([!-ɏ0-9 ])genderenum (mfd) (optional)groupsarray (optional)itemstring (^[0-9a-zA-Z\-\\_]*$) (optional) (minimum length: ) (maximum length: 60)
lastNamestring ([!-ɏ0-9 ])phonestring (00[0-9]{1,3}/[0-9]{1,20}) (optional)publicKeystring (^[0-9a-zA-Z\-\\_]*$) (optional) (minimum length: ) (maximum length: 100)referenceKeystring (^[0-9a-zA-Z\-\\_\.\@]*$) (optional) (minimum length: ) (maximum length: 100)statusobjectisActivebooleanisGuestCustomerbooleanisTestCustomerboolean
titlestring ([!-ɏ0-9 ]) (optional) (minimum length: ) (maximum length: 100)typeenum (personalretailorganizationfamily) (optional)createdAtstring (date-timevalidation)updatedAtstring (date-timevalidation)
invoicedAtstring (date-timevalidation) (optional)
itemsarray (optional)availableQuantityinteger (optional)customDataobject (optional) (object is extensible as desired)deliveryForecastobject (optional)deliverableobjectsubsequentDeliveryobject
itemGroup**** (optional)keystringpackageIdintegerpriceobjectappliedReductionsarray (optional)referenceobject (optional)taxobject (object is extensible as desired)withoutTaxintegerwithTaxinteger
productobjectidintegeradvancedAttributesobject (optional) (object is extensible as desired)attributesobject (optional) (object is extensible as desired)categoriesarray (optional)definingAttributesarray (optional)imagesarraymasterKeystring (optional)namestringcreatedAtstring (date-timevalidation)updatedAtstring (date-timevalidation)
reservationKeystring (optional)statusenum (availableunavailabledeliverableundeliverablecancelled)variantobjectidintegeradvancedAttributesobject (optional) (object is extensible as desired)attributesobject (optional) (object is extensible as desired)referenceKeystring (optional)stockobject (optional)createdAtstring (date-timevalidation)updatedAtstring (date-timevalidation)
warehouseIdinteger (optional)createdAtstring (date-timevalidation)updatedAtstring (date-timevalidation)
loyaltyCardobject (optional)cardNumberstringpointsintegerproviderstring ([A-Za-z])
packagesarray (optional)idintegercarrierKeystringdeliveryDateobjectmaximumstring ([0-9]{4}\-[0-9]{2}\-[0-9]{2})minimumstring ([0-9]{4}\-[0-9]{2}\-[0-9]{2})
deliveryStatusenum (openshipment_pendingdelegation_pendingshipment_completedcancellation_completed)returnIdentCodenull,string (optional)shipmentKeystring (optional)trackingobject (optional)idstring (optional) (minimum length: )urlstring (urivalidation) (optional)
paymentarray (optional)amountinteger (optional)dataobject (optional) (object is extensible as desired)installmentarray (optional)amountinteger (optional)typeenum (annualInterestfirstInstallmentinstallmentAdditionpaymentMethodCostssubsequentInstallmentsvalutaAddition) (optional)
keystring (optional)optionsobject (optional)countOfInstallmentsinteger (optional)hasPaybreakboolean (optional)
transactionKeystring (optional)
preferredobject (optional)carrierKeystring (optional)deliveryPolicyenum (least_packageshighest_stocksfastest_shipping) (optional)
publicKeystring (^[0-9a-zA-Z\-\\_]*$) (optional) (minimum length: ) (maximum length: 100)
referenceKeystring (^[0-9a-zA-Z\-\\_\.\@]*$) (optional) (minimum length: ) (maximum length: 100)
shippingobject (optional)deliveredOnstring ([0-9]{4}\-[0-9]{2}\-[0-9]{2}) (optional)deliveryCostsinteger (optional)expressDeliveryCostsinteger (optional)policystring (^[0-9a-zA-Z\-\\_]*$) (minimum length: )
shopobject (optional)idintegercountrystring (^([A-Z]{3})$)languagestring (^([a-z]{2})$)
statusenum (order_openpayment_pendingpayment_reservedinvoice_completedcancellation_pendingcancellation_completedinvoice_partially_completed)
vouchersarray (optional)idintegerapplicableItemsarray (optional)isAppliedboolean (optional)keystring (optional)
codestring ([A-z0-9]{0,12})typeenum (absoluterelative)valuenumber
createdAtstring (date-timevalidation)
updatedAtstring (date-timevalidation)
Response
Your service needs to follow this specification when handling the checkout request.
Response body
| Parameter | Details |
|---|---|
| result | Any enum,object,array,number,string |
The response body will be written to the order.customData.score property. Additionally, you may define a custom value set and use this as a reference via the rule engine rules.
Response Examples
green/red based
value based
request failed
Properties:
resultenum,object,array,number,string,… (optional)
Status Codes:
| Code | Description | Response Body |
|---|---|---|
201 | request was successful | |
401 | authentication failed | empty |
Handling failed requests
In situations with high traffic or temporary service issues, your risk check provider (or your middleware) may fail to respond in time.
When this happens, the order object will not be updated — meaning either no new value is written, or the previously stored value remains available.
If the response is empty or does not return a 201 status code, the property order.customData.score will be set to failed.
Using the Rule Engine with Risk Assessment Results
After a risk assessment, the provider’s response is stored on the order object.
For example, if your risk evaluation is value-based and the customer receives a score of 0.7, the order will contain:
You can now create a rule in the Rule Engine that references this value and applies the appropriate action (e.g., block order confirmation, restrict certain payment methods, or trigger a notification).
Example: Reject Orders with High Risk Score
Let’s assume your fraud provider returns a risk score between 0.0 (no risk) and 1.0 (very high risk).
If you want to reject orders with a score of 0.7 or higher, you can set up the following rule:
Rule Configuration
- General
- Name: Reject high-risk orders
- Description: Reject orders where the risk score is 0.7 or higher
- Condition
- Object: order
- Attribute: customData.score
- Operator: >=
- Value: 0.7
- Result
- Action: Reject order
- Optional: Display notification to customer (e.g., “Your order could not be processed.”)
Example: Restrict Payment Methods Based on Risk Score
You may prefer to allow the order but restrict risky payment methods.
For example: if score ≥ 0.5, disable Credit Card and PayPal.
- Condition
- Object: order
- Attribute: customData.score
- Operator: >=
- Value: 0.5
- Result
- Action: Disable payment method
- Methods: Credit Card, PayPal
You can always have multiple rules and actions in place if you want to combine them.