Skip to main content

get list of transactions for an account

GET /api/v1/Accounts/:accountNumber/transactions

Description

This endpoint retrieves a list of transactions associated with a specific account, based on specified query parameters.

Request

Headers:

  • Accept-Language: Change default response message language from English(en). Available languages fr,en

Query Parameters:

  • accountNumber: The number of the account for which to retrieve transactions. (Required)
  • type: The type of transaction to filter by. (Optional)
  • pageNumber: The page number of the results. (Optional)
  • pageSize: The number of items per page. (Optional)
  • descending: Whether to sort the results in descending order. (Optional)
  • version: The version of the API.

URL:

  • /api/v1/Accounts/{accountNumber}/transactions

Response:

  • 200: Success, returns a paged list of transactions.
  • 400: Bad Request, the request is not valid.
  • 404: Not Found, no transactions match the specified criteria.

Error Codes:

  • 400: Bad Request, the request is not valid.
  • 404: Not Found, no transactions match the specified criteria.
  • 500: Internal server error, something went wrong while processing the request.

Example Response:

jsonCopy codeHTTP/1.1 200 OK
{
"totalCount": 100,
"pageSize": 10,
"pageNumber": 1,
"items": [
{
"id": "123",
"type": "Deposit",
"amount": 100.0,
"date": "2024-02-16T12:00:00Z",
"source": {
"id": "124",
"name": "User 1"
},
"destination": {
"id": "125",
"name": "User 2"
}
},
{
"id": "124",
"type": "Withdrawal",
"amount": 50.0,
"date": "2024-02-17T12:00:00Z",
"source": {
"id": "125",
"name": "User 2"
},
"destination": {
"id": "126",
"name": "User 3"
}
}
]
}
jsonCopy codeHTTP/1.1 200 OK
{
"totalCount": 100,
"pageSize": 10,
"pageNumber": 1,
"items": [
{
"id": "123",
"type": "Deposit",
"amount": 100.0,
"date": "2024-02-16T12:00:00Z",
"source": {
"id": "124",
"name": "User 1"
},
"destination": {
"id": "125",
"name": "User 2"
}
},
{
"id": "124",
"type": "Withdrawal",
"amount": 50.0,
"date": "2024-02-17T12:00:00Z",
"source": {
"id": "125",
"name": "User 2"
},
"destination": {
"id": "126",
"name": "User 3"
}
}
]
}

Notes:

  • This endpoint is useful for retrieving a list of transactions associated with a specific account, based on specified query parameters.
  • The response includes the total count of transactions, the page size, the page number, and the list of transactions.
  • The Accept-Language header can be used to change the default response message language. Currently supported languages are English (en) and French (fr).
  • If no transactions match the specified criteria, a 404 Not Found response will be returned.

Headers


Accept-Language Change default response message language from English(en). Available languages fr,en

Accept text/plain

Content-TypeValue
Accepttext/plain
ParamValue
type2
descendingtrue
pageNumber1
pageSize10
Path variablesValue
accountNumber<string> (required)

LANGUAGE

AUTHORIZATION

Bearer

CURL REQUEST


curl --request GET \ 
--url /api/v1/Accounts/:accountNumber/transactions \
--header 'accept: application/json' \
--header 'content-type: application/json'

RESPONSE


Click Try It! to start a request and see the response here!