---
title: Transactions Categorization
slug: klaas/transactions-categorization
docTags: 
createdAt: 2025-06-27T07:23:25.816Z
---

:::ApiMethodV2
```json
{
  "name": "category",
  "method": "POST",
  "url": "https://api-sandbox.klavi.ai/klaas/transaction/v2/category",
  "description": "This API is synchronous, and used to identify and categorize transactions.",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "haa7ADUSqN4ojH42ybFT6",
        "language": "curl",
        "code": "curl --location 'https://api-sandbox.klavi.ai/klaas/transaction/v2/category' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"uuid\":\"124eed4\",\n    \"institutionCode\":\"208\",\n    \"transactionSource\":\"checking\",\n    \"transactionDetails\":[\n        {\n            \"transactionId\":\"0013a943abb6b72e6c6e45b8af063aa8e538b1d786fb\",\n            \"transactionDate\":\"2022-02-09\",\n            \"transactionName\":\"Creditamos o empréstimo pessoal do Mercado Crédito\",\n            \"amount\":500,\n            \"creditDebitType\":\"CREDITO\",\n            \"transactionType\":\"OUTROS\"\n        },\n        {\n            \"transactionId\":\"0013a943abb6b72e6c6e45b8af063aa8e538b1d786fc\",\n            \"transactionDate\":\"2022-02-10\",\n            \"transactionName\":\"ALIANCASUPERMERCADO\",\n            \"amount\":500,\n            \"creditDebitType\":\"CREDITO\",\n            \"transactionType\":\"PAGAMENTO\"\n        }\n    ]\n}'",
        "customLabel": ""
      },
      {
        "id": "a-ca6DgMAOq3v2dY80fTV",
        "language": "nodejs",
        "code": "var request = require('request');\nvar options = {\n   'method': 'POST',\n   'url': 'https://api-sandbox.klavi.ai/klaas/transaction/v2/category',\n   'headers': {\n      'Accept': 'application/json',\n      'Content-Type': 'application/json'\n   },\n   body: JSON.stringify({\n      \"uuid\": \"String\",\n      \"transactionDetails\": {\n         \"transactionId\": \"\",\n         \"transactionDate\": \"\",\n         \"transactionName\": \"\",\n         \"amount\": \"\",\n         \"creditDebitType\": \"\",\n         \"transactionType\": \"\"\n      }\n   })\n\n};\nrequest(options, function (error, response) {\n   if (error) throw new Error(error);\n   console.log(response.body);\n});\n",
        "customLabel": ""
      },
      {
        "id": "x-RkZbshyrkYus_wrdClD",
        "language": "javascript",
        "code": "var myHeaders = new Headers();\nmyHeaders.append(\"Accept\", \"application/json\");\nmyHeaders.append(\"Content-Type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"uuid\": \"String\",\n   \"transactionDetails\": {\n      \"transactionId\": \"\",\n      \"transactionDate\": \"\",\n      \"transactionName\": \"\",\n      \"amount\": \"\",\n      \"creditDebitType\": \"\",\n      \"transactionType\": \"\"\n   }\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api-sandbox.klavi.ai/klaas/transaction/v2/category\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));",
        "customLabel": ""
      },
      {
        "id": "D1ScoKcto4kWNV7wSzwI6",
        "language": "python",
        "code": "import requests\nimport json\n\nurl = \"https://api-sandbox.klavi.ai/klaas/transaction/v2/category\"\n\npayload = json.dumps({\n   \"uuid\": \"String\",\n   \"transactionDetails\": {\n      \"transactionId\": \"\",\n      \"transactionDate\": \"\",\n      \"transactionName\": \"\",\n      \"amount\": \"\",\n      \"creditDebitType\": \"\",\n      \"transactionType\": \"\"\n   }\n})\nheaders = {\n   'Accept': 'application/json',\n   'Content-Type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n",
        "customLabel": ""
      },
      {
        "id": "aBU3nzlTkmjjrE-HDMXdi",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api-sandbox.klavi.ai/klaas/transaction/v2/category\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"uuid\": \"String\",\n   \"transactionDetails\": {\n      \"transactionId\": \"\",\n      \"transactionDate\": \"\",\n      \"transactionName\": \"\",\n      \"amount\": \"\",\n      \"creditDebitType\": \"\",\n      \"transactionType\": \"\"\n   }\n})\n\nresponse = https.request(request)\nputs response.read_body\n",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "aBU3nzlTkmjjrE-HDMXdi"
  },
  "results": {
    "languages": [
      {
        "id": "2-5Duk5S6qoNTy_LRaUHm",
        "language": "200",
        "customLabel": "",
        "code": "{\n    \"uuid\":\"124eed4\",\n    \"institutionCode\":\"208\",\n    \"transactionSource\":\"checking\",\n    \"categoryDetails\":[\n        {\n            \"transactionId\":\"0013a943abb6b72e6c6e45b8af063aa8e538b1d786fb\",\n            \"transactionDate\":\"2022-02-09\",\n            \"transactionName\":\"Creditamos o empréstimo pessoal do Mercado Crédito\",\n            \"amount\":500,\n            \"creditDebitType\":\"CREDITO\",\n            \"transactionType\":\"OUTROS\",\n            \"category\":\"Prioridade financeira\",\n            \"subcategory\":\"Empréstimo\",\n            \"thirdCategory\":\"Empréstimo\"\n        },\n        {\n            \"transactionId\":\"0013a943abb6b72e6c6e45b8af063aa8e538b1d786fc\",\n            \"transactionDate\":\"2022-02-10\",\n            \"transactionName\":\"ALIANCASUPERMERCADO\",\n            \"amount\":500,\n            \"creditDebitType\":\"CREDITO\",\n            \"transactionType\":\"PAGAMENTO\",\n            \"category\":\"Renda\",\n            \"subcategory\":\"Outras transação de crédito\",\n            \"thirdCategory\":\"Outras transação de crédito\"\n        }\n    ]\n}"
      }
    ],
    "selectedLanguageId": "2-5Duk5S6qoNTy_LRaUHm"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "Authorization",
        "kind": "required",
        "type": "string",
        "description": "JWT bearer token",
        "": "required"
      },
      {
        "name": "is_batch",
        "kind": "optional",
        "type": "number",
        "description": "Is the partner's business batch processing or real-time processing.\nBatch process: is_batch=1;\nReal-time process: is_batch=0;\nDefault: is_batch=1.",
        "": "Is the partner's business batch processing or real-time processing.\nBatch process: is_batch=1;\nReal-time process: is_batch=0;\nDefault: is_batch=1."
      }
    ],
    "bodyDataParameters": [
      {
        "name": "uuid",
        "kind": "required",
        "type": "string",
        "description": "UUID,unique identifier of partner user (for future billing purposes)",
        "": "UUID,unique identifier of partner user (for future billing purposes)"
      },
      {
        "name": "institutionCode",
        "kind": "optional",
        "type": "string",
        "description": "Institution Code, it should be the code in central bank",
        "": "Institution Code, it should be the code in central bank"
      },
      {
        "name": "transactionSource",
        "kind": "optional",
        "type": "string",
        "description": "Transaction source,enum values: checking/creditcard. In case a user has transactions in both checking account and creditcard account, please POST Klavi API twice with different \"transactionSource\"",
        "": "Transaction source,enum values: checking/creditcard. In case a user has transactions in both checking account and creditcard account, please POST Klavi API twice with different \"transactionSource\""
      },
      {
        "name": "transactionDetails",
        "kind": "required",
        "type": "object",
        "description": "Transaction detail object",
        "": "required",
        "children": [
          {
            "name": "transactionId",
            "kind": "required",
            "type": "string",
            "description": "Transaction ID, the unique identifier of a specific transaction"
          },
          {
            "name": "transactionDate",
            "kind": "required",
            "type": "string",
            "description": "Transaction date"
          },
          {
            "name": "transactionName",
            "kind": "required",
            "type": "string",
            "description": "Transaction name"
          },
          {
            "name": "amount",
            "kind": "required",
            "type": "number",
            "description": "Transaction amount"
          },
          {
            "name": "creditDebitType",
            "kind": "required",
            "type": "string",
            "description": "Credit or debit type"
          },
          {
            "name": "transactionType",
            "kind": "required",
            "type": "string",
            "description": "Transaction type"
          }
        ],
        "schema": [
          {
            "name": "transactionId",
            "kind": "required",
            "type": "string",
            "description": "Transaction ID, the unique identifier of a specific transaction"
          },
          {
            "name": "transactionDate",
            "kind": "required",
            "type": "string",
            "description": "Transaction date"
          },
          {
            "name": "transactionName",
            "kind": "required",
            "type": "string",
            "description": "Transaction name"
          },
          {
            "name": "amount",
            "kind": "required",
            "type": "number",
            "description": "Transaction amount"
          },
          {
            "name": "creditDebitType",
            "kind": "required",
            "type": "string",
            "description": "Credit or debit type"
          },
          {
            "name": "transactionType",
            "kind": "required",
            "type": "string",
            "description": "Transaction type"
          }
        ]
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  },
  "hasTryItOut": false,
  "response": [
    {
      "name": "uuid",
      "kind": "optional",
      "type": "string",
      "description": "UUID, unique identifier of partner user (for future billing purposes)"
    },
    {
      "name": "institutionCode",
      "kind": "optional",
      "type": "string",
      "description": "Institution code, it should be the code in central bank",
      "children": []
    },
    {
      "name": "transactionSource",
      "kind": "optional",
      "type": "string",
      "description": "Transaction source,enum values:checking/creditcard, In case a user has transactions in both checking account and creditcard account, please POST Klavi API twice with different \"transactionSource\"",
      "children": []
    },
    {
      "name": "categoryDetails",
      "kind": "optional",
      "type": "object",
      "description": "Category detail object",
      "children": [
        {
          "name": "transactionId",
          "kind": "optional",
          "type": "string",
          "description": "Transaction ID, unique identifier of a specific transaction"
        },
        {
          "name": "transactionDate",
          "kind": "optional",
          "type": "string",
          "description": "Transaction date"
        },
        {
          "name": "transactionName",
          "kind": "optional",
          "type": "string",
          "description": "Transaction name"
        },
        {
          "name": "amount",
          "kind": "optional",
          "type": "number",
          "description": "Transaction amount"
        },
        {
          "name": "creditDebitType",
          "kind": "optional",
          "type": "string",
          "description": "Credit or debit type"
        },
        {
          "name": "transactionType",
          "kind": "optional",
          "type": "string",
          "description": "Transaction type"
        },
        {
          "name": "category",
          "kind": "optional",
          "type": "string",
          "description": "Transaction 1 level category"
        },
        {
          "name": "subcategory",
          "kind": "optional",
          "type": "string",
          "description": "Transaction 2 level category"
        },
        {
          "name": "thirdCategory",
          "kind": "optional",
          "type": "string",
          "description": "Transaction 3 level category"
        }
      ]
    }
  ]
}
```
:::

