Categorise a bank transaction

Set the categories of a bank transaction, with a weight for each.

POST https://cotlet.dev/api/v1/pennylane/transactions/{transaction_id}/categorise

write

Replaces the categories of one bank transaction and returns the new list. Each category has a weight from 0 to 1; weights inside one category group must sum to 1, while categories from different groups combine freely. The call fails when the weights do not balance. It reaches nobody and changes only the analysis of one transaction, so it does not ask for your OK, and you undo it by calling it again with the earlier categories, which list_transactions shows.

Parameters

Parameters: categorise_transaction
NameTypeDescription
transaction_id integer required integer Transaction ID from list_transactions.
categories array required array List of category_id with weight as a string from 0 to 1.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/pennylane/transactions/5530021/categorise \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"categories":[{"id":59,"weight":"1"}]}'
Python
result = client.call("pennylane", "categorise_transaction", {"transaction_id":5530021,"categories":[{"id":59,"weight":"1"}]})
Node.js
const result = await cotlet.call('pennylane', 'categorise_transaction', {"transaction_id":5530021,"categories":[{"id":59,"weight":"1"}]});
CLI
cotlet call pennylane categorise_transaction --data '{"transaction_id":5530021,"categories":[{"id":59,"weight":"1"}]}'

Example response

JSON

{
  "transaction_id": 5530021,
  "categories": [
    {
      "category_id": 59,
      "label": "Hosting",
      "weight": "1"
    }
  ]
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.