Get User Transactions

Get User Transactions

Fetches transactions for a user.

This endpoint fetches all transactions for a user across all of their links. You can use it to retrieve transactions from any or all accounts at once, regardless of which institution they belong to.

URL

GET
/users/{id}/transactions
Request
curl --request GET \
--url 'https://api.moneykit.com/users/[id]/transactions?transaction_type=SOME_ARRAY_VALUE&category=SOME_ARRAY_VALUE&account_id=SOME_ARRAY_VALUE&institution_id=SOME_ARRAY_VALUE&page=SOME_INTEGER_VALUE&size=SOME_INTEGER_VALUE&start_date=SOME_STRING_VALUE&end_date=SOME_STRING_VALUE' \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'X-Client-Id: SOME_STRING_VALUE' \
--header 'X-Client-Secret: SOME_STRING_VALUE'
const options = {
method: 'GET',
headers: {
'X-Client-Id': 'SOME_STRING_VALUE',
'X-Client-Secret': 'SOME_STRING_VALUE',
Authorization: 'Bearer REPLACE_BEARER_TOKEN'
}
};

fetch('https://api.moneykit.com/users/[id]/transactions?transaction_type=SOME_ARRAY_VALUE&category=SOME_ARRAY_VALUE&account_id=SOME_ARRAY_VALUE&institution_id=SOME_ARRAY_VALUE&page=SOME_INTEGER_VALUE&size=SOME_INTEGER_VALUE&start_date=SOME_STRING_VALUE&end_date=SOME_STRING_VALUE', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import requests

url = "https://api.moneykit.com/users/[id]/transactions"

querystring = {"transaction_type":"SOME_ARRAY_VALUE","category":"SOME_ARRAY_VALUE","account_id":"SOME_ARRAY_VALUE","institution_id":"SOME_ARRAY_VALUE","page":"SOME_INTEGER_VALUE","size":"SOME_INTEGER_VALUE","start_date":"SOME_STRING_VALUE","end_date":"SOME_STRING_VALUE"}

headers = {
"X-Client-Id": "SOME_STRING_VALUE",
"X-Client-Secret": "SOME_STRING_VALUE",
"Authorization": "Bearer REPLACE_BEARER_TOKEN"
}

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "https://api.moneykit.com/users/[id]/transactions?transaction_type=SOME_ARRAY_VALUE&category=SOME_ARRAY_VALUE&account_id=SOME_ARRAY_VALUE&institution_id=SOME_ARRAY_VALUE&page=SOME_INTEGER_VALUE&size=SOME_INTEGER_VALUE&start_date=SOME_STRING_VALUE&end_date=SOME_STRING_VALUE"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-Client-Id", "SOME_STRING_VALUE")
req.Header.Add("X-Client-Secret", "SOME_STRING_VALUE")
req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.moneykit.com/users/[id]/transactions?transaction_type=SOME_ARRAY_VALUE&category=SOME_ARRAY_VALUE&account_id=SOME_ARRAY_VALUE&institution_id=SOME_ARRAY_VALUE&page=SOME_INTEGER_VALUE&size=SOME_INTEGER_VALUE&start_date=SOME_STRING_VALUE&end_date=SOME_STRING_VALUE")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["X-Client-Id"] = 'SOME_STRING_VALUE'
request["X-Client-Secret"] = 'SOME_STRING_VALUE'
request["Authorization"] = 'Bearer REPLACE_BEARER_TOKEN'

response = http.request(request)
puts response.read_body
import Foundation

let headers = [
"X-Client-Id": "SOME_STRING_VALUE",
"X-Client-Secret": "SOME_STRING_VALUE",
"Authorization": "Bearer REPLACE_BEARER_TOKEN"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.moneykit.com/users/[id]/transactions?transaction_type=SOME_ARRAY_VALUE&category=SOME_ARRAY_VALUE&account_id=SOME_ARRAY_VALUE&institution_id=SOME_ARRAY_VALUE&page=SOME_INTEGER_VALUE&size=SOME_INTEGER_VALUE&start_date=SOME_STRING_VALUE&end_date=SOME_STRING_VALUE")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})

dataTask.resume()
Response
{
"total": 82,
"page": 1,
"size": 50,
"transactions": [
{
"transaction_id": "c7318ff7-257c-490e-8242-03a815b223b7",
"account_id": "acc_6Tef269B6ZArSVpYrxtjBV",
"amount": 384.05,
"type": "debit",
"currency": "USD",
"date": "2023-02-16T00:00:00",
"datetime": "2023-02-16T09:14:11",
"description": "Regina's Mulberry",
"raw_description": "Regina's Mulberry #1402 T48999-84",
"pending": true,
"enrichment": {
"category": {
"value": "food_and_drink",
"confidence": 99
},
"subcategory": {
"value": "coffee",
"confidence": 99
},
"merchant": {
"id": "a0822a4f-a59b-4fc9-a768-d880da5bd090",
"name": "Starbucks",
"logo": "https://example.com/starbucks.png",
"confidence": 99
},
"processor": {
"id": "a0822a4f-a59b-4fc9-a768-d880da5bd090",
"name": "Square",
"logo": "https://example.com/square.png",
"confidence": 99
},
"recurrence": {
"frequency": "monthly",
"next_predicted_date": "2024-08-03"
}
},
"original_id": string
}
],
"accounts": {
"additionalProp": {
"name": "Premier Checking",
"last_synced_at": "2023-02-16T09:14:11",
"institution_id": string,
"link_id": string
}
}
}
{
"error_code": "api_error.auth.expired_access_token",
"error_message": "Access token expired",
"documentation_url": string
}

account_id

: array

If present, filters results to transactions in accounts matching the given IDs.

min length:

1

end_date

: string

The latest date for which data should be returned, formatted as YYYY-MM-DD.

format:

date

page

: integer

The page number to return.

default: 1

size

: integer

The number of items to return per page.

default: 50

start_date

: string

The earliest date for which data should be returned, formatted as YYYY-MM-DD.

format:

date

id

: string

required

The unique ID for this user. This is the same ID provided in the call to link-session to create a link for this user.

example: MyUser1234

X-Client-Id

: string

Your client ID.

example: live_dcc75c42eb6122127356

X-Client-Secret

: string

Your client secret

example: vzPznCv3kT7fHsAr6y3jk38d

Responses

200

Successful Response

total

: integer

The total number of results for this query.

example: 82

page

: integer

The page number corresponding to this batch of results.

example: 1

size

: integer

The number of results in this batch.

example: 50

transactions

: array

accounts

: object