Klaas API
Transactions Categorization
1 min
{ "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" } ], "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" } ] } ] }