Errors

The API can return multiple errors for any operation, each having its meaning and usage.

Error attributes

error_class
string

the class of the error, one of the listed below

error_message
string

a message describing the error

request
object

the body of the request that caused the error

Error codes

[400] Bad Request
[404] Not Found
[406] Not Acceptable
[409] Duplicated

Sample response

{
  "error_class": "BatchSizeLimitExceeded",
  "error_message": "Batch size limit (100 transactions) was exceeded."
}

Errors list

ActionNotAllowed

The client has no access to the required route

BatchSizeLimitExceeded

More than 100 objects were sent in the request (100 is the limit)

CategorizationLimitReached

One client can categorize at most 1000 transactions per day

ClientDisabled

The client has been disabled. You can find out more about the disabled status on Disabled guides page

ClientNotFound

The API key used in the request does not belong to a client

WrongRequestFormat

The JSON request is incorrectly formed

Categorize transactions

Categorizes your transactions by the given parameters.

Request body

The request body is an array of objects wrapped in the data field. Each object has a description, currency_code and identifier fields. The API accepts batches of at most 100 objects.

Parameters

description
string, required

the description which you wish to categorize (max 4000 chars)

currency_code
string, optional

the code of the currency, present in SaltEdge API

country_code
string, optional

the code of the country, present in SaltEdge API

amount
decimal, optional

the amount of the transaction

category
string, optional

the new category code for the description, used with action: learn

action
string, optional

learn - will create or update a rule, remove - will remove a previous created rule. Note: category is required when action is learn

identifier
string, optional

a unique identifier of the transaction object (max 255 chars).

Note: Custom categories will be located in transaction’s extra, see: customer_category_code and customer_category_name

Possible Errors

URL

https://www.saltedge.com/api/v3/transactions/categorize

Method

POST

Sample request

curl -v -H "Accept: application/json" \
        -H "Content-type: application/json" \
        -H "Client-id: CLIENT_ID" \
        -H "Service-secret: SERVICE_SECRET" \
        -X POST \
        -d "{ \
              \"data\": [ \
                { \
                  \"description\": \"Amazon\", \
                  \"action\": \"learn\", \
                  \"category\": \"Online shopping\" \
                }, \
                { \
                  \"description\": \"Tesco\", \
                  \"action\": \"remove\" \
                }, \
                { \
                  \"description\": \"Itunes\", \
                  \"currency_code\": \"USD\", \
                  \"identifier\": \"d5bb8cf037aa7f069\" \
                }, \
                { \
                  \"description\": \"Ebay\", \
                  \"country_code\": \"US\", \
                  \"amount\": 100 \
                } \
              ] \
            }" \
        https://www.saltedge.com/api/v3/transactions/categorize

Sample Response

{
  "data": [
    {
      "description": "Itunes",
      "identifier": "d5bb8cf037aa7f069",
      "currency_code": "USD",
      "category": "electronics_and_software",
      "made_on": "2016-08-16",
      "amount": 1,
      "mode": "normal",
      "status": "posted",
      "extra": {}
    },
    {
      "description": "",
      "identifier": null,
      "currency_code": "EUR",
      "category": "uncategorized",
      "made_on": "2016-08-16",
      "amount": 1,
      "mode": "normal",
      "status": "posted",
      "extra": {},
      "errors": [
          "Description can't be blank"
      ]
    }
  ]
}

Learn category

You can change the category of some transactions, thus improving the categorization accuracy.

Post body

transaction_id
required

the id of the transaction

category_code
required

the new category code of the transaction

Possible Errors

URL

https://www.saltedge.com/api/v3/categories/learn

Method

POST

Authentication

Sample request

curl -v -H "Accept: application/json" \
        -H "Content-type: application/json" \
        -H "Client-id: CLIENT_ID" \
        -H "Service-secret: SERVICE_SECRET" \
        -X POST \
        -d "{ \
              \"data\": [ \
                { \
                  \"transaction_id\": 123, \
                  \"category_code\": \"paycheck\" \
                }, \
                { \
                  \"transaction_id\": 124, \
                  \"category_code\": \"car_rental\" \
                } \
              ] \
            }" \
        https://www.saltedge.com/api/v3/categories/learn

Sample Response

{
  "data": {
    "learned": true
  }
}