Transaction
When you submit a query to the Anti-Fraud services, you create a Transaction. A transaction may contain the execution of one or more services configured in the query model or informed in the request body. These services may be internal analyses or external queries that are performed on the processing conveyor. After that, based on validation rules, the status is set for the transaction.
A transaction is characterized by an endpoint where the required services can be informed and a set of rules validated.
For details on authentication, access Authenticating.
Supported endpoints
Submission of the necessary person or company data and the template model against which the verification services shall be executed, as well as the set of rules to be validated.
Required Permission: Create Transaction
Parameter that defines the onboarding origin. Must be set to TRUST.
Access token.
Bearer your_token_here
Unique ID of the Query Template (configured in Trust).
Free to add any kind of attribute, ideal for linking IDs or other information in the transaction.
Mobile Token (Session Token).
Callback URL (webhook).
Success
Bad request
Unauthorized
Internal Server Error
POST /v1/transactions HTTP/1.1
Host: api.us.prd.caf.io
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 351
{
"templateId": "text",
"files": [
{
"data": "text",
"type": "SELFIE"
}
],
"attributes": {
"cpf": "text",
"rg": "text",
"name": "text",
"birthDate": "text",
"fatherName": "text",
"motherName": "text",
"uf": "text",
"cnpj": "text",
"cep": "text",
"email": "[email protected]",
"phoneNumber": "text",
"plate": "text"
},
"metadata": {},
"referenceToken": "text",
"_callbackUrl": "https://example.com"
}
{
"requestId": "6cb8093c-14ef-4fd1-810b-ee9fa5f9aae9",
"id": "6021a21b3811c35ecb8dea20"
}
Upload a file to be used in transactions. The file will be stored temporarily and can be referenced in transaction creation.
Required Permission: Upload Document
Access token. See more in the 'Authentication' topic.
Bearer your_token_here
File to be uploaded. Accepted formats: application/pdf, image/png, image/jpeg, image/bmp, image/webp, image/heif
Created
Bad request
Unauthorized
Forbidden
Unprocessable Entity
Internal Server Error
POST /v1/transactions/files HTTP/1.1
Host: api.us.prd.caf.io
Authorization: text
Content-Type: multipart/form-data
Accept: */*
Content-Length: 17
{
"file": "binary"
}
{
"requestId": "6cb8093c-14ef-4fd1-810b-ee9fa5f9aae9",
"message": "File sent successfully.",
"data": {
"filename": "document.pdf"
}
}
Get your transaction list summarized with pagination and filters.
Required Permission: Read Transaction
The maximum amount of records that should be returned in the response, e.g. _limit=5. Max value is 10 and default is 10.
Sort the records returned in response by creation date in ascending or descending order. Descending (default): _order=desc Ascending : _order=asc
Search for too many template models by references of the templateId on the account. For multiple templates, separate the values using the pipe symbol, e.g. _templates=templateId1|templateId2|templateId3.
Search the records created on or after any given day, e.g. _startCreatedDate=2022-01-01.
Search the records created on or before a specified day, e.g. _endCreatedDate=2022-01-30.
Access token. See more in the 'Authentication' topic
Bearer your_token_here
Success
Unauthorized
Internal Server Error
GET /v1/transactions HTTP/1.1
Host: api.us.prd.caf.io
Authorization: text
Accept: */*
{
"requestId": "6cb8093c-14ef-4fd1-810b-ee9fa5f9aae9",
"items": [
{
"id": "6388ac6b409eff000804dadf",
"status": "APPROVED",
"createdAt": "2022-09-08T22:10:14.816Z",
"data": {
"cpf": "00011122233",
"birthDate": "01/01/2000",
"name": "John Doe"
}
}
],
"totalItems": 2
}
Retrieve the result data of a transaction.
Required Permission: Read Transaction
Transaction identifier.
Flag for including transactions related to onboarding pf_pf. Default is 'false'. e.g. _includePfRelationships=true.
Flag to include the cropped versions of the images of the sended documents. Default is 'false'. e.g. _includeCroppedImages=true.
Flag to set the language in the description of the reasons for manual failures. Possible values are 'en' or 'pt'. Default is 'pt'. e.g. _lang=en.
Access token. See more in the 'Authentication' topic
Success
Bad request
Unauthorized
Internal Server Error
GET /v1/transactions/{transactionId} HTTP/1.1
Host: api.us.prd.caf.io
Authorization: text
Accept: */*
{
"requestId": "6cb8093c-14ef-4fd1-810b-ee9fa5f9aae9",
"items": [
{}
],
"totalItems": 2
}
Last updated