List files for an account
curl --request GET \
--url https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/statements/files \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/statements/files"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/statements/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/statements/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/statements/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/statements/files")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/statements/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"data": [
{
"type": "STATEMENT_PDF",
"token": "file_token",
"signed_url": "<signed_https_url_pointing_to_a_resource_on_S3>",
"closing_date": "2023-07-31T00:27:09",
"opening_date": "2023-07-01T00:27:09",
"account_token": "credit_account_token1234",
"statement_summary_token": "37f07818-2a2c-4c82-a721-a479936d5b2e"
},
{
"type": "STATEMENT_PDF",
"token": "file_token",
"signed_url": "<signed_https_url_pointing_to_a_resource_on_S3>",
"closing_date": "2023-06-30T00:27:09",
"opening_date": "2023-06-01T00:27:09",
"account_token": "credit_account_token4567",
"statement_summary_token": "79938791-5e15-456a-bf13-c39142c9a763"
}
],
"count": 1,
"is_more": false,
"end_index": 0,
"start_index": 0
}{
"code": 123,
"message": "<string>"
}Statements
List files for an account
Retrieve an array of statement files for a specific credit account.
GET
/
credit
/
accounts
/
{account_token}
/
statements
/
files
List files for an account
curl --request GET \
--url https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/statements/files \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/statements/files"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/statements/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/statements/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/statements/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/statements/files")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.marqeta.com/v3/credit/accounts/{account_token}/statements/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"data": [
{
"type": "STATEMENT_PDF",
"token": "file_token",
"signed_url": "<signed_https_url_pointing_to_a_resource_on_S3>",
"closing_date": "2023-07-31T00:27:09",
"opening_date": "2023-07-01T00:27:09",
"account_token": "credit_account_token1234",
"statement_summary_token": "37f07818-2a2c-4c82-a721-a479936d5b2e"
},
{
"type": "STATEMENT_PDF",
"token": "file_token",
"signed_url": "<signed_https_url_pointing_to_a_resource_on_S3>",
"closing_date": "2023-06-30T00:27:09",
"opening_date": "2023-06-01T00:27:09",
"account_token": "credit_account_token4567",
"statement_summary_token": "79938791-5e15-456a-bf13-c39142c9a763"
}
],
"count": 1,
"is_more": false,
"end_index": 0,
"start_index": 0
}{
"code": 123,
"message": "<string>"
}GET/////
Retrieve an array of statement files for a specific credit account.
URL path parameters
| Fields | Description |
|---|---|
| account_token string Required | The unique identifier of the credit account for which to retrieve statement files. Send a GET request to /credit/accounts to retrieve existing credit account tokens.Allowable Values: Existing account token |
URL query parameters
| Fields | Description |
|---|---|
| start_date datetime Optional | The start date of the statement files to return. Allowable Values: Example: 2020-01-01T00:00:00Z |
| end_date datetime Optional | The end date of the statement files to return. Allowable Values: Example: 2020-03-01T03:59:59Z |
| count integer Optional | The number of resources to retrieve. Allowable Values: 1–100 |
| start_index integer Optional | Sort order index of the first resource in the returned array. Allowable Values: 0 min |
| sort_by string Optional | Field on which to sort. Prefix the field name with a hyphen (-) to sort in descending order. Omit the hyphen to sort in ascending order.NOTE: You must sort using system field names such as createdTime, and not by the field names appearing in response bodies such as created_time.Allowable Values: createdTime, -createdTime |
Response body
| Fields | Description |
|---|---|
| count integer Returned | Number of resources returned. Allowable Values: 1-10 |
| start_index integer Returned | Sort order index of the first resource in the returned array. Allowable Values: Any integer |
| end_index integer Returned | Sort order index of the last resource in the returned array. Allowable Values: Any integer |
| is_more boolean Returned | A value of true indicates that more unreturned resources exist.Allowable Values: true, false |
| data array of objects Returned | List of statement files. Allowable Values: One or more statement files |
| data[].token string Conditionally returned | Unique identifier of the statement file. Allowable Values: 36 char max |
| data[].account_token string Conditionally returned | Unique identifier of the credit account on which the statement PDF file is generated. Allowable Values: 36 char max Existing account token |
| data[].statement_summary_token uuid Conditionally returned | Unique identifier of the statement summary. Allowable Values: Existing statement summary token |
| data[].opening_date datetime Conditionally returned | Date and time when the statement period began. Allowable Values: Format: yyyy-MM-ddThh:mm:ssZ |
| data[].closing_date datetime Conditionally returned | Date and time when the statement period ended. Allowable Values: Format: yyyy-MM-ddThh:mm:ssZ |
| data[].signed_url string Conditionally returned | The signed URL to retrieve the statement PDF file. Allowable Values: A valid signed URL |
| data[].type string Conditionally returned | Type of file. Allowable Values: STATEMENT_PDF |
Sample response body
JSON
{
"count": 1,
"start_index": 0,
"end_index": 0,
"is_more": false,
"data": [
{
"token": "file_token",
"account_token": "credit_account_token1234",
"statement_summary_token": "37f07818-2a2c-4c82-a721-a479936d5b2e",
"opening_date": "2021-07-01T00:27:09Z",
"closing_date": "2021-07-31T00:27:09Z",
"signed_url": "<signed_https_url_pointing_to_a_resource_on_S3>",
"type": "STATEMENT_PDF"
},
{
"token": "file_token",
"account_token": "credit_account_token4567",
"statement_summary_token": "79938791-5e15-456a-bf13-c39142c9a763",
"opening_date": "2021-06-01T00:27:09Z",
"closing_date": "2021-06-30T00:27:09Z",
"signed_url": "<signed_https_url_pointing_to_a_resource_on_S3>",
"type": "STATEMENT_PDF"
}
]
}
Authorizations
Path Parameters
Query Parameters
Field on which to sort.
Prefix the field name with a hyphen (-) to sort in descending order.
Omit the hyphen to sort in ascending order.
NOTE:
You must sort using system field names such as createdTime, and not by the field names appearing in response bodies such as created_time.
Available options:
createdTime, -createdTime Response
A JSON object containing a list of statement files.
Returns paginated statement files.
Was this page helpful?