Skip to main content

Transaction

When the cardholder initiates a transaction, the data must be sent to our server so that we can perform a risk analysis on that set of data.

Object Definition

Request Body
{
"id": "678",
"cardholder_id": "b812da2e-e6be-4712-8e57-6f3f2791625b",
"group_id" : "8507884b-c30f-4b45-951c-f0bf366926fc",
"amount": 13725,
"currency": "BRL",
"brl_converted_amount": 13725,
"installments": 6,
"authorization_date": "2019-11-10T13:25:42.123-03:00",
"authorization_type": "authorization",
"transaction_type": "credit",
"pan_entry_mode": "chip",
"pin_sent": true,
"source_account": "saving_account",
"location": {
"latitude": -45.2753548,
"longitude": -15.24587
},
"terminal": {
"id": "123456",
"country_code": "BRA",
"terminal_type": "2",
"pin_entry_capability": true,
"magnetic_stripe_capability": true,
"contactless_capability": false,
"chip_capability": true
},
"merchant": {
"acquirer_id": "250",
"merchant_id": "123456",
"name": "VASP LINHAS AEREAS",
"street" : "RUA CMDTE X, 127",
"city" : "SAO PAULO, SP",
"region": "BRA",
"postal_code": "04570-140",
"mcc": "3036"
},
"card": {
"brand": "visa",
"category": "black",
"issuing_date": "2019-10-08T07:13:12.333-03:00",
"unblock_date": "2019-10-12T07:13:12.333-03:00",
"expiration_date": "2019-12-31",
"bin": "498406",
"last4": "1234",
"total_credit_limit": 2500000,
"used_credit_limit": 732625,
"issuer_country_code": "BRA"
},
"transaction_status" : "authorized",
"response_code": "05"
}

A transaction must be sent to the API before the transaction is authorized and can be used to make the decision to generate (or not) an authorization code. The data sent can also be used to generate alerts based on the cardholder's transaction history, so that if there is behavior different from expected, the alert triggers an appropriate action to mitigate the impact of the transactions.

The fraud statuses (fraud_status and transaction_status) represent, respectively, the decision returned by the model for that transaction and whether the transaction was completed, cancelled, or became a dispute.

The following statuses are used in transaction_status:

  • not_authorized
  • authorized
  • cleared
  • cancelled
  • partially_cancelled
  • chargeback
  • partial_chargeback

The following statuses are used in fraud_status:

  • automatically_approved
  • automatically_declined
  • not_analyzed

Below are the meanings of each decision returned in the fraud_status field:

ResultDescription
automatically_approvedThis transaction is recommended to be approved
automatically_declinedThis transaction is recommended to be declined
not_analyzedThe request was sent with the analysis flag set to false, meaning our systems should not return a decision
nametypedescription
idstring(required)
Transaction identifier in the client's system.
It is essential that this number be unique for each authorization process
cardholder_idstring(required)
Cardholder identifier in the client's system — as registered in the Onboarding API
group_idstring(optional)
Identifier of which group or category that user belongs to within the client's system
amountinteger(required)
The transaction amount — as described in the "Standards" section
currencystring(required)
The currency used in the transaction — ISO 4217 and ApplicationCurrencyCode from 8583
brl_converted_amountinteger(required)
The transaction amount converted to Brazilian Reais — as described in the "Standards" section
installmentsinteger(required)
The number of installments used in the transaction
authorization_datedatetime(required)
The date and time when the transaction started, with timezone
authorization_typeenumerator(required)
Authorization or pre-authorization transaction?
transaction_typeenumerator(required)
Credit, Debit or Voucher
pan_entry_modeenumerator(required)
PAN entry mode — Chip, Keyed, Magnetic Stripe, Fallback, Contactless—Field from ISO 8583 (DE 22 - Sub Field 1)
pin_sentboolean(required)
Was a PIN entered at the terminal? — Field from entry_mode in ISO 8583
source_accountenumerator(optional)
Whether the transaction amount should be taken from the bill, checking account or savings—Field from Processing Code in ISO 8583
location.latitudenumber(optional)
The latitude where the transaction occurred—if there is a linked mobile device or another means of capturing the location
location.longitudenumber(optional)
The longitude where the transaction occurred
terminal.idstring(optional)
The terminal identifier sent by the acquirer in the authentication messaging
terminal.country_codestring(required)
The country code of the terminal, sent in the authorization message per ISO 3166-1 alpha-3, field from Terminal Country Code in ISO 8583
terminal.terminal_typestring(required)
The terminal type as received in the authorization messaging — Field from TerminalType in ISO 8583
terminal.pin_entry_capabilityboolean(required)
Is it possible to enter the card PIN at the terminal? — Field from TerminalPINEntryCapability in ISO 8583
terminal.magnetic_stripe_capabilityboolean(optional)
Can the terminal read magnetic stripe? — Field TerminalPANEntryCapability (DE 123) in ISO 8583
terminal.contactless_capabilityboolean(optional)
Can the terminal initiate contactless transactions? — Field TerminalPANEntryCapability (DE 123) in ISO 8583
terminal.chip_capabilityboolean(required)
Can the terminal initiate transactions using the EMV chip? — Field TerminalPANEntryCapability (DE 123) in ISO 8583
merchant.acquirer_idstring(required)
The acquirer identifier as per authorization messaging — Field Acquirer Identifier (DE 32) in ISO 8583
merchant.merchant_idstring(required)
The merchant identifier at the acquirer as per authorization messaging — Field Merchant Identifier in ISO 8583
merchant.namestring(optional)
The merchant name according to authorization messaging—Field Merchant Name in ISO 8583
merchant.streetstring(optional)
The street address of the merchant — Field Card Acceptor Street Address
merchant.citystring(optional)
The city of the merchant's address — Field Card Acceptor City
merchant.regionstring(optional)
The region of the merchant's address — Field Card Acceptor Region Code
merchant.postal_codestring(optional)
The postal code of the merchant's address — Field Card Acceptor Postal Code
merchant.mccstring(required)
Merchant Category Code, according to ISO 18245 and ISO 8583
card.brandenumerator(required)
The card brand (visa, mastercard, elo...)
card.categoryenumerator(required)
The card category (classic, gold, platinum, black, infinite, corporate)
card.issuing_datedatetime(required)
The date and time when the card was issued, with timezone
card.unblock_datedatetime(optional)
The date and time when the card was unblocked by the cardholder, with timezone
card.expiration_datedate(required)
The card expiration date (last day of the month)
card.binstring(required)
The BIN of the card being used
card.last4string(required)
The last four digits of the card, used to identify the card within the issuer
card.total_credit_limitnumber(optional)
The total credit limit granted to the cardholder. If the card is prepaid, the existing credit balance on the card
card.used_credit_limitnumber(optional)
The amount of limit already used (before the transaction in question)
card.issuer_country_codestring(required)
The issuer country per ISO 3166-1 alpha-3
transaction_statusenumerator(optional)
The transaction status, when sent with analyze=false flag and authorization decision has already been made.
response_codeenumerator(optional)
The transaction response code per the Response Code field in ISO 8583, when sent with analyze=false flag and authorization decision has already been made.

Enumerators

The enumerators of the card transaction object are authorization_type, transaction_type, pan_entry_mode, source_account, brand and category. The possible values for each can be seen below:

authorization_type

enumeratormeaning
authorizationA purchase authorization — MTI x1xx (DMS) and x2xx (SMS)
pre_authorizationA pre-authorization to reserve limit on the card (Hotel, Vehicle Rental, Equipment Rental, Fuel Machines) — MTI x1xx (DMS) and Transaction Type (first 2 digits of Processing Code) "60"
reversalA cancellation authorization (to release limit on the card and subsequently proceed with Clearing/BASE II) — MTI x4xx

transaction_type

enumeratormeaning
creditA transaction made on the credit function
debitA transaction made on the debit function
prepaidA transaction made on the prepaid function

pan_entry_mode

enumeratorISO 8583meaning
unknown00PAN entry mode unknown.
typed01PAN entered manually (keyed).
bar_code03PAN entered by barcode reader
ocr04PAN entered by OCR (Optical Character Recognition)
chip05PAN entered by card with integrated circuit (Chip)
track_106PAN entered by Track 1 of the magnetic stripe card
contactless07PAN entered by Contactless EMV
fallback_typed79An attempt was made to use the card or stripe reader on the device and the card but the transaction could not be processed with that information (possibly a device or card issue), so the PAN was keyed. In some cases the acquirer is not certified to use CHIP or stripe and sends this code.
fallback_magnetic_stripe80An attempt was made to use the device's card reader and the card but the transaction could not be processed with that information (possibly a device or card issue), so the card's magnetic stripe was used.
ecommerce81E-commerce / card-not-present transaction
magnetic_stripe90Magnetic stripe transaction (Card has no chip or device has no reader/is not certified)

Other PAN_ENTRY_MODE values exist; however, they are generally not used.

source_account

enumeratorISO 8583meaning
default00Default or unspecified
saving_account10Savings account
checking_account20Checking account
credit_facility30Bill
universal_account40Universal Account
investment_account50Investment account
electronic_purse60Balance stored on the card chip (Electronic Purse)

brand

enumeratormeaning
visaVisa
mastercardMasterCard
diners_clubDiners Club
eloElo
american_expressAmerican Express

category

enumeratormeaning
classicClassic
goldGold
platinumPlatinum
blackBlack/Infinite
travelTravel
corporateCorporate/Business
prepaidPrepaid

terminal_type

enumeratormeaning
0Unknown
1No terminal used
2Magnetic stripe reader
3Bar code (reserved for future use)
4Optical Character Recognition (reserved for future use)
5Magnetic stripe reader and EMV specification compatible integrated circuit card (ICC) reader
6Key entry only
7Magnetic stripe reader and key entry
8Magnetic stripe reader and key entry and EMV-compatible ICC reader
9EMV compatible ICC reader

Send a Transaction

Request Body
  {
"id": "12345",
...
}
Response Body
  {
"id": "12345",
"fraud_status": "automatically_approved"
}

To evaluate a transaction, simply send a Transaction object to the following endpoint with the flag set appropriately:

POST https://api.caas.qitech.app/card_issuance/transaction?analyze=true

The analyze parameter exists to prevent transactions that do not need to be analyzed from going through the fraud engines and polluting the database. The default value of this parameter is true, so only transactions explicitly marked will not be analyzed.

Update the status of a Transaction

Request Body: When authorizing a transaction
{
"transaction_status": "authorized",
"response_code": "05"
}
Request Body: When partially cancelling a transaction
{
"transaction_status": "partially_cancelled",
"partial_amount" : 3000,
"response_code": "05"
}

To ensure feedback to the rules and the implemented artificial intelligence model, it is necessary to inform the system when transactions are cancelled. For this, requests with the PUT method must be used, authenticated as usual:

PUT https://api.caas.qitech.app/card_issuance/transaction/123456

Retrieve a Transaction

To retrieve a specific Transaction, simply make a GET request. The result returned is the most up-to-date JSON of the Transaction in question. If this identifier is not linked to any object, HTTP Status 404 is returned.

GET https://api.caas.qitech.app/card_issuance/transaction/12345678

curl "https://api.caas.qitech.app/card_issuance/transaction/12345678"
-H "Authorization: EXAMPLE-OF-API-KEY"

The command above returns the JSON that represents a Transaction object.

Search Transactions

Response Body: List of Transaction objects.
[
{
"id": "12345",
...
},
{
"id": "12345",
...
}
]

If you need to search for Transactions, a GET with query parameters can be used. The result returned is a JSON representing a list of Transactions. If no object is found with the parameters sent, HTTP Status 200 is returned with an empty list in the response body.

GET https://api.caas.qitech.app/card_issuance/transactions?initial_date=2019-10-01&final_date=2019-10-05&page_number=2&page_rows=20

The following parameters can be used for the search:

ParameterDefaultDescription
initial_datenullFirst date to be returned from the transaction_date field
final_datenullLast date to be returned from the transaction_date field
cardholder_idnullCardholder identifier at the issuer
page_number0Page number of desired results, starting at zero
page_rows50Maximum number of objects to be returned in a query