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?account_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'
fetch("https://api.moneykit.com/users/[id]/transactions?account_id=SOME_ARRAY_VALUE&page=SOME_INTEGER_VALUE&size=SOME_INTEGER_VALUE&start_date=SOME_STRING_VALUE&end_date=SOME_STRING_VALUE", {
"method": "GET",
"headers": {
"Authorization": "Bearer REPLACE_BEARER_TOKEN",
"X-Client-Id": "SOME_STRING_VALUE",
"X-Client-Secret": "SOME_STRING_VALUE"
}
})
.then(response => response.json())
.then(data => console.log(data));
import requests

url = "https://api.moneykit.com/users/[id]/transactions?account_id=SOME_ARRAY_VALUE&page=SOME_INTEGER_VALUE&size=SOME_INTEGER_VALUE&start_date=SOME_STRING_VALUE&end_date=SOME_STRING_VALUE"
headers = {
'Authorization': 'Bearer REPLACE_BEARER_TOKEN',
'X-Client-Id': 'SOME_STRING_VALUE',
'X-Client-Secret': 'SOME_STRING_VALUE'
}

response = requests.get(url, headers=headers)
print(response.json())
package main

import (
"fmt"
"net/http"
)

func main() {
req, _ := http.NewRequest("GET", "https://api.moneykit.com/users/[id]/transactions?account_id=SOME_ARRAY_VALUE&page=SOME_INTEGER_VALUE&size=SOME_INTEGER_VALUE&start_date=SOME_STRING_VALUE&end_date=SOME_STRING_VALUE", nil)
req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")
req.Header.Add("X-Client-Id", "SOME_STRING_VALUE")
req.Header.Add("X-Client-Secret", "SOME_STRING_VALUE")

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

fmt.Println(res)
}
require 'net/http'
require 'json'

uri = URI('https://api.moneykit.com/users/[id]/transactions?account_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(uri.host, uri.port)
http.use_ssl = true

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

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

let url = URL(string: "https://api.moneykit.com/users/[id]/transactions?account_id=SOME_ARRAY_VALUE&page=SOME_INTEGER_VALUE&size=SOME_INTEGER_VALUE&start_date=SOME_STRING_VALUE&end_date=SOME_STRING_VALUE")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.setValue("Bearer REPLACE_BEARER_TOKEN", forHTTPHeaderField: "Authorization")
request.setValue("SOME_STRING_VALUE", forHTTPHeaderField: "X-Client-Id")
request.setValue("SOME_STRING_VALUE", forHTTPHeaderField: "X-Client-Secret")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else { return }
print(String(data: data, encoding: .utf8)!)
}
task.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": "2022-02-08",
"datetime": "2023-02-16T09:14:11Z",
"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": "2022-02-08"
}
},
"original_id": string
}
],
"accounts": {
"additionalProp": {
"name": "Premier Checking",
"last_synced_at": "2023-02-16T09:14:11Z",
"institution_id": string,
"link_id": string
}
}
}
{
"error_code": "api_error.auth.expired_access_token",
"error_message": "Access token expired",
"documentation_url": string
}

account_id

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

end_date

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

page

: integer

The page number to return.

default: 1

size

: integer

The number of items to return per page.

default: 50

start_date

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

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