# Contracts - Fraud Validation
###### tags: `FraudValidation`
---
List of API calls:
1. POST Fraud Validation
2. ATTACH Fraud Validation
3. GET Fraud Validation
4. Fraud Validation update - for Async flow (push update to BU webhook)
5. Webhook - in case of pending review cases
---
## POST_Fraud_validation.json**
```
{
"data": {
"paymentIntentMethodId": "uuid", // Optional (only pass if Fraud validation is done during or after the transaction)
"fraudHandleId": "string", //Digital fingerprint (orderId for CyberSource)
"order": {
//required for populating the order details
"orderId": "uuid", //Mandatory
"orderNumber": "string", //Mandatory
"invoiceType": "string",
"orderLines": [
//mandatory
{
"orderLineId": "uuid", //optional
"orderLineNumber": "string", //optional
"item": {
//Mandatory
"productId": "string", //Mandatory
"variantId": "string", //Mandatory
"offeringId": "string", //Mandatory
"sellerId": "string",
"displayName": "string",
"brandId": "string",
"brandName": "string",
"productType": "string"
},
"parentLineId": "uuid",
"quantity": {
//Mandatory
"quantityNumber": "string", //Mandatory
"quantityUnit": "string"
},
"priceType": "string", //mandatory
"priceGroup": "string",
"unitPrice": {
//mandatory
"centAmount": 0, //Mandatory
"currency": "string", //Mandatory
"fraction": 0 //Mandatory
},
"taxInfo": {
//optional
"taxIncluded": "boolean",
"tax": [
{
"taxCode": "string",
"taxRate": 0,
"taxType": "string",
"taxAmount": {
"currency": "string",
"centAmount": 0,
"fraction": 0
}
}
]
}
}
],
"recipient": {
//optional
"recipientName": {
"firstName": "string",
"lastName1": "string",
"lastName2": "string",
"middleName": "string",
"salutation": "string",
"suffix": "string"
},
"recipientIdentityDocument": {
//optional
"category": "string",
"country": "string",
"id": "string",
"isVerified": "boolean",
"type": "string"
}
},
"billingAddress": {
//optional
"addressLine1": "string", //Mandatory
"addressLine2": "string",
"addressLine3": "string",
"municipal": "string",
"city": "string", //Mandatory
"state": "string", //Mandatory
"country": "string", //Mandatory
"postCode": "string", //Mandatory
"email": "string",
"latitude": "string",
"longitude": "string",
"phoneNumber": {
"countryCode": "string", //Mandatory
"number": "string", //Mandatory
"type": "string",
"availability": "string",
"isVerified": "boolean"
},
"fax": {
"countryCode": "string", //Mandatory
"number": "string", //Mandatory
"type": "string",
"availability": "string",
"isVerified": "boolean"
}
},
"shippingAddress": {
//optional
"addressLine1": "string", //Mandatory
"addressLine2": "string",
"addressLine3": "string",
"municipal": "string",
"city": "string", //Mandatory
"state": "string", //Mandatory
"country": "string", //Mandatory
"postCode": "string", //Mandatory
"email": "string",
"latitude": "string",
"longitude": "string",
"phoneNumber": {
"countryCode": "string", //Mandatory
"number": "string", //Mandatory
"type": "string",
"availability": "string",
"isVerified": "boolean"
},
"fax": {
//optional
"countryCode": "string", //Mandatory
"number": "string", //Mandatory
"type": "string",
"availability": "string",
"isVerified": "boolean"
}
},
"orderChannel": {
//optional
"channel": "enum",
"channelInfo": [
{
"id": "string",
"type": "string",
"name": "string", //Mandatory
"description": "string",
"values": ["string"],
"order": 0,
"group": "string",
"isMandatory": "boolean",
"metadata": "JSON"
}
]
}
},
"total": {
//total price of the order along with adjustments //mandatory
"amount": {
//Mandatory
"centAmount": 0, //Mandatory
"currency": "string", //Mandatory
"fraction": 0 //Mandatory
},
"adjustments": [
//optional
{
"paymentOptionId": "guid", // optional(not required for timed deals)
"adjustmentReference": "string",
"adjustmentReferenceDetail": "string",
"adjustmentMultiplier": -1, //Mandatory
"allocationRule": "enum", //ALL_APPLICABLE, ALL, ONLY_ONE
"adjustmentAmount": {
//Mandatory
"centAmount": 0, //Mandatory
"currency": "string", //Mandatory
"fraction": 0 //Mandatory
},
"timedDeal": {
"isTimedDeal": "boolean", //Mandatory
"timedDealStart": "timestamp",
"timedDealDurationInSec": "string"
}
}
]
},
"user": {
//required for populating the bill-to information on the fraud screening //mandatory
"userId": "uuid", //Mandatory
"userName": {
//mandatory
"salutation": "string",
"firstName": "string", //mandatory
"middleName": "string",
"lastName1": "string", //mandatory
"lastName2": "string",
"suffix": "string"
},
"userType": "string",
"primaryPhone": {
"countryCode": "string", //mandatory
"number": "string", //mandatory
"type": "string",
"availability": "string",
"isVerified": "boolean"
},
"document": {
//optional
"category": "string", //mandatory
"country": "string", //mandatory
"id": "string", //mandatory
"isVerified": "boolean",
"type": "string"
},
"email": {
//optional
"emailId": "string", //mandatory
"isVerified": "boolean"
}
},
"payment": {
"method": "string", //mandatory
"paymentOptionId": "uuid", //mandatory
"methodData": "JSONB" //JSONB and depends on the method
},
"customInfo": [
{
"id": "string",
"type": "string",
"name": "string",
"description": "string",
"values": ["string"],
"order": 0,
"group": "string",
"isMandatory": "boolean",
"metadata": "JSON"
}
],
"digitalFingerprint": {
//Required from the BU end if the CS SDK isn't integrated
"fp": [
{
"fpType": "string",
"fpValue": "string"
}
],
"fpTime": "2019-10-25T17:22:50.249Z"
},
"audit": {
"apiVersion": "string",
"createdAt": "2019-10-25T17:22:50.249Z", //mandatory
"createdBy": "uuid", //mandatory
"lastModifiedAt": "2019-10-25T17:22:50.249Z",
"lastModifiedBy": "uuid"
}
}
}
```
Response - POST_Fraud_validation.json
```
{
data:{
"fraudValidationId": "uuid", //generated by the core payments domain
"fraudValidationCode": "string", // Decision of the transaction from the fraud validation provider
"fraudInfo": {
"provider": "string",
"riskScore": "string",
"fraudType": "string", //The type of fraud labelled by the issuer. One of card_never_received, fraudulent_card_application, made_with_counterfeit_card, made_with_lost_card, made_with_stolen_card, misc, unauthorized_use_of_card
"fraudReason": "string",
},
}
}
```
"fraudValidationCode" - this can have one of the following values [ACCEPTED, PENDING_REVIEW, REJECTED, FAILED, PENDING, PENDING_AUTHENTICATION]
"fraudType" - will contain a set of specified values [TBD mapping from generic fraud responses to Core Values]
Call to CyberSource DM
```
{
"data": {
"user": {
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"userName": {
"salutation": "Mr",
"firstName": "John",
"middleName": "Super",
"lastName1": "Doe",
"lastName2": "Awesome",
"suffix": "Jr"
},
"userType": "identified",
"primaryPhone": {
"countryCode": "CHL",
"number": "148098989",
"type": "prepaid",
"availability": "yes",
"isVerified": true
},
"document": {
"category": "proofs",
"country": "chile",
"id": "doc_1234",
"isVerified": true,
"type": "rut"
},
"email": {
"emailId": "johndoe@example.com",
"isVerified": true
}
},
"order": {
"orderId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"orderNumber": "1234567890137",
"invoiceType": "BOLETA",
"orderLines": [
{
"lineId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"lineNumber": "1234123422",
"parentLineId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"item": {
"productId": "prod_id_1",
"variantId": "variant_id_1",
"offeringId": "offering_id_1",
"sellerId": "seller_id_1",
"displayName": "Some display name",
"brandId": "brand_id_1",
"brandName": "Some brand name",
"productType": "Some product type"
},
"quantity": {
"quantityNumber": "3",
"quantityUnit": "kg"
},
"priceType": "PriceType",
"priceGroup": "PriceGroup",
"unitPrice": {
"centAmount": 10000,
"currency": "CLP",
"fraction": 100
},
"taxInfo": {
"taxIncluded": false,
"tax": [
{
"taxCode": "TaxCode",
"taxRate": 0,
"taxType": "TaxType",
"taxAmount": {
"currency": "CLP",
"centAmount": 1,
"fraction": 100
}
}
]
}
}
],
"recipient": {
"recipientName": {
"salutation": "Mr",
"firstName": "John",
"middleName": "Super",
"lastName1": "Doe",
"lastName2": "Awesome",
"suffix": "Jr"
},
"recipientIdentityDocument": {
"category": "CAT_01",
"country": "IND",
"id": "ID_01",
"isVerified": true,
"type": "TYPE_01"
}
},
"billingAddress": {
"addressLine1": "address line 1",
"addressLine2": "address line 2",
"addressLine3": "address line 3",
"municipal": "Municipal",
"city": "Bangalore",
"state": "KA",
"country": "IND",
"postCode": "560000",
"email": "johndoe@example.com",
"latitude": "12.345",
"longitude": "98.765",
"phoneNumber": {
"countryCode": "91",
"number": "9800000000",
"type": "primary",
"availability": "yes",
"isVerified": true
},
"fax": {
"countryCode": "91",
"number": "9800000000",
"type": "primary",
"availability": "yes",
"isVerified": true
}
},
"shippingAddress": {
"addressLine1": "address line 1",
"addressLine2": "address line 2",
"addressLine3": "address line 3",
"municipal": "Municipal",
"city": "Bangalore",
"state": "KA",
"country": "IND",
"postCode": "560000",
"email": "johndoe@example.com",
"latitude": "12.345",
"longitude": "98.765",
"phoneNumber": {
"countryCode": "91",
"number": "9800000000",
"type": "primary",
"availability": "yes",
"isVerified": true
},
"fax": {
"countryCode": "91",
"number": "9800000000",
"type": "primary",
"availability": "yes",
"isVerified": true
}
},
"orderChannel": {
"channel": "string",
"channelInfo": [
{
"id": "string",
"name": "string",
"type": "string",
"values": [
"string"
]
}
]
},
"customInfo": [
{
"id": "string",
"type": "string",
"name": "string",
"description": "string",
"values": [
"string"
],
"order": 0,
"group": "string",
"isMandatory": true,
"metadata": {}
}
]
},
"total": {
"amount": {
"centAmount": 30000,
"currency": "CLP",
"fraction": 100
},
"adjustments": [
{
"paymentOptionId": "e39c5b85-6ea6-4752-b0b7-8742d43b94f6",
"adjustmentReference": "adjRef",
"adjustmentReferenceDetail": "adjRefDetail",
"adjustmentMultiplier": -1,
"allocationRule": "ALL",
"adjustmentAmount": {
"centAmount": 10000,
"currency": "CLP",
"fraction": 100
},
"timedDeal": {
"isTimedDeal": true,
"timedDealStart": "2019-10-25T17:22:50.249Z",
"timedDealDurationInSec": "300"
}
}
]
},
"digitalFingerprint": {
"fp": [
{
"fpType": "fpType1",
"fpValue": "fpValue1"
}
],
"fpTime": "2019-10-25T17:22:50.249Z"
},
"audit": {
"createdAt": "2019-10-25T17:22:50.249Z",
"createdBy": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"lastModifiedAt": "2019-10-25T17:22:50.249Z",
"lastModifiedBy": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"payment": {
"method": "string",
"paymentOptionId": "e39c5b85-6ea6-4752-b0b7-8742d43b94f6",
"methodData": {
"provider": "visa",
"issuingBank": "Banco Falabella",
"merchantId": "m123",
"cardToken": "4448",
"bin": "bin123",
"last4Digits": "l4d7890",
"expiry": {
"month": "10",
"year": "0"
},
"isAllowedWithoutCVV": true
}
},
"customInfo": [
{
"id": "string",
"type": "string",
"name": "mdd1",
"description": "string",
"values": [
"maddval1",
"maddval2"
],
"order": 0,
"group": "string",
"isMandatory": true,
"metadata": {}
},
{
"id": "string",
"type": "string",
"name": "mdd2",
"description": "string",
"values": [
"maddval3",
"maddval4"
],
"order": 0,
"group": "string",
"isMandatory": true,
"metadata": {}
}
]
}
}
```
---
Domain - Fraud_validation.json
```
{
data:{
"fraudValidationId": "uuid", //generated by the core payments domain
"fraudHandleId": "string", //Transaction ID from the Fraud Screening Partner
"fraudValidationCode": "string", // Decision of the transaction from the fraud validation provider
"fraudInfo": {
"provider": "string",
"riskScore": "string",
"fraudType": "string", //The type of fraud labelled by the issuer. One of card_never_received, fraudulent_card_application, made_with_counterfeit_card, made_with_lost_card, made_with_stolen_card, misc, unauthorized_use_of_card
"fraudReason": "string", //19.Dec
"request": "JSON",
"response": "JSON"
},
}
}
```
card_never_received -
fraudulent_card_application
made_with_counterfeit_card
made_with_lost_card
made_with_stolen_card
misc
unauthorized_use_of_card
---
## ATTACH Fraud Validation - if Fraud Validation is not done through Core
```
{
"data": {
"paymentIntentMethod": {
"fraudValidationCode": "string",
"fraudHandleId": "string",
"fraudInfo": {
"provider": "string",
"riskScore": "string",
"fraudType": "string",
"fraudReason": "string",
"request": "string",
"response": "string"
},
"customInfo": [
{
"id": "string",
"name": "string",
"type": "string",
"values": [
"string"
],
"description": "string",
"order": 0,
"group": "string",
"isMandatory": true,
"metadata": {}
}
]
}
}
}
```
## ATTACH Fraud Validation - if Fraud Validation is done through Core
```
{
"data": {
"paymentIntentMethod": {
"fraudValidationId": "string",
"customInfo": [
{
"id": "string",
"name": "string",
"type": "string",
"values": [
"string"
],
"description": "string",
"order": 0,
"group": "string",
"isMandatory": true,
"metadata": {}
}
]
}
}
}
```
## Response to Attach Fraud Validation
```
{
data:{
"fraudValidationId": "uuid", //generated by the core payments domain
"fraudValidationCode": "string", // Decision of the transaction from the fraud validation provider
"fraudInfo": {
"provider": "string",
"riskScore": "string",
"fraudType": "string", //The type of fraud labelled by the issuer. One of card_never_received, fraudulent_card_application, made_with_counterfeit_card, made_with_lost_card, made_with_stolen_card, misc, unauthorized_use_of_card
"fraudReason": "string",
},
}
}
```
---
## GET Fraud Validation by fraudValidationId
### Response to GET
```
{
data:{
"fraudValidationId": "uuid", //generated by the core payments domain
"fraudValidationCode": "string", // Decision of the transaction from the fraud validation provider
"fraudInfo": {
"provider": "string",
"riskScore": "string",
"fraudType": "string", //The type of fraud labelled by the issuer. One of card_never_received, fraudulent_card_application, made_with_counterfeit_card, made_with_lost_card, made_with_stolen_card, misc, unauthorized_use_of_card
"fraudReason": "string",
},
}
}
```
- UML diagrams
```sequence
BU->CorePayments: Fraud Validation Reuqest
Note right of CorePayments: asdfasdf
CorePayments-->FraudScreeningSystem: Fraud Screening Request
Note right of FraudScreeningSystem: Perform Fraud Screening
FraudScreeningSystem->CorePayments: Fraud Screening Result
BU->CorePayments: Attach Fraud Info to PI/PIM
FraudScreeningSystem->CorePayments: Review Update Result
CorePayments->BU: Event [Review Result Update]
```
## Event - if attach call is made
```
{
data:{
"fraudValidationId": "uuid",
"fraudValidationCode": "string",
"paymentIntentId": "UUID",
"paymentIntentMethodId": "UUID",
"fraudInfo": {
"provider": "string",
"riskScore": "string",
"fraudType": "string", //The type of fraud labelled by the issuer. One of card_never_received, fraudulent_card_application, made_with_counterfeit_card, made_with_lost_card, made_with_stolen_card, misc, unauthorized_use_of_card
"fraudReason": "string",
},
}
}
```
## Event - if attach call has not been made
```
{
data:{
"fraudValidationId": "uuid",
"fraudValidationCode": "string",
"fraudInfo": {
"provider": "string",
"riskScore": "string",
"fraudType": "string", //The type of fraud labelled by the issuer. One of card_never_received, fraudulent_card_application, made_with_counterfeit_card, made_with_lost_card, made_with_stolen_card, misc, unauthorized_use_of_card
"fraudReason": "string",
},
}
}
```