Insights
The Insights module performs synchronous analysis of the received data, returning score, status, and insights within a few seconds.
How the Insights Module Works
Insights Module WorksThe Insights 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 provide the insights of the analysis.
The analysis response is returned within seconds, enabling quick insightss that are integrated into the application's flow, without the need for asynchronous processing or prolonged waiting.
Request Schema
Represents the integration request.
| Fields | Description | Type | Required |
|---|---|---|---|
| transaction | Transaction information | Transaction | Yes |
| transactionValue | Transaction value information | Transaction Value | No |
| device | Device information | Device | No |
| billing | Billing information | Billing | Yes |
| shipping | Shipping information | Shipping | No |
| items | List of transaction items | Item Array | No |
| payments | List of payment methods | Payment Array | No |
| airTravel | Air travel information | Air Travel | No |
Transaction
Represents the transaction data.
| Fields | Description | Type | Required |
|---|---|---|---|
| code | Unique transaction code | String | Yes |
| date | Transaction date | DateTime | Yes |
| Email associated with the transaction | String | Yes | |
| status | Transaction status | Integer | No |
| ipAddress | Customer's IP address | String | No |
| origin | Transaction origin: APP, WEBSITE, TELEVENDAS, etc. | String | No |
| observation | Additional observations | String | No |
Transaction Value
Represents the total value of the transaction.
| Fields | Description | Type | Required |
|---|---|---|---|
| totalValue | Total value of the transaction | Float | Yes |
Device
Represents information about the device used in the transaction.
| Fields | Description | Type | Required |
|---|---|---|---|
| fingerprint | Unique device identifier | Fingerprint | Yes |
Fingerprint
Represents the identification information of the device used in the transaction.
| Fields | Description | Type | Required |
|---|---|---|---|
| sessionId | Unique session identifier of the device | Guid | Yes |
Billing
Represents billing information.
| Fields | Description | Type | Required |
|---|---|---|---|
| type | Person type | Integer | No |
| name | Customer name | String | Yes |
| Customer email | String | No | |
| gender | Customer gender | String | No |
| birthdate | Date of birth | DateTime | No |
| documents | Documents associated with customer | Document Array | Yes |
| address | Billing address | Address | No |
| phones | Customer's associated phones | Phone Array | Yes |
Shipping
Represents shipping information.
| Fields | Description | Type | Required |
|---|---|---|---|
| type | Person type | Integer | No |
| price | Shipping price | Float | Yes |
| name | Recipient's name | String | Yes |
| Recipient's email | String | No | |
| gender | Recipient's gender | String | No |
| birthdate | Recipient's date of birth | DateTime | No |
| clientId | Internal customer identifier (who made the transaction) | String | No |
| deliveryType | Delivery type | Integer | Yes |
| deliveryTime | Estimated delivery time | String | No |
| documents | Documents associated with the recipient | Document Array | No |
| address | Shipping address | Address | No |
| phones | Associated phones | Phone Array | No |
Item
Represents a transaction item.
| Fields | Description | Type | Required |
|---|---|---|---|
| code | Customer's internal item code | String | No |
| name | Item name | String | No |
| description | Item description | String | No |
| categoryId | Customer's internal item category ID | Integer | No |
| categoryName | Item category name (see example table in Glossary) | String | No |
| barCode | Item barcode | String | No |
| value | Item value | Float | Yes |
| quantity | Item quantity | Integer | Yes |
| isGift | Indicates if the item is a gift | Boolean | No |
| sellerName | Seller's name | String | No |
| sellerSegment | Seller's segment | String | No |
| isMarketPlace | Indicates if it is a marketplace | String | No |
| shippingCompany | Shipping company | String | No |
| sellerDocument | Seller's document | Document | Yes |
Payment
Represents a payment method.
| Fields | Description | Type | Required |
|---|---|---|---|
| type | Payment type | Integer | Yes |
| value | Payment amount | Float | Yes |
| currency | Currency used | Integer | No |
| sequential | Payment sequential number | Integer | No |
| paymentDate | Payment date | DateTime | No |
| installments | Number of installments | Integer | No |
| payableType | Payment category within the segment: VOUCHER, SUBSCRIPTION, etc. | String | No |
| interestRate | Interest rate applied to the payment | Float | No |
| interestValue | Interest amount applied | Float | No |
| visaCheckoutUserId | Visa Checkout user identifier | String | No |
| digitalWalletCode | Digital wallet code used | String | No |
| voucherOrderOrigin | Voucher order origin | String | No |
| subAcquirer | Sub-acquirer responsible for the payment | String | No |
| bankAuthentication | Bank authentication information | String | No |
| card | Credit card information | Card | Yes |
Card
Represents credit card information.
| Fields | Description | Type | Required |
|---|---|---|---|
| ownerName | Cardholder's name | String | Yes |
| number | Card number | String | No |
| hash | Card number hash | String | No |
| bin | Card BIN (Bank Identification Number) | String | Yes |
| end | Last digits of the card | String | Yes |
| type | Card type | Integer | No |
| expirationDate | Card expiration date | String | No |
| document | Document associated with the card | Document | No |
Document
Represents a document associated with an entity.
| Fields | Description | Type | Required |
|---|---|---|---|
| type | Document type | Integer | Yes |
| number | Document number | String | Yes |
| documentTypeCustomer | Customer type associated with document | String | No |
| authority | Document issuing authority | String | No |
| authorityState | Issuing authority state | String | No |
| issueDate | Document issue date | String | No |
Address
Represents an address.
| Fields | Description | Type | Required |
|---|---|---|---|
| type | Address type | String | Yes |
| addressId | Address identifier | String | No |
| street | Street name | String | Yes |
| number | Address number | String | Yes |
| district | District | String | No |
| city | City | String | Yes |
| state | State | String | Yes |
| zipcode | Postal code (00000-000) | String | Yes |
| country | Country | String | Yes |
| additionalInformation | Additional information | String | No |
| reference | Address reference | String | No |
| latitude | Address latitude | String | No |
| longitude | Address longitude | String | No |
Phone
Represents the information of a phone associated with an entity.
| Fields | Description | Type | Required |
|---|---|---|---|
| type | Phone type | Integer | No |
| countryCode | Country code | String | No |
| areaCode | Area code | String | Yes |
| number | Phone number | String | Yes |
| extension | Phone extension | String | No |
AirTravel
Represents air travel information
| Fields | Description | Type | Required |
|---|---|---|---|
| passengers | List of air travel passengers | Passenger Array | Yes |
| connections | List of itinerary connections/segments | Connection Array | Yes |
Passenger
Represents passenger information
Connection
Represents connection information
| Field | Description | Type | Required |
|---|---|---|---|
| company | Airline company | String | No |
| flightNumber | Flight number | Integer | No |
| date | Flight date | DateTime | Yes |
| seatClass | Seat class | String | No |
| origin | Origin airport | String | Yes |
| destination | Destination airport | String | Yes |
| boarding | Boarding date/time | DateTime | Yes |
| arriving | Arrival date/time | DateTime | Yes |
| fareClass | Fare class | String | No |
Exemplo 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 execution response of the integration. If you have contracted more than one module, you may receive all at once. Any module not contracted will not be returned.
Result
| Fields | Description | Type | Required |
|---|---|---|---|
| executionId | Execution ID | Guid | Yes |
| analysisId | Analysis ID | Guid | Yes |
| transactionId | Transaction ID | String | Yes |
| insights | Insights results | Insights Result | No |
Insights Result
Represents the insights generated by the analysis.
| Fields | Description | Type | Required |
|---|---|---|---|
| status | Insights status | String | Yes |
| result | List of generated insights | Insight Array | No |
Insight
Represents an insight generated by the analysis.
| Fields | Description | Type | Required |
|---|---|---|---|
| code | Insight code | String | Yes |
| description | Insight description | String | Yes |
| type | Insight type | String | Yes |
| category | Insight category | String | Yes |
| relevance | Insight relevance | String | Yes |
| relatedTo | Entity or element related to the insight | String Array | Yes |
JSON
{
"executionId": "string",
"analysisId": "string",
"transactionId": "string",
"insights": {
"status": "string",
"result": [
{
"code": "string",
"description": "string",
"type": "string",
"category": "string",
"relevance": "string",
"relatedTo": [
"string"
]
}
]
}
}Response GET
Represents the execution response of the analysis query.
Result
| Fields | Description | Type | Required |
|---|---|---|---|
| analysisId | Analysis ID | Guid | Yes |
| transactionId | Transaction ID | String | Yes |
| insights | Insights results | Insights Result | No |
Insights Result
Represents the insights generated by the analysis.
| Fields | Description | Type | Required |
|---|---|---|---|
| status | Insights status | String | Yes |
| result | List of generated insights | Insight Array | No |
Insight
Represents an insight generated by the analysis.
| Fields | Description | Type | Required |
|---|---|---|---|
| code | Insight code | String | Yes |
| description | Insight description | String | Yes |
| type | Insight type | String | Yes |
| category | Insight category | String | Yes |
| relevance | Insight relevance | String | Yes |
| relatedTo | Entity or element related to the insight | String Array | Yes |
JSON
{
"analysisId": "string",
"transactionId": "string",
"insights": {
"status": "string",
"result": [
{
"code": "string",
"description": "string",
"type": "string",
"category": "string",
"relevance": "string",
"relatedTo": [
"string"
]
}
]
}
}Response Error
Represents the details of a problem returned by the API in case of an error.
| Fields | Description | Type | Required |
|---|---|---|---|
| type | URI that identifies the specific problem type. Can be used to categorize the error. | String | No |
| title | Descriptive title of the problem | String | Yes |
| status | HTTP status code associated with the problem | Integer | Yes |
| errors | Validation errors | Object | Yes |
| instance | URI that identifies the specific instance of the problem | String | No |
JSON
{
"errors": {
"string": [
"string"
]
},
"type": "string",
"title": "string",
"status": 0,
"traceId": "string"
}Updated 18 days ago
