Decision

The Decision module performs synchronous analyses of the received data, returning a score and status within seconds.

How the Decision Module Works

The Decision module operates synchronously, analyzing the data immediately after receiving a request. This process involves cross-referencing multiple relevant pieces of information to calculate the score, determine the status, and the result of the request.

The analysis response is returned within seconds, enabling fast decisions integrated into the application's flow, without the need for asynchronous processing or prolonged waiting.


Schema Request

Represents the integration request.

FieldsDescriptionTypeRequired
transactionTransaction informationTransactionYes
transactionValueTransaction value informationTransaction ValueNo
deviceDevice informationDeviceNo
billingBilling informationBillingYes
shippingShipping informationShippingNo
itemsList of transaction itemsItem ArrayNo
paymentsList of payment methodsPayment ArrayNo
airTravelAir travel informationAir TravelNo

Transaction

Represents transaction data.

FieldsDescriptionTypeRequired
codeUnique transaction codeStringYes
dateTransaction dateDateTimeYes
emailEmail associated with the transactionStringYes
statusTransaction statusIntegerNo
ipAddressCustomer IP addressStringNo
originTransaction origin: APP, WEBSITE, TELEVENDAS, etcStringNo
observationAdditional observationsStringNo

Transaction Value

Represents the total transaction value.

FieldsDescriptionTypeRequired
totalValueTotal transaction valueFloatYes

Device

Represents information about the device used in the transaction.

FieldsDescriptionTypeRequired
fingerprintUnique device identifierFingerprintYes

Fingerprint

Represents identification information of the device used in the transaction.

FieldsDescriptionTypeRequired
sessionIdUnique device session identifierGuidYes

Billing

Represents billing information.

FieldsDescriptionTypeRequired
typePerson typeIntegerNo
nameCustomer nameStringYes
emailCustomer emailStringNo
genderCustomer genderStringNo
birthdateCustomer birthdateDateTimeNo
documentsCustomer documentsDocument ArrayYes
addressBilling addressAddressNo
phonesCustomer phonesPhone ArrayYes

Shipping

Represents shipping information.

FieldsDescriptionTypeRequired
typePerson typeIntegerNo
priceShipping priceFloatYes
nameRecipient nameStringYes
emailRecipient emailStringNo
genderRecipient genderStringNo
birthdateRecipient birthdateDateTimeNo
clientIdInternal customer identifier (who made the transaction)StringNo
deliveryTypeDelivery typeIntegerYes
deliveryTimeEstimated delivery timeStringNo
documentsRecipient documentsDocument ArrayNo
addressShipping addressAddressNo
phonesAssociated phonesPhone ArrayNo

Item

Represents a transaction item.

FieldsDescriptionTypeRequired
codeInternal customer item codeStringNo
nameItem nameStringNo
descriptionItem descriptionStringNo
categoryIdInternal customer item category IDIntegerNo
categoryNameItem category name (example table in Glossary)StringNo
barCodeItem barcodeStringNo
valueItem valueFloatYes
quantityItem quantityIntegerYes
isGiftIndicates if the item is a giftBooleanNo
sellerNameSeller nameStringNo
sellerSegmentSeller segmentStringNo
isMarketPlaceIndicates if it is a marketplaceStringNo
shippingCompanyShipping companyStringNo
sellerDocumentSeller documentDocumentYes

Payment

Represents a payment method.

FieldsDescriptionTypeRequired
typePayment typeIntegerYes
valuePayment valueFloatYes
currencyCurrency usedIntegerNo
sequentialPayment sequential numberIntegerNo
paymentDatePayment dateDateTimeNo
installmentsNumber of installmentsIntegerNo
payableTypePayment category within the segment: VOUCHER, SUBSCRIPTION, etcStringNo
interestRateInterest rate applied to the paymentFloatNo
interestValueValue of interest appliedFloatNo
visaCheckoutUserIdVisa Checkout user identifierStringNo
digitalWalletCodeDigital wallet code usedStringNo
voucherOrderOriginVoucher order originStringNo
subAcquirerSubacquirer responsible for the paymentStringNo
bankAuthenticationBank authentication informationStringNo
cardCredit card informationCardYes

Card

Represents credit card information.

FieldsDescriptionTypeRequired
ownerNameCardholder nameStringYes
numberCard numberStringNo
hashCard number hashStringNo
binCard BIN (Bank Identification Number)StringYes
endLast digits of the cardStringYes
typeCard typeIntegerNo
expirationDateCard expiration dateStringNo
documentDocument associated with the cardDocumentNo

Document

Represents a document associated with an entity.

FieldsDescriptionTypeRequired
typeDocument typeIntegerYes
numberDocument numberStringYes
documentTypeCustomerCustomer type associated with the documentStringNo
authorityDocument issuing authorityStringNo
authorityStateIssuing authority stateStringNo
issueDateDocument issue dateStringNo

Address

Represents an address.

FieldsDescriptionTypeRequired
typeAddress typeStringYes
addressIdAddress identifierStringNo
streetStreet nameStringYes
numberAddress numberStringYes
districtDistrictStringNo
cityCityStringYes
stateStateStringYes
zipcodeZip code (00000-000)StringYes
countryCountryStringYes
additionalInformationAdditional informationStringNo
referenceAddress referenceStringNo
latitudeAddress latitudeStringNo
longitudeAddress longitudeStringNo

Phone

Represents information about a phone associated with an entity.

FieldsDescriptionTypeRequired
typePhone typeIntegerNo
countryCodeCountry codeStringNo
areaCodeArea codeStringYes
numberPhone numberStringYes
extensionPhone extensionStringNo

AirTravel

Represents air travel information

FieldsDescriptionTypeRequired
passengersList of air travel passengersPassenger ArrayYes
connectionsList of itinerary connections/segmentsConnection ArrayYes

Passenger

Represents passenger information

FieldsDescriptionTypeRequired
namePassenger nameStringYes
documentTypeDocument typeIntegerYes
documentNumberDocument numberStringYes
companyMileCardCompany mileage cardStringNo
MileCardPersonal mileage cardStringNo
genderPassenger genderStringNo
birthDatePassenger birthdateDateTimeNo
cpfPassenger CPFStringNo

Connection

Represents connection information

FieldDescriptionTypeRequired
companyAirline companyStringNo
flightNumberFlight numberIntegerNo
dateFlight dateDateTimeYes
seatClassSeat classStringNo
originOrigin airportStringYes
destinationDestination airportStringYes
boardingBoarding date/timeDateTimeYes
arrivingArrival date/timeDateTimeYes
fareClassFare classStringNo

Example Request

POST https://homologapix.clearsale.com.br/connect/v1/Integration/{{integrationId}}
Accept: application/json
Content-Type: application/json

{
  "transaction": {
    "code": "string",
    "date": "2025-09-25T15:42:34.935Z",
    "email": "string",
    "status": 0,
    "ipAddress": "string",
    "origin": "string",
    "observation": "string"
  },
  "transactionValue": {
    "totalValue": 0
  },
  "device": {
    "fingerprint": {
      "sessionId": "string"
    }
  },
  "billing": {
    "type": 0,
    "name": "string",
    "email": "string",
    "gender": "string",
    "birthdate": "2025-09-25T15:42:34.935Z",
    "documents": [
      {
        "type": 0,
        "number": "string",
        "documentTypeCustomer": "string",
        "authority": "string",
        "authorityState": "string",
        "issueDate": "string"
      }
    ],
    "address": {
      "type": "string",
      "addressId": "string",
      "street": "string",
      "number": "string",
      "district": "string",
      "city": "string",
      "state": "string",
      "zipcode": "string",
      "country": "string",
      "additionalInformation": "string",
      "reference": "string",
      "latitude": "string",
      "longitude": "string"
    },
    "phones": [
      {
        "type": 0,
        "countryCode": "string",
        "areaCode": "string",
        "number": "string",
        "extension": "string"
      }
    ]
  },
  "shipping": {
    "type": 0,
    "price": 0,
    "name": "string",
    "email": "string",
    "gender": "string",
    "birthdate": "2025-09-25T15:42:34.935Z",
    "clientId": "string",
    "deliveryType": 0,
    "deliveryTime": "string",
    "documents": [
      {
        "type": 0,
        "number": "string",
        "documentTypeCustomer": "string",
        "authority": "string",
        "authorityState": "string",
        "issueDate": "string"
      }
    ],
    "address": {
      "type": "string",
      "addressId": "string",
      "street": "string",
      "number": "string",
      "district": "string",
      "city": "string",
      "state": "string",
      "zipcode": "string",
      "country": "string",
      "additionalInformation": "string",
      "reference": "string",
      "latitude": "string",
      "longitude": "string"
    },
    "phones": [
      {
        "type": 0,
        "countryCode": "string",
        "areaCode": "string",
        "number": "string",
        "extension": "string"
      }
    ]
  },
  "items": [
    {
      "code": "string",
      "name": "string",
      "description": "string",
      "categoryId": 0,
      "categoryName": "string",
      "barCode": "string",
      "value": 0,
      "quantity": 0,
      "isGift": true,
      "sellerName": "string",
      "sellerSegment": "string",
      "isMarketPlace": "string",
      "shippingCompany": "string",
      "sellerDocument": {
        "type": 0,
        "number": "string",
        "documentTypeCustomer": "string",
        "authority": "string",
        "authorityState": "string",
        "issueDate": "string"
      }
    }
  ],
  "payments": [
    {
      "type": 0,
      "value": 0,
      "currency": 0,
      "sequential": 0,
      "paymentDate": "2025-09-25T15:42:34.935Z",
      "installments": 0,
      "payableType": "string",
      "interestRate": 0,
      "interestValue": 0,
      "visaCheckoutUserId": "string",
      "digitalWalletCode": "string",
      "voucherOrderOrigin": "string",
      "subAcquirer": "string",
      "bankAuthentication": "string",
      "card": {
        "ownerName": "string",
        "number": "string",
        "hash": "string",
        "bin": "string",
        "end": "string",
        "type": 0,
        "expirationDate": "string",
        "document": {
          "type": 0,
          "number": "string",
          "documentTypeCustomer": "string",
          "authority": "string",
          "authorityState": "string",
          "issueDate": "string"
        }
      }
    }
  ],
  "airTravel": {
    "passengers": [
      {
        "name": "string",
        "documentType": 0,
        "documentNumber": "string",
        "companyMileCard": "string",
        "mileCard": "string",
        "gender": "string",
        "birthDate": "2025-09-25T15:42:34.935Z",
        "cpf": "string"
      }
    ],
    "connections": [
      {
        "company": "string",
        "flightNumber": 0,
        "date": "2025-09-25T15:42:34.935Z",
        "seatClass": "string",
        "origin": "string",
        "destination": "string",
        "boarding": "2025-09-25T15:42:34.935Z",
        "arriving": "2025-09-25T15:42:34.935Z",
        "fareClass": "string"
      }
    ]
  }
}

Response POST

Represents the integration execution response. If you have contracted more than one module, you may receive all at once. What is not contracted will not be returned.


Result

FieldsDescriptionTypeRequired
executionIdExecution IDGuidYes
analysisIdAnalysis IDGuidYes
transactionIdTransaction IDStringYes
decisionDecision resultDecision ResultNo

Decision Result

Represents the result of a decision.

FieldsDescriptionTypeRequired
statusDecision statusStringYes
scoreScore associated with the decisionFloatNo
resultDecision resultStringNo
metadataAdditional metadataObjectNo

JSON

{
  "executionId": "string",
  "analysisId": "string",
  "transactionId": "string",
  "decision": {
    "status": "string",
    "score": 0,
    "result": "string",
    "metadata": {}
  }
}

Response GET

Represents the execution response of the analysis query.


Result

FieldsDescriptionTypeRequired
analysisIdAnalysis IDGuidYes
transactionIdTransaction IDStringYes
decisionDecision resultDecision ResultNo

Decision Result

Represents the result of a decision.

FieldsDescriptionTypeRequired
statusDecision statusStringYes
scoreScore associated with the decisionFloatNo
resultDecision resultStringNo

JSON

{
  "analysisId": "string",
  "transactionId": "string",
  "decision": {
    "status": "string",
    "score": 0,
    "result": "string"
  }
}

Response Error

Represents the details of a problem returned by the API in case of error.

FieldsDescriptionTypeRequired
typeURI identifying the specific problem type. Can be used to categorize the error.StringNo
titleDescriptive title of the problemStringYes
statusHTTP status code associated with the problemIntegerYes
errorsValidation errorsObjectYes
instanceURI identifying the specific problem instanceStringNo

JSON

{
  "errors": {
    "string": [
      "string"
    ]
  },
  "type": "string",
  "title": "string",
  "status": 0,
  "traceId": "string"
}