Transactions Categorization
1 min
category
This API is synchronous, and used to identify and categorize transactions.
POST
https://api-sandbox.klavi.ai/klaas/transaction/v2/category
Header Parameters
- AuthorizationstringrequiredDescription
- is_batchnumberDescription
Body Parameters
- uuidstringrequiredDescription
- institutionCodestringDescription
- transactionSourcestringDescription
- transactionDetailsobjectrequiredDescription
- transactionIdstringrequiredDescription
- transactionDatestringrequiredDescription
- transactionNamestringrequiredDescription
- amountnumberrequiredDescription
- creditDebitTypestringrequiredDescription
- transactionTypestringrequiredDescription
Response
- uuidstringDescription
- institutionCodestringDescription
- transactionSourcestringDescription
- categoryDetailsobjectDescription
- transactionIdstringDescription
- transactionDatestringDescription
- transactionNamestringDescription
- amountnumberDescription
- creditDebitTypestringDescription
- transactionTypestringDescription
- categorystringDescription
- subcategorystringDescription
- thirdCategorystringDescription
curl
curl --location 'https://api-sandbox.klavi.ai/klaas/transaction/v2/category' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"uuid":"124eed4",
"institutionCode":"208",
"transactionSource":"checking",
"transactionDetails":[
{
"transactionId":"0013a943abb6b72e6c6e45b8af063aa8e538b1d786fb",
"transactionDate":"2022-02-09",
"transactionName":"Creditamos o empréstimo pessoal do Mercado Crédito",
"amount":500,
"creditDebitType":"CREDITO",
"transactionType":"OUTROS"
},
{
"transactionId":"0013a943abb6b72e6c6e45b8af063aa8e538b1d786fc",
"transactionDate":"2022-02-10",
"transactionName":"ALIANCASUPERMERCADO",
"amount":500,
"creditDebitType":"CREDITO",
"transactionType":"PAGAMENTO"
}
]
}'nodejs
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api-sandbox.klavi.ai/klaas/transaction/v2/category',
'headers': {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"uuid": "String",
"transactionDetails": {
"transactionId": "",
"transactionDate": "",
"transactionName": "",
"amount": "",
"creditDebitType": "",
"transactionType": ""
}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"uuid": "String",
"transactionDetails": {
"transactionId": "",
"transactionDate": "",
"transactionName": "",
"amount": "",
"creditDebitType": "",
"transactionType": ""
}
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api-sandbox.klavi.ai/klaas/transaction/v2/category", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));python
import requests
import json
url = "https://api-sandbox.klavi.ai/klaas/transaction/v2/category"
payload = json.dumps({
"uuid": "String",
"transactionDetails": {
"transactionId": "",
"transactionDate": "",
"transactionName": "",
"amount": "",
"creditDebitType": "",
"transactionType": ""
}
})
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api-sandbox.klavi.ai/klaas/transaction/v2/category")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = "application/json"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"uuid": "String",
"transactionDetails": {
"transactionId": "",
"transactionDate": "",
"transactionName": "",
"amount": "",
"creditDebitType": "",
"transactionType": ""
}
})
response = https.request(request)
puts response.read_body
200
{
"uuid":"124eed4",
"institutionCode":"208",
"transactionSource":"checking",
"categoryDetails":[
{
"transactionId":"0013a943abb6b72e6c6e45b8af063aa8e538b1d786fb",
"transactionDate":"2022-02-09",
"transactionName":"Creditamos o empréstimo pessoal do Mercado Crédito",
"amount":500,
"creditDebitType":"CREDITO",
"transactionType":"OUTROS",
"category":"Prioridade financeira",
"subcategory":"Empréstimo",
"thirdCategory":"Empréstimo"
},
{
"transactionId":"0013a943abb6b72e6c6e45b8af063aa8e538b1d786fc",
"transactionDate":"2022-02-10",
"transactionName":"ALIANCASUPERMERCADO",
"amount":500,
"creditDebitType":"CREDITO",
"transactionType":"PAGAMENTO",
"category":"Renda",
"subcategory":"Outras transação de crédito",
"thirdCategory":"Outras transação de crédito"
}
]
}